This is an automated email from the ASF dual-hosted git repository.
shown pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/master by this push:
new 5dabc7b7f [improve] support kanban tablename i18n (#2749)
5dabc7b7f is described below
commit 5dabc7b7fdcd026b04a62b1c7efd424953c982c9
Author: aias00 <[email protected]>
AuthorDate: Tue Sep 24 21:22:11 2024 +0800
[improve] support kanban tablename i18n (#2749)
Signed-off-by: aias00 <[email protected]>
Co-authored-by: Zhang Yuxuan <[email protected]>
---
.../src/app/routes/bulletin/bulletin.component.html | 6 ++----
.../src/app/routes/bulletin/bulletin.component.ts | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/web-app/src/app/routes/bulletin/bulletin.component.html
b/web-app/src/app/routes/bulletin/bulletin.component.html
index 795d16b58..ff6ea9c2a 100644
--- a/web-app/src/app/routes/bulletin/bulletin.component.html
+++ b/web-app/src/app/routes/bulletin/bulletin.component.html
@@ -90,14 +90,12 @@
<th nzAlign="center" nzWidth="7%" [rowSpan]="2">App</th>
<th nzAlign="center" nzWidth="7%" [rowSpan]="2">Host</th>
<ng-container *ngFor="let metric of metrics">
- <th nzAlign="center" [colSpan]="getKeys(metric).length">
- {{ metric }}
- </th>
+ <th nzAlign="center" [colSpan]="getKeys(metric).length"> {{
getMetricName(tab.app, metric) }} </th>
</ng-container>
</tr>
<tr>
<ng-container *ngFor="let metric of metrics">
- <ng-container *ngFor="let field of getKeys(metric)">
+ <ng-container *ngFor="let field of getKeyNames(tab.app, metric)">
<th nzAlign="center" [colSpan]="1">
{{ field }}
</th>
diff --git a/web-app/src/app/routes/bulletin/bulletin.component.ts
b/web-app/src/app/routes/bulletin/bulletin.component.ts
index dd6b9b1f2..ac5b8d217 100644
--- a/web-app/src/app/routes/bulletin/bulletin.component.ts
+++ b/web-app/src/app/routes/bulletin/bulletin.component.ts
@@ -469,6 +469,10 @@ export class BulletinComponent implements OnInit,
OnDestroy {
);
}
+ getMetricName(appName: string, metricName: string): string {
+ return this.i18nSvc.fanyi(`monitor.app.${appName}.metrics.${metricName}`);
+ }
+
getKeys(metricName: string): string[] {
const result = new Set<string>();
this.metricsData.forEach((item: any) => {
@@ -485,6 +489,22 @@ export class BulletinComponent implements OnInit,
OnDestroy {
return Array.from(result);
}
+ getKeyNames(appName: string, metricName: string): string[] {
+ const result = new Set<string>();
+ this.metricsData.forEach((item: any) => {
+ item.metrics.forEach((metric: any) => {
+ if (metric.name === metricName) {
+ metric.fields.forEach((fieldGroup: any) => {
+ fieldGroup.forEach((field: any) => {
+
result.add(this.i18nSvc.fanyi(`monitor.app.${appName}.metrics.${metricName}.metric.${field.key}`));
+ });
+ });
+ }
+ });
+ });
+ return Array.from(result);
+ }
+
onTablePageChange(params: NzTableQueryParams): void {
const { pageSize, pageIndex } = params;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]