mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
pw modal
This commit is contained in:
committed by
Aiden McClelland
parent
1311f473f9
commit
fbcf4cacdb
@@ -10,7 +10,7 @@
|
||||
<h2 color="light">Select Data Drive</h2>
|
||||
<ion-card
|
||||
*ngFor="let drive of dataDrives"
|
||||
(click)="selectDrive(drive['logical-name'])"
|
||||
(click)="selectDrive(drive)"
|
||||
button="true"
|
||||
[class.selected]="selectedDrive === drive['logical-name']"
|
||||
color="light"
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div *ngIf="stateService.selectedDataDrive">
|
||||
<ion-card
|
||||
[routerLink]="['/password']"
|
||||
(click)="presentPasswordModal()"
|
||||
button="true"
|
||||
color="light"
|
||||
>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { AlertController } from '@ionic/angular'
|
||||
import { AlertController, ModalController } from '@ionic/angular'
|
||||
import { ApiService } from 'src/app/services/api/api.service'
|
||||
import { StateService } from 'src/app/services/state.service'
|
||||
import { PasswordPage } from '../password/password.page'
|
||||
|
||||
@Component({
|
||||
selector: 'home',
|
||||
@@ -16,6 +17,7 @@ export class HomePage {
|
||||
private readonly apiService: ApiService,
|
||||
private readonly stateService: StateService,
|
||||
private readonly alertController: AlertController,
|
||||
private modalController: ModalController,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -62,4 +64,25 @@ export class HomePage {
|
||||
this.stateService.selectedDataDrive = this.selectedDrive
|
||||
}
|
||||
|
||||
async presentPasswordModal() {
|
||||
const modal = await this.modalController.create({
|
||||
component: PasswordPage,
|
||||
backdropDismiss: false,
|
||||
componentProps: {
|
||||
'version': null,
|
||||
}
|
||||
})
|
||||
modal.onDidDismiss().then(ret => {
|
||||
if(ret.data.pwValid) {
|
||||
this.submitPassword(ret.data.password)
|
||||
}
|
||||
})
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
async submitPassword (pw: string) {
|
||||
await this.apiService.submitPassword(pw)
|
||||
// @TODO navigate to embassyOS
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user