mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 04:18:21 +00:00
lib decrypt
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user