mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-16 09:29:59 +00:00
fixed #297
This commit is contained in:
parent
6dc46bb970
commit
c285b89b6c
@ -41,7 +41,11 @@
|
|||||||
type='text',
|
type='text',
|
||||||
[(ngModel)]='connection.user',
|
[(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
|
.form-group
|
||||||
label Private key
|
label Private key
|
||||||
.input-group
|
.input-group
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { ElectronService, HostAppService } from 'terminus-core'
|
import { ElectronService, HostAppService } from 'terminus-core'
|
||||||
|
import { PasswordStorageService } from '../services/passwordStorage.service'
|
||||||
import { SSHConnection, LoginScript } from '../api'
|
import { SSHConnection, LoginScript } from '../api'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -9,15 +10,26 @@ import { SSHConnection, LoginScript } from '../api'
|
|||||||
export class EditConnectionModalComponent {
|
export class EditConnectionModalComponent {
|
||||||
connection: SSHConnection
|
connection: SSHConnection
|
||||||
newScript: LoginScript
|
newScript: LoginScript
|
||||||
|
hasSavedPassword: boolean
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private modalInstance: NgbActiveModal,
|
private modalInstance: NgbActiveModal,
|
||||||
private electron: ElectronService,
|
private electron: ElectronService,
|
||||||
private hostApp: HostAppService,
|
private hostApp: HostAppService,
|
||||||
|
private passwordStorage: PasswordStorageService,
|
||||||
) {
|
) {
|
||||||
this.newScript = { expect: '', send: '' }
|
this.newScript = { expect: '', send: '' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async ngOnInit () {
|
||||||
|
this.hasSavedPassword = !!(await this.passwordStorage.loadPassword(this.connection))
|
||||||
|
}
|
||||||
|
|
||||||
|
clearSavedPassword () {
|
||||||
|
this.hasSavedPassword = false
|
||||||
|
this.passwordStorage.deletePassword(this.connection)
|
||||||
|
}
|
||||||
|
|
||||||
selectPrivateKey () {
|
selectPrivateKey () {
|
||||||
let path = this.electron.dialog.showOpenDialog(
|
let path = this.electron.dialog.showOpenDialog(
|
||||||
this.hostApp.getWindow(),
|
this.hostApp.getWindow(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user