From 49a81ca15a51820bd5663086906165f312298c34 Mon Sep 17 00:00:00 2001
From: usbharu <64310155+usbharu@users.noreply.github.com>
Date: Wed, 13 Mar 2024 16:36:53 +0900
Subject: [PATCH] =?UTF-8?q?unos-fe:=20=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC?=
=?UTF-8?q?=E3=83=8D=E3=83=B3=E3=83=88=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../metric-list-item.component.css | 0
.../metric-list-item.component.html | 4 ++++
.../metric-list-item.component.spec.ts | 23 +++++++++++++++++++
.../metric-list-item.component.ts | 16 +++++++++++++
.../watchdog-top/watchdog-top.component.html | 18 +++++++++++----
.../watchdog-top/watchdog-top.component.ts | 12 ++++++++++
6 files changed, 69 insertions(+), 4 deletions(-)
create mode 100644 unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.css
create mode 100644 unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.html
create mode 100644 unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.spec.ts
create mode 100644 unos-fe/src/app/watchdog/metric-list-item/metric-list-item.component.ts
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}}
-
+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)
+ }
}