mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-10 22:50:04 +00:00
added additional options for vault remember password
This commit is contained in:
parent
f7cab00e4d
commit
d82a88bcc6
@ -3,7 +3,7 @@
|
|||||||
h3.m-0 Vault is locked
|
h3.m-0 Vault is locked
|
||||||
.ml-auto(ngbDropdown, placement='bottom-right')
|
.ml-auto(ngbDropdown, placement='bottom-right')
|
||||||
button.btn.btn-link(ngbDropdownToggle, (click)='$event.stopPropagation()')
|
button.btn.btn-link(ngbDropdownToggle, (click)='$event.stopPropagation()')
|
||||||
span(*ngIf='rememberFor') Remember for {{rememberFor}} min
|
span(*ngIf='rememberFor') Remember for {{getRememberForDisplay(rememberFor)}}
|
||||||
span(*ngIf='!rememberFor') Do not remember
|
span(*ngIf='!rememberFor') Do not remember
|
||||||
div(ngbDropdownMenu)
|
div(ngbDropdownMenu)
|
||||||
button.dropdown-item(
|
button.dropdown-item(
|
||||||
@ -12,7 +12,7 @@
|
|||||||
button.dropdown-item(
|
button.dropdown-item(
|
||||||
*ngFor='let x of rememberOptions',
|
*ngFor='let x of rememberOptions',
|
||||||
(click)='rememberFor = x',
|
(click)='rememberFor = x',
|
||||||
) {{x}} min
|
) {{getRememberForDisplay(x)}}
|
||||||
|
|
||||||
.input-group
|
.input-group
|
||||||
input.form-control.form-control-lg(
|
input.form-control.form-control-lg(
|
||||||
|
@ -8,7 +8,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
|||||||
export class UnlockVaultModalComponent {
|
export class UnlockVaultModalComponent {
|
||||||
passphrase: string
|
passphrase: string
|
||||||
rememberFor = 1
|
rememberFor = 1
|
||||||
rememberOptions = [1, 5, 15, 60]
|
rememberOptions = [1, 5, 15, 60, 1440, 10080]
|
||||||
@ViewChild('input') input: ElementRef
|
@ViewChild('input') input: ElementRef
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
@ -33,4 +33,19 @@ export class UnlockVaultModalComponent {
|
|||||||
cancel (): void {
|
cancel (): void {
|
||||||
this.modalInstance.close(null)
|
this.modalInstance.close(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRememberForDisplay (rememberOption): string {
|
||||||
|
if (rememberOption >= 1440)
|
||||||
|
{
|
||||||
|
return `${Math.round((rememberOption/1440)*10)/10} day`
|
||||||
|
}
|
||||||
|
else if (rememberOption >= 60)
|
||||||
|
{
|
||||||
|
return `${Math.round((rememberOption/60)*10)/10} hour`
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return `${rememberOption} min`
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user