This is an automated email from the ASF dual-hosted git repository.

zhengqiwei 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 897d5d422 [fix]Fixed issue where refresh did not take effect (#3825)
897d5d422 is described below

commit 897d5d4220687da0cc27d297ff5b32bbe2d1506b
Author: Duansg <[email protected]>
AuthorDate: Fri Oct 24 21:58:22 2025 +0800

    [fix]Fixed issue where refresh did not take effect (#3825)
---
 .../monitor-detail/monitor-detail.component.ts     | 25 ++++++++++++++--------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git 
a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.ts 
b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.ts
index d7740ea50..eb89591af 100644
--- a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.ts
+++ b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.ts
@@ -206,10 +206,13 @@ export class MonitorDetailComponent implements OnInit, 
OnDestroy {
             this.metricsInfo = message.data.metrics || [];
             this.metrics = this.metricsInfo.map((metric: any) => metric.name);
 
-            if (this.metrics && this.metrics.length > 0) {
-              this.loadInitialMetrics();
-              this.setupIntersectionObserver();
-            }
+            setTimeout(() => {
+              this.cdr.detectChanges();
+              if (this.metrics && this.metrics.length > 0) {
+                this.loadInitialMetrics();
+                this.setupIntersectionObserver();
+              }
+            }, 0);
           } else {
             console.warn(message.msg);
           }
@@ -437,6 +440,8 @@ export class MonitorDetailComponent implements OnInit, 
OnDestroy {
       if (this.countDownTime == 0) {
         if (this.whichTabIndex == 1) {
           this.loadMetricChart();
+        } else if (this.whichTabIndex == 2) {
+          this.loadFavoriteMetrics();
         } else {
           this.loadRealTimeMetric();
         }
@@ -490,11 +495,13 @@ export class MonitorDetailComponent implements OnInit, 
OnDestroy {
     if (this.favoriteMetricsSet.size === 0) {
       return;
     }
-
-    // Convert favorites indicator to array
-    this.favoriteMetrics = Array.from(this.favoriteMetricsSet);
-    this.displayedFavoriteMetrics = this.favoriteMetrics.slice(0, 
this.favoritePageSize);
-    this.hasMoreFavorites = this.favoriteMetrics.length > 
this.favoritePageSize;
+    setTimeout(() => {
+      // Convert favorites indicator to array
+      this.favoriteMetrics = Array.from(this.favoriteMetricsSet);
+      this.displayedFavoriteMetrics = this.favoriteMetrics.slice(0, 
this.favoritePageSize);
+      this.hasMoreFavorites = this.favoriteMetrics.length > 
this.favoritePageSize;
+      this.cdr.detectChanges();
+    }, 0);
 
     this.loadFavoriteChartDefinitions();
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to