mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-01 23:21:59 +01:00
reset pw
This commit is contained in:
parent
4e76514f1b
commit
0173cbce23
18
src/main.tsx
18
src/main.tsx
@ -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 {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user