mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
reset pw
This commit is contained in:
@@ -976,6 +976,21 @@ class InfoRemoteEdit extends React.Component<{}, {}> {
|
||||
}
|
||||
}
|
||||
|
||||
canResetPw() : boolean {
|
||||
let redit = this.getRemoteEdit();
|
||||
if (redit == null) {
|
||||
return false;
|
||||
}
|
||||
return redit.haspassword && this.passwordStr.get() != PasswordUnchangedSentinel;
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
resetPw() : void {
|
||||
mobx.action(() => {
|
||||
this.passwordStr.set(PasswordUnchangedSentinel);
|
||||
})();
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
doSubmitRemote() {
|
||||
let redit = this.getRemoteEdit();
|
||||
@@ -1253,6 +1268,9 @@ class InfoRemoteEdit extends React.Component<{}, {}> {
|
||||
<div className="remote-field-label">ssh password</div>
|
||||
<div className="remote-field-control text-input">
|
||||
<input type="password" onFocus={this.onFocusPasswordStr} onChange={this.onChangePasswordStr} value={this.passwordStr.get()}/>
|
||||
<If condition={this.canResetPw()}>
|
||||
<i onClick={this.resetPw} title="restore to original password" className="icon fa fa-undo undo-icon"/>
|
||||
</If>
|
||||
</div>
|
||||
</div>
|
||||
</If>
|
||||
|
||||
@@ -905,6 +905,12 @@ body .xterm .xterm-viewport {
|
||||
color: @term-bright-white;
|
||||
}
|
||||
|
||||
.undo-icon {
|
||||
margin-left: 4px;
|
||||
cursor: pointer;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.remote-field-control {
|
||||
&.text-control {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user