From 3f26f20e8548aa7044d92cd011aa458b492b7f0f Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Thu, 24 Feb 2022 12:55:30 -0700 Subject: [PATCH] health check success (#1267) * health check success Co-authored-by: Drew Ansbacher --- .../app-show-health-checks.component.html | 21 +++++++++++++------ .../app-show-health-checks.component.ts | 20 ------------------ .../ui/src/app/services/api/mock-patch.ts | 6 +----- .../src/app/services/patch-db/data-model.ts | 2 +- 4 files changed, 17 insertions(+), 32 deletions(-) diff --git a/frontend/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-health-checks/app-show-health-checks.component.html b/frontend/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-health-checks/app-show-health-checks.component.html index 0c5ebe521..eb6ec0c21 100644 --- a/frontend/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-health-checks/app-show-health-checks.component.html +++ b/frontend/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-health-checks/app-show-health-checks.component.html @@ -15,11 +15,7 @@ - + {{ $any(health.value).message }} + + : + {{ + pkg.manifest['health-checks'][health.key]['success-message'] + }} +

@@ -70,7 +77,9 @@ slot="start" >
-

{{ pkg.manifest['health-checks'][health.key].name }}

+

+ {{ pkg.manifest['health-checks'][health.key].name }} +

Awaiting result...

diff --git a/frontend/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-health-checks/app-show-health-checks.component.ts b/frontend/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-health-checks/app-show-health-checks.component.ts index 9655c29d5..9ede2a3b9 100644 --- a/frontend/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-health-checks/app-show-health-checks.component.ts +++ b/frontend/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-health-checks/app-show-health-checks.component.ts @@ -30,26 +30,6 @@ export class AppShowHealthChecksComponent { return result !== HealthResult.Failure && result !== HealthResult.Loading } - async presentAlertDescription(id: string) { - const health = this.pkg.manifest['health-checks'][id] - - const alert = await this.alertCtrl.create({ - header: 'Health Check', - subHeader: health.name, - message: health.description, - buttons: [ - { - text: `OK`, - handler: () => { - alert.dismiss() - }, - cssClass: 'enter-click', - }, - ], - }) - await alert.present() - } - asIsOrder() { return 0 } diff --git a/frontend/projects/ui/src/app/services/api/mock-patch.ts b/frontend/projects/ui/src/app/services/api/mock-patch.ts index 1ef6b9624..76cf2a969 100644 --- a/frontend/projects/ui/src/app/services/api/mock-patch.ts +++ b/frontend/projects/ui/src/app/services/api/mock-patch.ts @@ -82,23 +82,19 @@ export const mockPatchData: DataModel = { 'health-checks': { 'chain-state': { name: 'Chain State', - description: 'Checks the chainstate', }, 'ephemeral-health-check': { name: 'Ephemeral Health Check', - description: `Checks to see if your new user registrations are on. If they are but you're not expecting any new user signups, you should disable this in Config, as anyone who knows your onion URL can create accounts on your server.`, }, 'p2p-interface': { name: 'P2P Interface', - description: `Checks to see if your new user registrations are on. If they are but you're not expecting any new user signups, you should disable this in Config, as anyone who knows your onion URL can create accounts on your server.`, + 'success-message': 'the health check ran succesfully', }, 'rpc-interface': { name: 'RPC Interface', - description: 'Checks the RPC Interface', }, 'unnecessary-health-check': { name: 'Unneccessary Health Check', - description: 'Is totally not necessary to do this health check.', }, } as any, config: { diff --git a/frontend/projects/ui/src/app/services/patch-db/data-model.ts b/frontend/projects/ui/src/app/services/patch-db/data-model.ts index dfefe3aa2..bb8c8ddda 100644 --- a/frontend/projects/ui/src/app/services/patch-db/data-model.ts +++ b/frontend/projects/ui/src/app/services/patch-db/data-model.ts @@ -128,7 +128,7 @@ export interface Manifest { main: ActionImpl 'health-checks': Record< string, - ActionImpl & { name: string; description: string } + ActionImpl & { name: string; 'success-message': string | null } > config: ConfigActions | null volumes: Record