diff --git a/frontend/projects/diagnostic-ui/src/app/pages/home/home.page.html b/frontend/projects/diagnostic-ui/src/app/pages/home/home.page.html index 037215e54..ae93a6bb9 100644 --- a/frontend/projects/diagnostic-ui/src/app/pages/home/home.page.html +++ b/frontend/projects/diagnostic-ui/src/app/pages/home/home.page.html @@ -49,6 +49,12 @@ }} +
{{ button.description }}
+{{ button.description }}
- -
-
-
+
This action will attempt to preform a disk repair operation and system reboot. No data will be deleted. This action should only be executed if directed by a Start9 support specialist. We recommend backing up your device before preforming this action.
If anything happens to the device during the reboot (between the bep and chime), such as loosing power, a power surge, unplugging the drive, or unplugging the Embassy, the filesystem *will* be in an unrecoverable state. Please proceed with caution.
`, + ), + buttons: [ + { + text: 'Cancel', + role: 'cancel', + }, + { + text: 'Repair', + handler: () => { + try { + this.embassyApi.repairDisk({}).then(_ => { + this.restart() + }) + } catch (e) { + this.errToast.present(e) + } + }, + cssClass: 'enter-click', + }, + ], + }) + await alert.present() + } + private async restart() { const loader = await this.loadingCtrl.create({ spinner: 'lines', @@ -305,7 +337,7 @@ export class ServerShowPage { { title: 'Marketplace Settings', description: 'Add or remove marketplaces', - icon: 'storefront', + icon: 'storefront-outline', action: () => this.navCtrl.navigateForward(['marketplaces'], { relativeTo: this.route, @@ -418,12 +450,31 @@ export class ServerShowPage { detail: false, disabled: of(false), }, + { + title: 'Repair Disk', + description: '', + icon: 'medkit-outline', + action: () => this.presentAlertRepairDisk(), + detail: false, + disabled: of(false), + }, ], } asIsOrder() { return 0 } + + async addClick() { + this.clicks++ + if (this.clicks >= 5) { + this.clicks = 0 + const newVal = await this.localStorageService.toggleShowDiskRepair() + } + setTimeout(() => { + this.clicks = Math.max(this.clicks - 1, 0) + }, 10000) + } } interface ServerSettings { diff --git a/frontend/projects/ui/src/app/services/api/embassy-api.service.ts b/frontend/projects/ui/src/app/services/api/embassy-api.service.ts index e24af70dc..91210738e 100644 --- a/frontend/projects/ui/src/app/services/api/embassy-api.service.ts +++ b/frontend/projects/ui/src/app/services/api/embassy-api.service.ts @@ -93,6 +93,8 @@ export abstract class ApiService params: RR.SystemRebuildReq, ): Promise