This commit is contained in:
Matt Hill
2022-01-18 13:38:06 -07:00
committed by Aiden McClelland
parent fc081f1924
commit ebfea51571
16 changed files with 58 additions and 31 deletions

View File

@@ -22,7 +22,7 @@ v8.0.0
`cd diagnostic-ui/`
`npm --prefix . install @ionic/cli`
`npm install -g @ionic/cli`
`npm --prefix . install`

View File

@@ -20,7 +20,7 @@ v8.0.0
`cd setup-wizard/`
`npm --prefix . install @ionic/cli`
`npm install -g @ionic/cli`
`npm --prefix . install`

View File

@@ -1,7 +1,7 @@
<ion-header>
<ion-toolbar>
<ion-title>
Verify Recovery Product Key
Enter Product Key
</ion-title>
</ion-toolbar>
</ion-header>
@@ -10,7 +10,7 @@
<form (ngSubmit)="verifyProductKey()">
<div style="padding: 8px 24px;">
<div style="padding-bottom: 16px;">
<p>Verify the product key for the chosen recovery drive.</p>
<p>Enter your 0.2.x Product Key to establish an encrypted connection with your new Embassy.</p>
</div>
<ion-item>
<ion-input
@@ -34,7 +34,7 @@
Cancel
</ion-button>
<ion-button class="ion-padding-end" slot="end" color="dark" fill="clear" strong="true" (click)="verifyProductKey()">
Verify
Submit
</ion-button>
</ion-toolbar>
</ion-footer>

View File

@@ -26,8 +26,9 @@
<!-- not loading -->
<ng-template #loaded>
<ng-container *ngIf="!storageDrives.length">
<ion-button fill="clear" color="light" (click)="getDrives()">
<ion-icon color="primary" size="large" name='refresh' icon-start></ion-icon>
<ion-button fill="clear" color="primary" (click)="getDrives()">
<ion-icon slot="start" name='refresh'></ion-icon>
Refresh
</ion-button>
</ng-container>

View File

