mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
* fix Tor logs actually fetching od logs * chore: update to Angular 18 * chore: update to Angular 19 * bump patchDB * chore: update Angular * chore: fix setup-wizard success page * chore: fix * chore: fix * chore: fix * chore: fix --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> Co-authored-by: Aiden McClelland <me@drbonez.dev>
27 lines
808 B
TypeScript
27 lines
808 B
TypeScript
import { Directive, ElementRef, inject, input, Output } from '@angular/core'
|
|
import { StartOSDiskInfo } from '@start9labs/shared'
|
|
import { TuiDialogService } from '@taiga-ui/core'
|
|
import { filter, fromEvent, switchMap } from 'rxjs'
|
|
import { PASSWORD } from 'src/app/components/password.component'
|
|
|
|
@Directive({
|
|
selector: 'button[server][password]',
|
|
})
|
|
export class PasswordDirective {
|
|
private readonly dialogs = inject(TuiDialogService)
|
|
|
|
readonly server = input.required<StartOSDiskInfo>()
|
|
|
|
@Output()
|
|
readonly password = fromEvent(inject(ElementRef).nativeElement, 'click').pipe(
|
|
switchMap(() =>
|
|
this.dialogs.open<string>(PASSWORD, {
|
|
label: 'Unlock Drive',
|
|
size: 's',
|
|
data: { passwordHash: this.server().passwordHash },
|
|
}),
|
|
),
|
|
filter(Boolean),
|
|
)
|
|
}
|