mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-27 15:54:39 +00:00
fix decrypt dialog (#2673)
This commit is contained in:
@@ -15,7 +15,7 @@ class LibDecryptDialog extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSubmit = () => {
|
handleSubmit = (e) => {
|
||||||
let repoID = this.props.repoID;
|
let repoID = this.props.repoID;
|
||||||
let password = this.state.password;
|
let password = this.state.password;
|
||||||
seafileAPI.setRepoDecryptPassword(repoID, password).then(res => {
|
seafileAPI.setRepoDecryptPassword(repoID, password).then(res => {
|
||||||
@@ -25,8 +25,15 @@ class LibDecryptDialog extends React.Component {
|
|||||||
showError: true
|
showError: true
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleKeyPress = (e) => {
|
||||||
|
if (e.key == 'Enter') {
|
||||||
|
this.handleSubmit(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
handleChange = (e) => {
|
handleChange = (e) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
password: e.target.value,
|
password: e.target.value,
|
||||||
@@ -50,10 +57,11 @@ class LibDecryptDialog extends React.Component {
|
|||||||
<p className="error">{gettext('Wrong password')}</p>
|
<p className="error">{gettext('Wrong password')}</p>
|
||||||
}
|
}
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<Input type="password" name="password" placeholder={gettext('Password')} onChange={this.handleChange}/>
|
<Input type="password" name="password" onKeyPress={this.handleKeyPress} placeholder={gettext('Password')} onChange={this.handleChange}/>
|
||||||
|
</FormGroup>
|
||||||
|
<FormGroup>
|
||||||
|
<Button type="submit" value="Submit" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
<Button onClick={this.handleSubmit}>{gettext('Submit')}</Button>
|
|
||||||
<br />
|
|
||||||
<p className="tip">{'* '}{gettext('The password will be kept in the server for only 1 hour.')}</p>
|
<p className="tip">{'* '}{gettext('The password will be kept in the server for only 1 hour.')}</p>
|
||||||
</Form>
|
</Form>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
Reference in New Issue
Block a user