@@ -46,7 +46,7 @@ export class EmbassyPage {
const list = `<ul>${reconnect.map(recon => `<li>${recon}</li>`)}</ul>`
const alert = await this.alertCtrl.create({
header: 'Warning',
message: `One or more devices you connected had to be reconfigured to support the current hardware platform. Please unplug and replug in the following device(s):<br> ${list}`,
message: `One or more devices you connected had to be reconfigured to support the current hardware platform. Please unplug and replug the following device(s), then refresh the page:<br> ${list}`,
buttons: [
{
role: 'cancel',

View File

@@ -29,7 +29,7 @@
>
<ion-card-header>
<ion-card-title style="font-size: 40px;">Recover</ion-card-title>
<ion-card-subtitle>Recover data from an old embassy</ion-card-subtitle>
<ion-card-subtitle>Restore from backup or recover an old Embassy</ion-card-subtitle>
</ion-card-header>
</ion-card>
</ion-card-content>

View File

@@ -9,7 +9,7 @@
<ion-card color="dark">
<ion-card-header>
<ion-card-title style="font-size: 40px;">Recovering From Backup</ion-card-title>
<ion-card-title style="font-size: 40px;">Recovering</ion-card-title>
<ion-card-subtitle>Progress: {{ (stateService.dataProgress * 100).toFixed(0) }}%</ion-card-subtitle>
</ion-card-header>

View File

@@ -9,13 +9,14 @@
<ion-card color="dark">
<ion-card-header style="padding-bottom: 8px;">
<ion-card-title>Enter Product Key</ion-card-title>
<ion-card-title>Product Key</ion-card-title>
<ion-card-subtitle>Enter your product key to establish an encrypted connection with your Embassy</ion-card-subtitle>
</ion-card-header>
<ion-card-content class="ion-margin">
<form (submit)="submit()" style="margin-bottom: 12px;">
<ion-item-group class="ion-padding-bottom">
<p class="ion-text-left">Product Key</p>
<!-- <p class="ion-text-left">Product Key</p> -->
<ion-item color="dark">
<ion-icon slot="start" name="key-outline" style="margin-right: 16px;"></ion-icon>
<ion-input

View File

@@ -2,7 +2,7 @@
<!-- has backup -->
<h2 *ngIf="hasValidBackup; else noBackup">
<ion-icon name="cloud-done" color="success"></ion-icon>
{{ is02x ? 'Embassy 0.2.x backup detected' : 'Embassy backup detected' }}
{{ is02x ? 'Embassy 0.2.x detected' : 'Embassy backup detected' }}
</h2>
<!-- no backup -->
<ng-template #noBackup>

View File

@@ -9,8 +9,8 @@
<ion-card color="dark">
<ion-card-header class="ion-text-center">
<ion-card-title>Restore from Backup</ion-card-title>
<ion-card-subtitle>Select the shared folder or physical drive containing your Embassy backup</ion-card-subtitle>
<ion-card-title>Recover</ion-card-title>
<ion-card-subtitle>Select the shared folder or drive containing your Embassy backup</ion-card-subtitle>
</ion-card-header>
<ion-card-content class="ion-margin">
@@ -24,7 +24,7 @@
</h2>
<p class="ion-padding-bottom">
Using a shared folder is the recommended way to recover from backup, since it works with all Embassy hardware configurations.
To restore from a shared folder, please follow the <a href="https://docs.start9.com/user-manual/general/backups.html#shared-network-folder" target="_blank" noreferrer>instructions</a>.
To recover from a shared folder, please follow the <a href="https://docs.start9.com/user-manual/general/backups.html#shared-network-folder" target="_blank" noreferrer>instructions</a>.
</p>
<!-- connect -->
@@ -42,7 +42,7 @@
</h2>
<p class="ion-padding-bottom">
Warning! Plugging in more than one physical drive to Embassy can lead to power failure and data corruption.
To restore from a physical drive, please follow the <a href="https://docs.start9.com/user-manual/general/backups.html#physical-drive" target="_blank" noreferrer>instructions</a>.
To recover from a physical drive, please follow the <a href="https://docs.start9.com/user-manual/general/backups.html#physical-drive" target="_blank" noreferrer>instructions</a>.
</p>
<ng-container *ngFor="let mapped of mappedDrives">

View File

@@ -1,5 +1,5 @@
import { Component, Input } from '@angular/core'
import { AlertController, LoadingController, ModalController, NavController } from '@ionic/angular'
import { AlertController, IonicSafeString, LoadingController, ModalController, NavController } from '@ionic/angular'
import { CifsModal } from 'src/app/modals/cifs-modal/cifs-modal.page'
import { ApiService, DiskBackupTarget } from 'src/app/services/api/api.service'
import { ErrorToastService } from 'src/app/services/error-toast.service'
@@ -50,6 +50,7 @@ export class RecoverPage {
const drive: DiskBackupTarget = {
vendor: d.vendor,
model: d.model,
guid: d.guid,
logicalname: p.logicalname,
label: p.label,
capacity: p.capacity,
@@ -70,7 +71,7 @@ export class RecoverPage {
const list = `<ul>${reconnect.map(recon => `<li>${recon}</li>`)}</ul>`
const alert = await this.alertCtrl.create({
header: 'Warning',
message: `One or more devices you connected had to be reconfigured to support the current hardware platform. Please unplug and replug in the following device(s), then refresh the page:<br> ${list}`,
message: `One or more devices you connected had to be reconfigured to support the current hardware platform. Please unplug and replug the following device(s), then refresh the page:<br> ${list}`,
buttons: [
{
role: 'cancel',
@@ -81,11 +82,12 @@ export class RecoverPage {
await alert.present()
}
const importableDrive = disks.find(d => !!d.guid)
const importableDrive = this.mappedDrives.find(d => !!d.drive.guid)
if (!!importableDrive && !this.hasShownGuidAlert) {
const nested = importableDrive.drive
const alert = await this.alertCtrl.create({
header: 'Embassy Drive Detected',
message: 'A valid EmbassyOS data drive has been detected. To use this drive as-is, simply click "Use Drive" below.',
header: 'Embassy Data Drive Detected',
message: new IonicSafeString(`${nested.label || nested.logicalname} (${nested.vendor || 'Unknown Vendor'} - ${nested.model || 'Unknown Model' }) contains Embassy data. To use this drive and its data <i>as-is</i>, click "Use Drive". This will complete the setup process.<br /><br /><b>Important</b>. If you are trying to restore from backup or update from 0.2.x, DO NOT click "Use Drive". Instead, click "Cancel" and follow instructions.`),
buttons: [
{
role: 'cancel',
@@ -94,7 +96,7 @@ export class RecoverPage {
{
text: 'Use Drive',
handler: async () => {
await this.importDrive(importableDrive.guid)
await this.importDrive(nested.guid)
},
},
],

View File

@@ -46,6 +46,7 @@ export interface DiskListResponse {
export interface DiskBackupTarget {
vendor: string | null
model: string | null
guid: string | null
logicalname: string | null
label: string | null
capacity: number

View File

@@ -26,7 +26,29 @@ export class MockApiService extends ApiService {
async getDrives () {
await pauseFor(1000)
return {
disks: [],
disks: [
{
logicalname: 'abcd',
vendor: 'Samsung',
model: 'T5',
partitions: [
{
logicalname: 'pabcd',
label: null,
capacity: 73264762332,
used: null,
'embassy-os': {
version: '0.2.17',
full: true,
'password-hash': null,
'wrapped-key': null,
},
}
],
capacity: 123456789123,
guid: 'uuid-uuid-uuid-uuid',
}
],
reconnect: [],
}
}

View File

@@ -22,7 +22,7 @@ v8.0.0
`cd ui/`
`npm --prefix . install @ionic/cli`
`npm install -g @ionic/cli`
`npm --prefix . install`

View File

@@ -1,6 +1,6 @@
<ion-header>
<ion-toolbar>
<ion-title>Select Services to Recover</ion-title>
<ion-title>Select Services to Restore</ion-title>
<ion-buttons slot="end">
<ion-button (click)="dismiss()">
<ion-icon slot="icon-only" name="close"></ion-icon>
@@ -17,7 +17,7 @@
<p>Version {{ option.version }}</p>
<p>Backup made: {{ option.timestamp | date : 'short' }}</p>
<p *ngIf="!option.installed && !option['newer-eos']">
<ion-text color="success">Ready to recover</ion-text>
<ion-text color="success">Ready to restore</ion-text>
</p>
<p *ngIf="option.installed">
<ion-text color="warning">Unavailable. {{ option.title }} is already installed.</ion-text>
@@ -34,8 +34,8 @@
<ion-footer>
<ion-toolbar>
<ion-buttons slot="end" class="ion-padding-end">
<ion-button [disabled]="!hasSelection" fill="outline" (click)="recover()" class="enter-click">
Recover Selected
<ion-button [disabled]="!hasSelection" fill="outline" (click)="restore()" class="enter-click">
Restore Selected
</ion-button>
</ion-buttons>
</ion-toolbar>

View File

@@ -55,14 +55,14 @@ export class AppRecoverSelectPage {
this.hasSelection = this.options.some(o => o.checked)
}
async recover (): Promise<void> {
async restore (): Promise<void> {
const ids = this.options
.filter(option => !!option.checked)
.map(option => option.id)
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Beginning service recovery...',
message: 'Beginning restoration...',
cssClass: 'loader',
})
await loader.present()