1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-23 04:18:21 +00:00

lib decrypt

This commit is contained in:
ilearnit
2018-12-13 09:53:39 +00:00
parent 644acfebf3
commit cccf826116
4 changed files with 106 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ class DirView extends React.Component {
repoName: '',
repoID: '',
permission: true,
libNeedDecrypt: false,
isDirentSelected: false,
isAllDirentSelected: false,
isDirentListLoading: true,
@@ -55,12 +56,16 @@ class DirView extends React.Component {
repoName: repo.repo_name,
permission: repo.permission === 'rw',
currentRepo: repo,
libNeedDecrypt: res.data.lib_need_decrypt,
});
let repoName = repo.repo_name;
let index = location.indexOf(repoName);
let path = location.slice(index + repoName.length);
this.updateDirentList(path);
this.setState({path: path});
if (!res.data.lib_need_decrypt) {
this.updateDirentList(path);
}
});
}
@@ -427,6 +432,13 @@ class DirView extends React.Component {
}
}
onLibDecryptDialog = () => {
this.setState({
libNeedDecrypt: !this.state.libNeedDecrypt
})
this.updateDirentList(this.state.path);
}
render() {
return (
<DirPanel
@@ -462,6 +474,8 @@ class DirView extends React.Component {
switchViewMode={this.switchViewMode}
onSearchedClick={this.onSearchedClick}
onFileUploadSuccess={this.onFileUploadSuccess}
libNeedDecrypt={this.state.libNeedDecrypt}
onLibDecryptDialog={this.onLibDecryptDialog}
/>
);
}