mirror of
https://github.com/Eugeny/tabby.git
synced 2025-02-17 14:49:39 +08:00
fixed #297
This commit is contained in:
parent
6dc46bb970
commit
c285b89b6c
@ -41,7 +41,11 @@
|
||||
type='text',
|
||||
[(ngModel)]='connection.user',
|
||||
)
|
||||
|
||||
|
||||
.alert.alert-info.d-flex.bg-transparent.text-white.align-items-center(*ngIf='hasSavedPassword')
|
||||
.mr-auto There is a saved password for this connection
|
||||
button.btn.btn-danger.ml-4((click)='clearSavedPassword()') Forget
|
||||
|
||||
.form-group
|
||||
label Private key
|
||||
.input-group
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { ElectronService, HostAppService } from 'terminus-core'
|
||||
import { PasswordStorageService } from '../services/passwordStorage.service'
|
||||
import { SSHConnection, LoginScript } from '../api'
|
||||
|
||||
@Component({
|
||||
@ -9,15 +10,26 @@ import { SSHConnection, LoginScript } from '../api'
|
||||
export class EditConnectionModalComponent {
|
||||
connection: SSHConnection
|
||||
newScript: LoginScript
|
||||
hasSavedPassword: boolean
|
||||
|
||||
constructor (
|
||||
private modalInstance: NgbActiveModal,
|
||||
private electron: ElectronService,
|
||||
private hostApp: HostAppService,
|
||||
private passwordStorage: PasswordStorageService,
|
||||
) {
|
||||
this.newScript = { expect: '', send: '' }
|
||||
}
|
||||
|
||||
async ngOnInit () {
|
||||
this.hasSavedPassword = !!(await this.passwordStorage.loadPassword(this.connection))
|
||||
}
|
||||
|
||||
clearSavedPassword () {
|
||||
this.hasSavedPassword = false
|
||||
this.passwordStorage.deletePassword(this.connection)
|
||||
}
|
||||
|
||||
selectPrivateKey () {
|
||||
let path = this.electron.dialog.showOpenDialog(
|
||||
this.hostApp.getWindow(),
|
||||
|
Loading…
Reference in New Issue
Block a user