handle removing and backing up state, fix ackInstructions too (#2935)

This commit is contained in:
Matt Hill
2025-05-09 14:48:40 -06:00
committed by GitHub
parent cd554f77f3
commit b731f7fb64
2 changed files with 27 additions and 19 deletions

View File

@@ -31,6 +31,9 @@ import { ServiceStatusComponent } from '../components/status.component'
@Component({
template: `
@if (pkg(); as pkg) {
@if (pkg.status.main === 'error') {
<service-error [pkg]="pkg" />
}
@if (installing()) {
<service-install-progress [pkg]="pkg" />
} @else if (installed()) {
@@ -48,22 +51,25 @@ import { ServiceStatusComponent } from '../components/status.component'
}
</service-status>
@if (pkg.status.main === 'error') {
<service-error [pkg]="pkg" />
@if (status() !== 'backingUp') {
<service-interfaces [pkg]="pkg" [disabled]="status() !== 'running'" />
@if (errors() | async; as errors) {
<service-dependencies
[pkg]="pkg"
[services]="services()"
[errors]="errors"
/>
}
<service-health-checks [checks]="health()" />
<service-action-requests [pkg]="pkg" [services]="services() || {}" />
}
<service-interfaces [pkg]="pkg" [disabled]="status() !== 'running'" />
@if (errors() | async; as errors) {
<service-dependencies
[pkg]="pkg"
[services]="services()"
[errors]="errors"
/>
}
<service-health-checks [checks]="health()" />
<service-action-requests [pkg]="pkg" [services]="services() || {}" />
} @else if (removing()) {
<service-status
[connected]="!!connected()"
[status]="status()"
></service-status>
}
}
`,
@@ -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[] {

View File

@@ -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