From 5d9f7e412c1d87aba6f5dd22c4c83f9257964711 Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Thu, 20 Jan 2022 13:00:30 -0700 Subject: [PATCH] rebase --- .../server-show/server-show.page.ts | 23 +++++++++---------- ui/src/app/services/api/api.types.ts | 4 ++-- .../app/services/api/embassy-api.service.ts | 2 +- .../services/api/embassy-live-api.service.ts | 4 ++-- .../services/api/embassy-mock-api.service.ts | 2 +- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/ui/src/app/pages/server-routes/server-show/server-show.page.ts b/ui/src/app/pages/server-routes/server-show/server-show.page.ts index bf8b483b5..e1d813ee4 100644 --- a/ui/src/app/pages/server-routes/server-show/server-show.page.ts +++ b/ui/src/app/pages/server-routes/server-show/server-show.page.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core' -import { AlertController, LoadingController, NavController } from '@ionic/angular' +import { AlertController, LoadingController, NavController, IonicSafeString } from '@ionic/angular' import { ApiService } from 'src/app/services/api/embassy-api.service' import { ActivatedRoute } from '@angular/router' import { ErrorToastService } from 'src/app/services/error-toast.service' @@ -69,25 +69,24 @@ export class ServerShowPage { await alert.present() } - async presentAlertHardRestart () { + async presentAlertSystemRebuild () { const minutes = Object.keys(this.patch.data['package-data']).length * 2 const alert = await this.alertCtrl.create({ - header: 'Warning', - message: `Do not hard restart unless your Embassy is in a corrupt state or you have been instructed by a Start9 support representitive. This process may take up to ${minutes} minutes.`, + header: 'System Rebuild', + message: new IonicSafeString(`Important: This will tear down all service containers and rebuild them from scratch. This may take up to ${minutes} minutes to complete. During this time, you will lose all connectivity to your Embassy.`), buttons: [ { text: 'Cancel', role: 'cancel', }, { - text: 'Hard Restart', + text: 'Rebuild', handler: () => { - this.hardRestart() + this.systemRebuild() }, cssClass: 'enter-click', }, ], - cssClass: 'alert-error-message', }) await alert.present() } @@ -126,7 +125,7 @@ export class ServerShowPage { } } - private async hardRestart () { + private async systemRebuild () { const loader = await this.loadingCtrl.create({ spinner: 'lines', message: 'Hard Restarting...', @@ -135,7 +134,7 @@ export class ServerShowPage { await loader.present() try { - await this.embassyApi.hardRestartServer({ }) + await this.embassyApi.systemRebuild({ }) } catch (e) { this.errToast.present(e) } finally { @@ -249,10 +248,10 @@ export class ServerShowPage { disabled: of(false), }, { - title: 'Hard Restart', + title: 'System Rebuild', description: '', - icon: 'alert-circle-outline', - action: () => this.presentAlertHardRestart(), + icon: 'construct-outline', + action: () => this.presentAlertSystemRebuild(), detail: false, disabled: of(false), }, diff --git a/ui/src/app/services/api/api.types.ts b/ui/src/app/services/api/api.types.ts index 46a21469b..3f092d9f3 100644 --- a/ui/src/app/services/api/api.types.ts +++ b/ui/src/app/services/api/api.types.ts @@ -42,8 +42,8 @@ export module RR { export type ShutdownServerReq = { } // server.shutdown export type ShutdownServerRes = null - export type HardRestartServerReq = { } // server.hard-restart - export type HardRestartServerRes = null + export type SystemRebuildReq = { } // server.rebuild + export type SystemRebuildRes = null // sessions diff --git a/ui/src/app/services/api/embassy-api.service.ts b/ui/src/app/services/api/embassy-api.service.ts index 5ed3f7bbc..20fcf3af2 100644 --- a/ui/src/app/services/api/embassy-api.service.ts +++ b/ui/src/app/services/api/embassy-api.service.ts @@ -68,7 +68,7 @@ export abstract class ApiService implements Source, Http { abstract shutdownServer (params: RR.ShutdownServerReq): Promise - abstract hardRestartServer (params: RR.HardRestartServerReq): Promise + abstract systemRebuild (params: RR.SystemRebuildReq): Promise // marketplace URLs diff --git a/ui/src/app/services/api/embassy-live-api.service.ts b/ui/src/app/services/api/embassy-live-api.service.ts index 505371346..2c4d4d230 100644 --- a/ui/src/app/services/api/embassy-live-api.service.ts +++ b/ui/src/app/services/api/embassy-live-api.service.ts @@ -80,8 +80,8 @@ export class LiveApiService extends ApiService { return this.http.rpcRequest({ method: 'server.shutdown', params }) } - async hardRestartServer (params: RR.RestartServerReq): Promise { - return this.http.rpcRequest({ method: 'server.hard-restart', params }) + async systemRebuild (params: RR.RestartServerReq): Promise { + return this.http.rpcRequest({ method: 'server.rebuild', params }) } // marketplace URLs diff --git a/ui/src/app/services/api/embassy-mock-api.service.ts b/ui/src/app/services/api/embassy-mock-api.service.ts index 428d9acd9..7636f7008 100644 --- a/ui/src/app/services/api/embassy-mock-api.service.ts +++ b/ui/src/app/services/api/embassy-mock-api.service.ts @@ -160,7 +160,7 @@ export class MockApiService extends ApiService { return null } - async hardRestartServer (params: RR.RestartServerReq): Promise { + async systemRebuild (params: RR.RestartServerReq): Promise { await pauseFor(2000) return null }