{{ 'No drives found. Please connect a drive and click Refresh.' | i18n }}
} @else {${this.i18n.transform('Data on this drive will be overwritten.')}
` : `${this.i18n.transform('Data on both drives will be overwritten.')}
` this.dialogs .openConfirm({ label: 'Warning', data: { content: message as i18nKey, yes: 'Continue', no: 'Cancel', }, }) .pipe(filter(Boolean)) .subscribe(() => { this.installOs(true) }) } private async installOs(wipe: boolean) { const loader = this.loader.open('Installing StartOS').subscribe() try { const result = await this.api.installOs({ osDrive: this.selectedOsDrive!.logicalname, dataDrive: { logicalname: this.selectedDataDrive!.logicalname, wipe, }, }) this.stateService.dataDriveGuid = result.guid this.stateService.attach = result.attach this.stateService.mokEnrolled = result.mokEnrolled loader.unsubscribe() // Show success dialog this.dialogSub = this.dialogs .openAlert('StartOS has been installed successfully.', { label: 'Installation Complete!', dismissible: false, closable: true, data: this.i18n.transform('Continue to Setup'), }) .subscribe({ complete: () => { this.navigateToNextStep(result.attach) }, }) } catch (e: any) { loader.unsubscribe() this.errorService.handleError(e) } } private async navigateToNextStep(attach: boolean) { if (attach) { this.stateService.setupType = 'attach' await this.router.navigate(['/password']) } else { await this.router.navigate(['/home']) } } private async shutdownServer() { this.dialogSub?.unsubscribe() const loader = this.loader.open('Beginning shutdown').subscribe() try { await this.api.shutdown() this.shuttingDown = true } catch (e: any) { this.errorService.handleError(e) } finally { loader.unsubscribe() } } private async loadDrives() { try { this.drives = (await this.api.getDisks()).filter(d => d.capacity > 0) } catch (e: any) { this.errorService.handleError(e) } finally { this.loading = false } } }