diff --git a/frontend/src/components/dialog/create-repo-dialog.js b/frontend/src/components/dialog/create-repo-dialog.js
index 5fb166a0c0..cf84a0e53f 100644
--- a/frontend/src/components/dialog/create-repo-dialog.js
+++ b/frontend/src/components/dialog/create-repo-dialog.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label } from 'reactstrap';
-import { gettext } from '../../utils/constants';
+import { gettext, enableEncryptedLibrary } from '../../utils/constants';
const propTypes = {
libraryType: PropTypes.string.isRequired,
@@ -170,30 +170,34 @@ class CreateRepoDialog extends React.Component {
)}
-
-
-
-
-
-
-
-
-
-
-
-
+ {enableEncryptedLibrary &&
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
diff --git a/frontend/src/utils/constants.js b/frontend/src/utils/constants.js
index 1a89bb86c5..94df88541a 100644
--- a/frontend/src/utils/constants.js
+++ b/frontend/src/utils/constants.js
@@ -29,6 +29,7 @@ export const shareLinkExpireDaysMin = window.app.pageOptions.shareLinkExpireDays
export const shareLinkExpireDaysMax = window.app.pageOptions.shareLinkExpireDaysMax;
export const maxFileName = window.app.pageOptions.maxFileName;
export const enableWiki = window.app.pageOptions.enableWiki;
+export const enableEncryptedLibrary = window.app.pageOptions.enableEncryptedLibrary === '1';
// wiki
export const slug = window.wiki ? window.wiki.config.slug : '';
diff --git a/seahub/templates/base_for_react.html b/seahub/templates/base_for_react.html
index 98857b8dc7..9235c2d42f 100644
--- a/seahub/templates/base_for_react.html
+++ b/seahub/templates/base_for_react.html
@@ -63,6 +63,7 @@
shareLinkExpireDaysMax: "{{ share_link_expire_days_max }}",
maxFileName: "{{ max_file_name }}",
enableWiki: {% if enable_wiki %} true {% else %} false {% endif %},
+ enableEncryptedLibrary: '{{ enable_encrypted_library }}',
}
};
diff --git a/seahub/views/__init__.py b/seahub/views/__init__.py
index 78d7823da4..ecd653be3d 100644
--- a/seahub/views/__init__.py
+++ b/seahub/views/__init__.py
@@ -718,6 +718,7 @@ def libraries(request):
'enable_repo_snapshot_label': settings.ENABLE_REPO_SNAPSHOT_LABEL,
'share_link_expire_days_min': SHARE_LINK_EXPIRE_DAYS_MIN,
'share_link_expire_days_max': SHARE_LINK_EXPIRE_DAYS_MAX,
+ 'enable_encrypted_library': config.ENABLE_ENCRYPTED_LIBRARY,
})
return render(request, 'libraries.html', {