mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
update create encrypt repo
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label } from 'reactstrap';
|
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 = {
|
const propTypes = {
|
||||||
libraryType: PropTypes.string.isRequired,
|
libraryType: PropTypes.string.isRequired,
|
||||||
@@ -170,6 +170,8 @@ class CreateRepoDialog extends React.Component {
|
|||||||
</Input>
|
</Input>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
|
{enableEncryptedLibrary &&
|
||||||
|
<div>
|
||||||
<FormGroup check>
|
<FormGroup check>
|
||||||
<Input type="checkbox" id="encrypt" onChange={this.onEncrypted}/>
|
<Input type="checkbox" id="encrypt" onChange={this.onEncrypted}/>
|
||||||
<Label for="encrypt">{gettext('Encrypt')}</Label>
|
<Label for="encrypt">{gettext('Encrypt')}</Label>
|
||||||
@@ -194,6 +196,8 @@ class CreateRepoDialog extends React.Component {
|
|||||||
onChange={this.handlePassword2Change}
|
onChange={this.handlePassword2Change}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</Form>
|
</Form>
|
||||||
<Label className="err-message">{gettext(this.state.errMessage)}</Label>
|
<Label className="err-message">{gettext(this.state.errMessage)}</Label>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
@@ -29,6 +29,7 @@ export const shareLinkExpireDaysMin = window.app.pageOptions.shareLinkExpireDays
|
|||||||
export const shareLinkExpireDaysMax = window.app.pageOptions.shareLinkExpireDaysMax;
|
export const shareLinkExpireDaysMax = window.app.pageOptions.shareLinkExpireDaysMax;
|
||||||
export const maxFileName = window.app.pageOptions.maxFileName;
|
export const maxFileName = window.app.pageOptions.maxFileName;
|
||||||
export const enableWiki = window.app.pageOptions.enableWiki;
|
export const enableWiki = window.app.pageOptions.enableWiki;
|
||||||
|
export const enableEncryptedLibrary = window.app.pageOptions.enableEncryptedLibrary === '1';
|
||||||
|
|
||||||
// wiki
|
// wiki
|
||||||
export const slug = window.wiki ? window.wiki.config.slug : '';
|
export const slug = window.wiki ? window.wiki.config.slug : '';
|
||||||
|
@@ -63,6 +63,7 @@
|
|||||||
shareLinkExpireDaysMax: "{{ share_link_expire_days_max }}",
|
shareLinkExpireDaysMax: "{{ share_link_expire_days_max }}",
|
||||||
maxFileName: "{{ max_file_name }}",
|
maxFileName: "{{ max_file_name }}",
|
||||||
enableWiki: {% if enable_wiki %} true {% else %} false {% endif %},
|
enableWiki: {% if enable_wiki %} true {% else %} false {% endif %},
|
||||||
|
enableEncryptedLibrary: '{{ enable_encrypted_library }}',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@@ -718,6 +718,7 @@ def libraries(request):
|
|||||||
'enable_repo_snapshot_label': settings.ENABLE_REPO_SNAPSHOT_LABEL,
|
'enable_repo_snapshot_label': settings.ENABLE_REPO_SNAPSHOT_LABEL,
|
||||||
'share_link_expire_days_min': SHARE_LINK_EXPIRE_DAYS_MIN,
|
'share_link_expire_days_min': SHARE_LINK_EXPIRE_DAYS_MIN,
|
||||||
'share_link_expire_days_max': SHARE_LINK_EXPIRE_DAYS_MAX,
|
'share_link_expire_days_max': SHARE_LINK_EXPIRE_DAYS_MAX,
|
||||||
|
'enable_encrypted_library': config.ENABLE_ENCRYPTED_LIBRARY,
|
||||||
})
|
})
|
||||||
|
|
||||||
return render(request, 'libraries.html', {
|
return render(request, 'libraries.html', {
|
||||||
|
Reference in New Issue
Block a user