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:
@@ -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 {
|
||||
</Input>
|
||||
</FormGroup>
|
||||
)}
|
||||
<FormGroup check>
|
||||
<Input type="checkbox" id="encrypt" onChange={this.onEncrypted}/>
|
||||
<Label for="encrypt">{gettext('Encrypt')}</Label>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Label for="passwd1">{gettext('Password')}{' '}<span className="tip">({gettext('at least 8 characters')})</span></Label>
|
||||
<Input
|
||||
id="passwd1"
|
||||
type="password"
|
||||
disabled={this.state.disabled}
|
||||
value={this.state.password1}
|
||||
onChange={this.handlePassword1Change}
|
||||
/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Label for="passwd2">{gettext('Password again')}</Label>
|
||||
<Input
|
||||
id="passwd2"
|
||||
type="password"
|
||||
disabled={this.state.disabled}
|
||||
value={this.state.password2}
|
||||
onChange={this.handlePassword2Change}
|
||||
/>
|
||||
</FormGroup>
|
||||
{enableEncryptedLibrary &&
|
||||
<div>
|
||||
<FormGroup check>
|
||||
<Input type="checkbox" id="encrypt" onChange={this.onEncrypted}/>
|
||||
<Label for="encrypt">{gettext('Encrypt')}</Label>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Label for="passwd1">{gettext('Password')}{' '}<span className="tip">({gettext('at least 8 characters')})</span></Label>
|
||||
<Input
|
||||
id="passwd1"
|
||||
type="password"
|
||||
disabled={this.state.disabled}
|
||||
value={this.state.password1}
|
||||
onChange={this.handlePassword1Change}
|
||||
/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Label for="passwd2">{gettext('Password again')}</Label>
|
||||
<Input
|
||||
id="passwd2"
|
||||
type="password"
|
||||
disabled={this.state.disabled}
|
||||
value={this.state.password2}
|
||||
onChange={this.handlePassword2Change}
|
||||
/>
|
||||
</FormGroup>
|
||||
</div>
|
||||
}
|
||||
</Form>
|
||||
<Label className="err-message">{gettext(this.state.errMessage)}</Label>
|
||||
</ModalBody>
|
||||
|
@@ -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 : '';
|
||||
|
@@ -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>
|
||||
|
@@ -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', {
|
||||
|
Reference in New Issue
Block a user