mirror of
https://github.com/Eugeny/tabby.git
synced 2024-09-21 01:47:28 +03:00
Merge pull request #4779 from tainoNZ/master
This commit is contained in:
commit
47e1bfc810
@ -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,14 @@ export class UnlockVaultModalComponent {
|
|||||||
cancel (): void {
|
cancel (): void {
|
||||||
this.modalInstance.close(null)
|
this.modalInstance.close(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRememberForDisplay (rememberOption: number): 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…
Reference in New Issue
Block a user