1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 08:28:11 +00:00

update create encrypt repo

This commit is contained in:
ilearnit
2018-12-17 09:26:27 +00:00
parent d2ff0bb5eb
commit aa3b408e3a
4 changed files with 32 additions and 25 deletions

View File

@@ -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,6 +170,8 @@ class CreateRepoDialog extends React.Component {
</Input>
</FormGroup>
)}
{enableEncryptedLibrary &&
<div>
<FormGroup check>
<Input type="checkbox" id="encrypt" onChange={this.onEncrypted}/>
<Label for="encrypt">{gettext('Encrypt')}</Label>
@@ -194,6 +196,8 @@ class CreateRepoDialog extends React.Component {
onChange={this.handlePassword2Change}
/>
</FormGroup>
</div>
}
</Form>
<Label className="err-message">{gettext(this.state.errMessage)}</Label>
</ModalBody>

View File

@@ -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 : '';

View File

@@ -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 }}',
}
};
</script>

View File

@@ -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', {