소스 검색

AMBARI-8698. Alerts UI: Alerts counts should show correct values (srimanth)

Srimanth Gunturi 10 년 전
부모
커밋
1d53dc8f8c
3개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 2
      ambari-web/app/controllers/global/update_controller.js
  2. 1 1
      ambari-web/app/controllers/main/host.js
  3. 1 1
      ambari-web/app/utils/ajax/ajax.js

+ 3 - 2
ambari-web/app/controllers/global/update_controller.js

@@ -166,8 +166,9 @@ App.UpdateController = Em.Controller.extend({
       App.updater.updateInterval('updateHost', App.get('contentUpdateInterval'));
     }
     else {
-      if (App.router.get('currentState.name') == 'summary' && App.router.get('currentState.parentState.name') == 'hostDetails') {
-        hostDetailsFilter = App.router.get('location.lastSetURL').match(/\/hosts\/(.*)\/summary/)[1];
+      if (App.router.get('currentState.parentState.name') == 'hostDetails' &&
+          (App.router.get('currentState.name') == 'summary' || App.router.get('currentState.name') == 'alerts' )) {
+        hostDetailsFilter = App.router.get('location.lastSetURL').match(/\/hosts\/(.*)\/(summary|alerts)/)[1];
         App.updater.updateInterval('updateHost', App.get('componentsUpdateInterval'));
       }
       else {

+ 1 - 1
ambari-web/app/controllers/main/host.js

@@ -301,7 +301,7 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
       'UNHEALTHY': data.Clusters.health_report['Host/host_status/UNHEALTHY'],
       'ALERT': data.Clusters.health_report['Host/host_status/ALERT'],
       'UNKNOWN': data.Clusters.health_report['Host/host_status/UNKNOWN'],
-      'health-status-WITH-ALERTS': (data.alerts_summary) ? data.alerts_summary.CRITICAL + data.alerts_summary.WARNING : 0,
+      'health-status-WITH-ALERTS': (data.alerts_summary_hosts) ? data.alerts_summary_hosts.CRITICAL + data.alerts_summary_hosts.WARNING : 0,
       'health-status-RESTART': data.Clusters.health_report['Host/stale_config'],
       'health-status-PASSIVE_STATE': data.Clusters.health_report['Host/maintenance_state'],
       'TOTAL': data.Clusters.total_hosts

+ 1 - 1
ambari-web/app/utils/ajax/ajax.js

@@ -2044,7 +2044,7 @@ var urls = {
     }
   },
   'host.status.counters': {
-    'real': '/clusters/{clusterName}?fields=Clusters/health_report,Clusters/total_hosts,alerts_summary&minimal_response=true',
+    'real': '/clusters/{clusterName}?fields=Clusters/health_report,Clusters/total_hosts,alerts_summary_hosts&minimal_response=true',
     'mock': '/data/hosts/HDP2/host_status_counters.json'
   },
   'host.stack_versions.install': {