You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@hertzbeat.apache.org by go...@apache.org on 2024/10/04 04:11:43 UTC
(hertzbeat) branch fix-multi created (now 561edcc53)
This is an automated email from the ASF dual-hosted git repository.
gongchao pushed a change to branch fix-multi
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
at 561edcc53 [webapp] fix bulletin with multiple rows of results
This branch includes the following new commits:
new 561edcc53 [webapp] fix bulletin with multiple rows of results
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org
(hertzbeat) 01/01: [webapp] fix bulletin with multiple rows of results
Posted by go...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gongchao pushed a commit to branch fix-multi
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
commit 561edcc5392c60a983b390a12e63180810241fca
Author: tomsun28 <to...@outlook.com>
AuthorDate: Fri Oct 4 12:10:53 2024 +0800
[webapp] fix bulletin with multiple rows of results
Signed-off-by: tomsun28 <to...@outlook.com>
---
web-app/src/app/routes/bulletin/bulletin.component.html | 16 +++++++++-------
web-app/src/app/routes/bulletin/bulletin.component.ts | 14 ++++++++++++++
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/web-app/src/app/routes/bulletin/bulletin.component.html b/web-app/src/app/routes/bulletin/bulletin.component.html
index ff6ea9c2a..b602a708b 100644
--- a/web-app/src/app/routes/bulletin/bulletin.component.html
+++ b/web-app/src/app/routes/bulletin/bulletin.component.html
@@ -113,18 +113,20 @@
</td>
<td nzAlign="center" [rowSpan]="1">{{ content.host }}</td>
<ng-container *ngFor="let metric of content.metrics">
- <ng-container *ngFor="let field of metric.fields">
- <ng-container *ngFor="let item of field">
- <td nzAlign="center">
+ <ng-container *ngFor="let field of metric.fields[0]">
+ <td nzAlign="center">
+ <ng-container *ngFor="let item of combine(field, metric.fields)">
<ng-container *ngIf="item.value === 'NO_DATA'; else hasData">
<nz-tag nzColor="warning">No Data Available</nz-tag>
</ng-container>
<ng-template #hasData>
- {{ item.value }}
- <nz-tag *ngIf="item.unit !== ''" nzColor="success">{{ item.unit }}</nz-tag>
+ <div style="display: flex; justify-content: space-between">
+ {{ item.value }}
+ <nz-tag *ngIf="item.unit !== ''" nzColor="success">{{ item.unit }}</nz-tag>
+ </div>
</ng-template>
- </td>
- </ng-container>
+ </ng-container>
+ </td>
</ng-container>
</ng-container>
</tr>
diff --git a/web-app/src/app/routes/bulletin/bulletin.component.ts b/web-app/src/app/routes/bulletin/bulletin.component.ts
index ac5b8d217..21fc346c6 100644
--- a/web-app/src/app/routes/bulletin/bulletin.component.ts
+++ b/web-app/src/app/routes/bulletin/bulletin.component.ts
@@ -554,4 +554,18 @@ export class BulletinComponent implements OnInit, OnDestroy {
this.countDownTime = this.deadline;
this.cdr.detectChanges();
}
+
+ combine(field: any, fields: any): any[] {
+ let result: any[] = [];
+ if (fields.length == 0) {
+ return result;
+ }
+ for (let i = 0; i < fields.length; i++) {
+ let find = fields[i].filter((item: any) => {
+ return item.key == field.key;
+ });
+ result = result.concat(find);
+ }
+ return result;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org