ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject git commit: AMBARI-3910. NodeManager live dashboard widget does not update after delete host. (xiwang via yusaku)
Date Fri, 29 Nov 2013 14:55:56 GMT
Updated Branches:
  refs/heads/branch-1.4.2 53ae816b0 -> 9562182f4


AMBARI-3910. NodeManager live dashboard widget does not update after delete host. (xiwang
via yusaku)


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

Branch: refs/heads/branch-1.4.2
Commit: 9562182f4df0f4fc0229d922baed72e53b10d728
Parents: 53ae816
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Fri Nov 29 06:55:42 2013 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Fri Nov 29 06:56:43 2013 -0800

----------------------------------------------------------------------
 .../main/dashboard/widgets/node_managers_live.js      | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9562182f/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js b/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
index 8c933f3..d6330ef 100644
--- a/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
+++ b/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
@@ -46,21 +46,25 @@ App.NodeManagersLiveView = App.TextDashboardWidgetView.extend({
   thresh2: 70,
   maxValue: 100,
 
-  data:  function () {
+  nodeManagersLive: function(){
+    return App.HostComponent.find().filterProperty('componentName', 'NODEMANAGER').filterProperty("workStatus","STARTED");
+  }.property('model.hostComponents.@each'),
+
+  data: function () {
     var nodeManagers = this.get('model.nodeManagerNodes.length');
-    var nodeManagersLive = this.get('model.nodeManagerLiveNodes.length');
+    var nodeManagersLive = this.get('nodeManagersLive').length;
     if (!nodeManagers) {
       return -1;
     } else {
       return (nodeManagersLive / nodeManagers).toFixed(2) * 100;
     }
-  }.property('model.nodeManagerNodes.length', 'model.nodeManagerLiveNodes.length'),
+  }.property('model.nodeManagerNodes.length', 'nodeManagersLive'),
 
   content: function () {
     var nodeManagers = this.get('model.nodeManagerNodes.length');
-    var nodeManagersLive = this.get('model.nodeManagerLiveNodes.length');
+    var nodeManagersLive = this.get('nodeManagersLive').length;
     return nodeManagersLive + '/' + nodeManagers;
-  }.property('model.nodeManagerNodes.length', 'model.nodeManagerLiveNodes.length'),
+  }.property('model.nodeManagerNodes.length', 'nodeManagersLive'),
 
   editWidget: function (event) {
     var parent = this;


Mime
View raw message