mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +00:00
"['dir view'] display file access log in a dialog instead of an independent page (#6673)
- click 'Access Log' in the menu for files in list/grid mode, or single-selected file
This commit is contained in:
@@ -18,6 +18,7 @@ import ZipDownloadDialog from '../dialog/zip-download-dialog';
|
||||
import EditFileTagDialog from '../dialog/edit-filetag-dialog';
|
||||
import EditFileTagPopover from '../popover/edit-filetag-popover';
|
||||
import LibSubFolderPermissionDialog from '../dialog/lib-sub-folder-permission-dialog';
|
||||
import FileAccessLog from '../dialog/file-access-log';
|
||||
import toaster from '../toast';
|
||||
import FileTag from './file-tag';
|
||||
|
||||
@@ -81,6 +82,7 @@ class DirentListItem extends React.Component {
|
||||
isOperationShow: false,
|
||||
highlight: false,
|
||||
isZipDialogOpen: false,
|
||||
isFileAccessLogDialogOpen: false,
|
||||
isMoveDialogShow: false,
|
||||
isCopyDialogShow: false,
|
||||
isShareDialogShow: false,
|
||||
@@ -298,7 +300,7 @@ class DirentListItem extends React.Component {
|
||||
this.onHistory();
|
||||
break;
|
||||
case 'Access Log':
|
||||
this.onAccessLog();
|
||||
this.toggleFileAccessLogDialog();
|
||||
break;
|
||||
case 'Properties':
|
||||
this.props.onDirentClick(this.props.dirent);
|
||||
@@ -415,10 +417,10 @@ class DirentListItem extends React.Component {
|
||||
location.href = url;
|
||||
};
|
||||
|
||||
onAccessLog = () => {
|
||||
let filePath = this.getDirentPath(this.props.dirent);
|
||||
let path = siteRoot + 'repo/file-access/' + this.props.repoID + '/?p=' + encodeURIComponent(filePath) ;
|
||||
window.open(path);
|
||||
toggleFileAccessLogDialog = () => {
|
||||
this.setState({
|
||||
isFileAccessLogDialogOpen: !this.state.isFileAccessLogDialogOpen
|
||||
});
|
||||
};
|
||||
|
||||
onOpenViaClient = () => {
|
||||
@@ -935,6 +937,16 @@ class DirentListItem extends React.Component {
|
||||
/>
|
||||
</ModalPortal>
|
||||
}
|
||||
{this.state.isFileAccessLogDialogOpen &&
|
||||
<ModalPortal>
|
||||
<FileAccessLog
|
||||
repoID={this.props.repoID}
|
||||
filePath={direntPath}
|
||||
fileName={dirent.name}
|
||||
toggleDialog={this.toggleFileAccessLogDialog}
|
||||
/>
|
||||
</ModalPortal>
|
||||
}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user