diff --git a/src/app/pages/dashboard/widgets/apps/widget-app/widget-app.component.html b/src/app/pages/dashboard/widgets/apps/widget-app/widget-app.component.html index 08b75095c60..2bb3ece19fa 100644 --- a/src/app/pages/dashboard/widgets/apps/widget-app/widget-app.component.html +++ b/src/app/pages/dashboard/widgets/apps/widget-app/widget-app.component.html @@ -15,25 +15,28 @@

{{ 'App' | translate }}

[job]="job() | async" > - - - - - - - + @if (stats$) { + + + + + + + + } + diff --git a/src/app/pages/dashboard/widgets/apps/widget-app/widget-app.component.ts b/src/app/pages/dashboard/widgets/apps/widget-app/widget-app.component.ts index 62c5217d54d..b79105c5bf9 100644 --- a/src/app/pages/dashboard/widgets/apps/widget-app/widget-app.component.ts +++ b/src/app/pages/dashboard/widgets/apps/widget-app/widget-app.component.ts @@ -2,9 +2,13 @@ import { AsyncPipe } from '@angular/common'; import { Component, ChangeDetectionStrategy, input, computed, + effect, } from '@angular/core'; import { MatCard, MatCardContent } from '@angular/material/card'; import { TranslateModule } from '@ngx-translate/core'; +import { Observable } from 'rxjs'; +import { LoadingState } from 'app/helpers/operators/to-loading-state.helper'; +import { AppStats } from 'app/interfaces/app.interface'; import { WithLoadingStateDirective } from 'app/modules/loader/directives/with-loading-state/with-loading-state.directive'; import { AppCardLogoComponent } from 'app/pages/apps/components/app-card-logo/app-card-logo.component'; import { WidgetResourcesService } from 'app/pages/dashboard/services/widget-resources.service'; @@ -46,7 +50,11 @@ export class WidgetAppComponent implements WidgetComponent { appName = computed(() => this.settings().appName); app = computed(() => this.resources.getApp(this.appName())); job = computed(() => this.resources.getAppStatusUpdates(this.appName())); - stats = computed(() => this.resources.getAppStats(this.appName())); + stats$: Observable>; + + effect = effect(() => { + this.stats$ = this.resources.getAppStats(this.appName()); + }); constructor(private resources: WidgetResourcesService) {} }