This is an automated email from the ASF dual-hosted git repository.
gongchao 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 8233a62ae [type:feature] support alerts click to monitor detail (#2385)
8233a62ae is described below
commit 8233a62aea5b17cafb93d8c0efd0e9e5e66a6b5e
Author: aias00 <[email protected]>
AuthorDate: Fri Jul 26 11:41:35 2024 +0800
[type:feature] support alerts click to monitor detail (#2385)
Co-authored-by: tomsun28 <[email protected]>
---
web-app/src/app/layout/basic/widgets/notify.component.ts | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/web-app/src/app/layout/basic/widgets/notify.component.ts
b/web-app/src/app/layout/basic/widgets/notify.component.ts
index f9357df31..ed1feced5 100644
--- a/web-app/src/app/layout/basic/widgets/notify.component.ts
+++ b/web-app/src/app/layout/basic/widgets/notify.component.ts
@@ -58,7 +58,7 @@ import { AlertService } from '../../../service/alert.service';
<nz-list-item-meta [nzTitle]="nzTitle"
[nzDescription]="nzDescription" [nzAvatar]="item.avatar">
<ng-template #nzTitle>
<ng-container *nzStringTemplateOutlet="item.title; context: {
$implicit: item }">
- {{ item.title }}
+ <a (click)="gotoDetail(item.monitorId)">{{ item.title }}</a>
</ng-container>
@if (item.extra) {<div class="notice-icon__item-extra">
<nz-tag [nzColor]="item.color">{{ item.extra }}</nz-tag>
@@ -164,6 +164,7 @@ export class HeaderNotifyComponent implements OnInit {
alerts.forEach(alert => {
let item = {
id: alert.id,
+ monitorId: alert.tags?.monitorId,
avatar: '/assets/img/notification.svg',
title:
`${alert.tags?.monitorName}--${this.i18nSvc.fanyi(`alert.priority.${alert.priority}`)}`,
datetime: new Date(alert.lastAlarmTime).toLocaleString(),
@@ -244,4 +245,9 @@ export class HeaderNotifyComponent implements OnInit {
this.popoverVisible = false;
this.router.navigateByUrl(`/alert/center`);
}
+
+ gotoDetail(monitorId: number): void {
+ this.popoverVisible = false;
+ this.router.navigateByUrl(`/monitors/${monitorId}`);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]