diff --git a/frontend/src/components/file-view/file-view.js b/frontend/src/components/file-view/file-view.js index f161af7b79f..8992a431add 100644 --- a/frontend/src/components/file-view/file-view.js +++ b/frontend/src/components/file-view/file-view.js @@ -31,7 +31,7 @@ const propTypes = { const { isStarred, isLocked, lockedByMe, repoID, filePath, filePerm, enableWatermark, userNickName, - fileName + fileName, repoEncrypted } = window.app.pageOptions; class FileView extends React.Component { @@ -114,6 +114,10 @@ class FileView extends React.Component { render() { const { isOnlyofficeFile = false } = this.props; const { isDetailsPanelOpen, isHeaderShown } = this.state; + const repoInfo = { + permission: filePerm, + encrypted: repoEncrypted + }; return ( }> @@ -152,14 +156,14 @@ class FileView extends React.Component { } {this.props.content} {isDetailsPanelOpen && ( - + - + diff --git a/frontend/src/index.js b/frontend/src/index.js index 8dc1862bbd8..41dea60d498 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -10,12 +10,12 @@ import { CollaboratorsProvider } from './metadata'; import './index.css'; -const { repoID } = window.app.pageOptions; +const { repoID, repoEncrypted, filePerm } = window.app.pageOptions; ReactDom.render( }> - + diff --git a/frontend/src/view-file-sdoc.js b/frontend/src/view-file-sdoc.js index f113a99145b..d1c9f2de8e7 100644 --- a/frontend/src/view-file-sdoc.js +++ b/frontend/src/view-file-sdoc.js @@ -12,7 +12,7 @@ import { TagsProvider } from './tag/hooks'; const { serviceURL, avatarURL, siteRoot, lang, mediaUrl, isPro } = window.app.config; const { username, name } = window.app.userInfo; const { - repoID, repoName, parentDir, filePerm, + repoID, repoName, repoEncrypted, parentDir, filePerm, docPath, docName, docUuid, seadocAccessToken, seadocServerUrl, assetsUrl, isSdocRevision, isPublished, originFilename, revisionCreatedAt, originFileVersion, originFilePath, originDocUuid, revisionId, isFreezed @@ -51,12 +51,14 @@ window.seafile = { isPro: isPro === 'True' ? true : false, }; +const repoInfo = { encrypted: repoEncrypted, permission: filePerm }; + ReactDom.render( }> - + - + diff --git a/seahub/templates/markdown_file_view_react.html b/seahub/templates/markdown_file_view_react.html index d20eb1698b6..d18e7a64a80 100644 --- a/seahub/templates/markdown_file_view_react.html +++ b/seahub/templates/markdown_file_view_react.html @@ -38,8 +38,10 @@ pageOptions: { repoID: '{{ repo.id }}', repoName: '{{ repo.name|escapejs }}', + repoEncrypted: {% if repo.encrypted %}true{% else %}false{% endif %}, filePath: '{{ path|escapejs }}', fileName: '{{ filename|escapejs }}', + filePerm: '{{ file_perm }}', rawPath: '{{ raw_path|escapejs }}', domain: '{{ domain }}', protocol: '{{ protocol }}',