From b731f7fb6435058a2c3c91dd7c0fab1d93d4bb0d Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Fri, 9 May 2025 14:48:40 -0600 Subject: [PATCH] handle removing and backing up state, fix ackInstructions too (#2935) --- .../services/routes/service.component.ts | 44 +++++++++++-------- .../portal/routes/services/services.routes.ts | 2 +- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/web/projects/ui/src/app/routes/portal/routes/services/routes/service.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/routes/service.component.ts index 386833684..b7612bb32 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/routes/service.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/routes/service.component.ts @@ -31,6 +31,9 @@ import { ServiceStatusComponent } from '../components/status.component' @Component({ template: ` @if (pkg(); as pkg) { + @if (pkg.status.main === 'error') { + + } @if (installing()) { } @else if (installed()) { @@ -48,22 +51,25 @@ import { ServiceStatusComponent } from '../components/status.component' } - @if (pkg.status.main === 'error') { - + @if (status() !== 'backingUp') { + + + @if (errors() | async; as errors) { + + } + + + } - - - - @if (errors() | async; as errors) { - - } - - - + } @else if (removing()) { + } } `, @@ -134,15 +140,17 @@ export class ServiceRoute { ) protected readonly installed = computed( - () => - this.pkg()?.stateInfo.state === 'installed' && - this.status() !== 'backingUp', + () => this.pkg()?.stateInfo.state === 'installed', ) protected readonly installing = computed( (state = this.status()) => state === 'installing' || state === 'updating' || state === 'restoring', ) + + protected readonly removing = computed( + () => this.pkg()?.stateInfo.state === 'removing', + ) } function toHealthCheck(status: T.MainStatus): T.NamedHealthCheckResult[] { diff --git a/web/projects/ui/src/app/routes/portal/routes/services/services.routes.ts b/web/projects/ui/src/app/routes/portal/routes/services/services.routes.ts index 228452d44..78e48d678 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/services.routes.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/services.routes.ts @@ -30,7 +30,7 @@ export const ROUTES: Routes = [ canActivate: [ ({ paramMap }: ActivatedRouteSnapshot) => { inject(ApiService) - .setDbValue(['ack-instructions', paramMap.get('pkgId')!], true) + .setDbValue(['ackInstructions', paramMap.get('pkgId')!], true) .catch(e => console.error('Failed to mark as seen', e)) return true