diff --git a/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.css b/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.css new file mode 100644 index 0000000..e69de29 diff --git a/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.html b/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.html new file mode 100644 index 0000000..a238153 --- /dev/null +++ b/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.html @@ -0,0 +1,4 @@ +
+

{{ metric.name }} is {{ metric.status }} + ({{ metric.value }})

+
diff --git a/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.spec.ts b/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.spec.ts new file mode 100644 index 0000000..d53a744 --- /dev/null +++ b/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MetricListItemComponent } from './metric-list-item.component'; + +describe('MetricListItemComponent', () => { + let component: MetricListItemComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [MetricListItemComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(MetricListItemComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.ts b/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.ts new file mode 100644 index 0000000..9a7b0b8 --- /dev/null +++ b/unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.ts @@ -0,0 +1,16 @@ +import {Component, Input} from '@angular/core'; +import {Metric} from "../models/Metric"; + +@Component({ + selector: 'app-metric-list-item', + standalone: true, + imports: [], + templateUrl: './metric-list-item.component.html', + styleUrl: './metric-list-item.component.css' +}) +export class MetricListItemComponent { + @Input() + metric!: Metric; + constructor() { + } +} diff --git a/unos-fe/src/app/watchdog/watchdog-top/watchdog-top.component.html b/unos-fe/src/app/watchdog/watchdog-top/watchdog-top.component.html index c5a25c2..4ab87f0 100644 --- a/unos-fe/src/app/watchdog/watchdog-top/watchdog-top.component.html +++ b/unos-fe/src/app/watchdog/watchdog-top/watchdog-top.component.html @@ -7,10 +7,20 @@

UNKNOWN {{count.UNKNOWN || 0}}

-
-

{{ metric.name }}

-
+

OK {{count.OK}}

-

{{ metric.name }} is {{ metric.status }} ({{ metric.value }})

+ +
+

NOT GOOD {{count.NOT_GOOD}}

+
+ +
+

DEAD {{count.DEAD}}

+
+ +
+

UNKNOWN {{count.UNKNOWN}}

+
+
diff --git a/unos-fe/src/app/watchdog/watchdog-top/watchdog-top.component.ts b/unos-fe/src/app/watchdog/watchdog-top/watchdog-top.component.ts index d66b93b..d1891f0 100644 --- a/unos-fe/src/app/watchdog/watchdog-top/watchdog-top.component.ts +++ b/unos-fe/src/app/watchdog/watchdog-top/watchdog-top.component.ts @@ -5,6 +5,7 @@ import {NgForOf} from "@angular/common"; import {RouterOutlet} from "@angular/router"; import {HttpClientModule} from "@angular/common/http"; import {StatusIntMap} from "../models/StatusIntMap"; +import {MetricListItemComponent} from "../metric-list-item/metric-list-item.component"; @Component({ selector: 'app-watchdog-top', @@ -13,6 +14,7 @@ import {StatusIntMap} from "../models/StatusIntMap"; NgForOf, RouterOutlet, HttpClientModule, + MetricListItemComponent, ], providers:[ FetchMetricsService @@ -24,6 +26,8 @@ export class WatchdogTopComponent implements OnInit{ deads: Metric[] = [] ok: Metric[] = []; + unknown:Metric[] = []; + notGood:Metric[] = []; count: StatusIntMap = {}; constructor(private fetchMetricsService: FetchMetricsService) { @@ -50,4 +54,12 @@ export class WatchdogTopComponent implements OnInit{ getCount():void{ this.fetchMetricsService.getCount().subscribe(res => (this.count = res)) } + + getUnknown(){ + this.fetchMetricsService.getUnknown().subscribe(res => this.unknown = res) + } + + getNotGood(){ + this.fetchMetricsService.getNotGood().subscribe(res => this.notGood = res) + } }