diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.module.ts b/ui/src/app/pages/apps-routes/app-show/app-show.module.ts index 86d0afe9e..90f3e1f30 100644 --- a/ui/src/app/pages/apps-routes/app-show/app-show.module.ts +++ b/ui/src/app/pages/apps-routes/app-show/app-show.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core' import { CommonModule } from '@angular/common' import { Routes, RouterModule } from '@angular/router' import { IonicModule } from '@ionic/angular' -import { AppShowPage } from './app-show.page' +import { AppShowPage, HealthColorPipe } from './app-show.page' import { StatusComponentModule } from 'src/app/components/status/status.component.module' import { SharingModule } from 'src/app/modules/sharing.module' import { InstallWizardComponentModule } from 'src/app/components/install-wizard/install-wizard.component.module' @@ -17,6 +17,10 @@ const routes: Routes = [ ] @NgModule({ + declarations: [ + AppShowPage, + HealthColorPipe, + ], imports: [ CommonModule, StatusComponentModule, @@ -27,7 +31,6 @@ const routes: Routes = [ SharingModule, MarkdownPageModule, ], - declarations: [AppShowPage], }) export class AppShowPageModule { } diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.page.html b/ui/src/app/pages/apps-routes/app-show/app-show.page.html index 5d610ddab..44cc6f787 100644 --- a/ui/src/app/pages/apps-routes/app-show/app-show.page.html +++ b/ui/src/app/pages/apps-routes/app-show/app-show.page.html @@ -66,7 +66,7 @@ - + @@ -74,9 +74,14 @@

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

-

Result: {{ result | titlecase }}

-

{{ $any(health.value).message }}

-

{{ $any(health.value).error }}

+ +

+ {{ result | titlecase }} + ... + {{ $any(health.value).error }} + {{ $any(health.value).message }} +

+
diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts index 5a0de4cdc..1d3bd26df 100644 --- a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts +++ b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts @@ -16,6 +16,7 @@ import { AppConfigPage } from 'src/app/modals/app-config/app-config.page' import { PackageLoadingService, ProgressData } from 'src/app/services/package-loading.service' import { filter } from 'rxjs/operators' import { MarkdownPage } from 'src/app/modals/markdown/markdown.page' +import { Pipe, PipeTransform } from '@angular/core' @Component({ selector: 'app-show', @@ -231,15 +232,18 @@ export class AppShowPage { await modal.present() } - async presentModalDescription (name: string, description: string) { + async presentAlertDescription (id: string) { + const health = this.pkg.manifest['health-checks'][id] + const alert = await this.alertCtrl.create({ - header: name, - message: description, + header: 'Health Check', + subHeader: health.name, + message: health.description, buttons: [ { text: `OK`, handler: () => { - this.modalCtrl.dismiss() + alert.dismiss() }, cssClass: 'enter-click', }, @@ -466,3 +470,19 @@ interface Button { color: string action: Function } + + +@Pipe({ + name: 'healthColor', +}) +export class HealthColorPipe implements PipeTransform { + transform (val: HealthResult): string { + switch (val) { + case HealthResult.Success: return 'success' + case HealthResult.Failure: return 'warning' + case HealthResult.Disabled: return 'dark' + case HealthResult.Starting: + case HealthResult.Loading: return 'primary' + } + } +}