1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-09-20 09:27:16 +03:00
This commit is contained in:
Eugene Pankov 2018-09-04 23:14:10 +02:00
parent 6dc46bb970
commit c285b89b6c
2 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -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(),