ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: AMBARI-8242. Usability: Hosts page becomes increasingly unresponsive (freezes every 10 seconds or so). (atkach and yusaku)
Date Sun, 09 Nov 2014 22:01:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 550785ea6 -> b18d9629b


AMBARI-8242. Usability: Hosts page becomes increasingly unresponsive (freezes every 10 seconds
or so). (atkach and yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b18d9629
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b18d9629
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b18d9629

Branch: refs/heads/branch-1.7.0
Commit: b18d9629b702d6275a20d5cebcee6d74e4513fd3
Parents: 550785e
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Sun Nov 9 14:01:12 2014 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Sun Nov 9 14:01:12 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/templates/main/menu_item.hbs |  2 +-
 ambari-web/app/views/main/menu.js           | 15 ++++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b18d9629/ambari-web/app/templates/main/menu_item.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/menu_item.hbs b/ambari-web/app/templates/main/menu_item.hbs
index 794a56f..22c900f 100644
--- a/ambari-web/app/templates/main/menu_item.hbs
+++ b/ambari-web/app/templates/main/menu_item.hbs
@@ -19,7 +19,7 @@
 
 <a href="#" {{action goToSection view.content.routing target="view"}}>
   {{{unbound view.content.label}}}
-  {{#if view.alertsCount}}
+  {{#if view.hasAlertsLabel}}
     <span class="label label-important alerts-count">
       {{view.alertsCount}}
     </span>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b18d9629/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index 89e9ac8..edf5dd1 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -39,7 +39,7 @@ App.MainMenuView = Em.CollectionView.extend({
           result.push(
             { label:Em.I18n.t('menu.item.dashboard'), routing:'dashboard', active:'active'},
             { label:Em.I18n.t('menu.item.services'), routing:'services'},
-            { label:Em.I18n.t('menu.item.hosts'), routing:'hosts'}
+            { label:Em.I18n.t('menu.item.hosts'), routing:'hosts', hasAlertsLabel: true}
           );
 
           if (App.supports.mirroring && App.Service.find().findProperty('serviceName',
'FALCON')) {
@@ -83,12 +83,13 @@ App.MainMenuView = Em.CollectionView.extend({
       return "";
     }.property('App.router.location.lastSetURL', 'App.router.clusterController.isLoaded'),
 
-    alertsCount:function () {
-      if (this.get('content').routing == 'hosts') {
-        return App.router.get('mainHostController.content').mapProperty('criticalAlertsCount')
-          .reduce(function(pv, cv) { return pv + parseInt(cv); }, 0);
-      }
-    }.property('App.router.mainHostController.content.@each.criticalAlertsCount'),
+    alertsCount: function () {
+      return App.router.get('mainHostController.hostsCountMap.health-status-WITH-ALERTS');
+    }.property('App.router.mainHostController.hostsCountMap'),
+
+    hasAlertsLabel: function () {
+      return this.get('content.hasAlertsLabel');
+    }.property('content.hasAlertsLabel'),
 
     templateName: require('templates/main/menu_item'),
 


Mime
View raw message