mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-06 11:29:53 +00:00
make password saving optional (fixes #644)
This commit is contained in:
parent
c35c8791f9
commit
77058c0472
@ -8,3 +8,12 @@
|
||||
(keyup.enter)='ok()',
|
||||
(keyup.esc)='cancel()',
|
||||
)
|
||||
.d-flex.align-items-start.mt-2
|
||||
checkbox(
|
||||
*ngIf='showRememberCheckbox',
|
||||
[(model)]='remember',
|
||||
text='Remember'
|
||||
)
|
||||
button.btn.btn-primary.ml-auto(
|
||||
(click)='ok()',
|
||||
) Enter
|
||||
|
@ -8,6 +8,8 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
export class PromptModalComponent {
|
||||
@Input() value: string
|
||||
@Input() password: boolean
|
||||
@Input() remember: boolean
|
||||
@Input() showRememberCheckbox: boolean
|
||||
@ViewChild('input') input: ElementRef
|
||||
|
||||
constructor (
|
||||
|
@ -192,12 +192,16 @@ export class SSHService {
|
||||
const modal = this.ngbModal.open(PromptModalComponent)
|
||||
modal.componentInstance.prompt = `Password for ${session.connection.user}@${session.connection.host}`
|
||||
modal.componentInstance.password = true
|
||||
modal.componentInstance.showRememberCheckbox = true
|
||||
try {
|
||||
savedPassword = await modal.result
|
||||
let password = await modal.result
|
||||
if (modal.componentInstance.remember) {
|
||||
savedPassword = password
|
||||
}
|
||||
return password
|
||||
} catch (_) {
|
||||
return ''
|
||||
}
|
||||
return savedPassword
|
||||
})
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user