mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 08:28:11 +00:00
hide/show stored password
This commit is contained in:
@@ -56,6 +56,7 @@ class GenerateShareLink extends React.Component {
|
||||
expDate: null,
|
||||
password: '',
|
||||
passwdnew: '',
|
||||
storedPasswordVisible: false,
|
||||
errorInfo: '',
|
||||
sharedLinkInfo: null,
|
||||
isNoticeMessageShow: false,
|
||||
@@ -181,6 +182,12 @@ class GenerateShareLink extends React.Component {
|
||||
this.setState({passwdnew: passwd});
|
||||
}
|
||||
|
||||
toggleStoredPasswordVisible = () => {
|
||||
this.setState({
|
||||
storedPasswordVisible: !this.state.storedPasswordVisible
|
||||
});
|
||||
}
|
||||
|
||||
setPermission = (e) => {
|
||||
this.setState({currentPermission: e.target.value});
|
||||
}
|
||||
@@ -404,7 +411,10 @@ class GenerateShareLink extends React.Component {
|
||||
<FormGroup className="mb-0">
|
||||
<dt className="text-secondary font-weight-normal">{gettext('Password:')}</dt>
|
||||
<dd className="d-flex">
|
||||
<span>{sharedLinkInfo.password}</span>
|
||||
<div className="d-flex align-items-center">
|
||||
<input id="stored-password" className="border-0 mr-1" type="text" value={this.state.storedPasswordVisible ? sharedLinkInfo.password : '****************************************'} readOnly={true} size={Math.max(sharedLinkInfo.password.length, 10)} />
|
||||
<span tabIndex="0" role="button" aria-label={this.state.storedPasswordVisible ? gettext('Hide') : gettext('Show')} onKeyDown={this.onIconKeyDown} onClick={this.toggleStoredPasswordVisible} className={`eye-icon fas ${this.state.storedPasswordVisible ? 'fa-eye': 'fa-eye-slash'}`}></span>
|
||||
</div>
|
||||
</dd>
|
||||
</FormGroup>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user