Updated Branches:
  refs/heads/trunk 69331db5c -> d1299d1fe

AMBARI-2875. 0/x NodeManagers shown in green color. (xiwang via yusaku)


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

Branch: refs/heads/trunk
Commit: d1299d1fe66948966fcbca69dcb49d38e083e6de
Parents: 69331db
Author: Yusaku Sako <[email protected]>
Authored: Tue Aug 13 15:53:16 2013 -0700
Committer: Yusaku Sako <[email protected]>
Committed: Tue Aug 13 15:53:16 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/styles/application.less          | 13 +++++++----
 .../templates/main/dashboard/service/hbase.hbs  | 16 ++++++++-----
 .../templates/main/dashboard/service/hdfs.hbs   |  7 ++++--
 .../templates/main/dashboard/service/yarn.hbs   |  6 ++++-
 .../main/service/info/summary/ganglia.hbs       |  6 ++++-
 ambari-web/app/views/main/dashboard/service.js  | 12 ++++++++++
 .../app/views/main/dashboard/service/hbase.js   |  9 ++++++++
 .../app/views/main/dashboard/service/hdfs.js    |  9 ++++++++
 .../app/views/main/dashboard/service/yarn.js    |  9 ++++++++
 .../app/views/main/service/info/summary.js      | 24 ++++++++++++++++++++
 10 files changed, 96 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 05ecb86..27441ec 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -1527,11 +1527,6 @@ width:100%;
     width: 20px;
     margin-left: 0;
   }
-
-  .green-live{
-    color: #008000;
-  }
-
   .STARTING, .STARTED {
     .tab-marker-position;
     background-image: @status-live-marker;
@@ -1555,6 +1550,14 @@ width:100%;
       }
     }
   }
+  .service-summary-component-red-dead {
+    color: #ff0000;
+    display: inline;
+  }
+  .service-summary-component-green-live {
+    color: #228b22;
+    display: inline;
+  }
 }
 
 #summary-info {

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/templates/main/dashboard/service/hbase.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/service/hbase.hbs 
b/ambari-web/app/templates/main/dashboard/service/hbase.hbs
index 3a44c1a..7579c64 100644
--- a/ambari-web/app/templates/main/dashboard/service/hbase.hbs
+++ b/ambari-web/app/templates/main/dashboard/service/hbase.hbs
@@ -48,12 +48,16 @@
       <!-- RegionServers -->
       <tr>
         <td>{{t dashboard.services.hbase.regionServers}}</td>
-         <td>
-            <span 
class="green-live">{{view.liveRegionServers.length}}/{{view.service.regionServers.length}}
 </span> {{t services.service.summary.RegionServersLIVE}}
-            <div class="summary-view-host">
-              <a href="#" {{action filterHosts 
view.regionServerComponent}}>{{view.regionServesText}}</a>
-            </div>
-         </td>
+        <td>
+          <span>
+            {{#view view.regionServersLiveTextView}}
+              {{view.liveComponents}}/{{view.totalComponents}}
+            {{/view}}
+          </span> {{t services.service.summary.RegionServersLIVE}}
+          <div class="summary-view-host">
+            <a href="#" {{action filterHosts 
view.regionServerComponent}}>{{view.regionServesText}}</a>
+          </div>
+        </td>
       </tr>
       <!-- Regions in Transition -->
       <tr>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/service/hdfs.hbs 
b/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
index 6bc1783..645729f 100644
--- a/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
+++ b/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
@@ -43,12 +43,15 @@
     {{/unless}}
 
       {{view view.dashboardMasterComponentView}}
-
       <!-- Data Nodes -->
       <tr>
         <td>{{t dashboard.services.hdfs.datanodes}}</td>
         <td>
-          <span 
class="green-live">{{view.dataNodesLive.length}}/{{view.service.dataNodes.length}}</span>
 {{t services.service.summary.DataNodesLive}}
+          <span>
+            {{#view view.dataNodesLiveTextView}}
+              {{view.liveComponents}}/{{view.totalComponents}}
+            {{/view}}
+          </span>  {{t services.service.summary.DataNodesLive}}
           <div class="summary-view-host">
             <a href="#" {{action filterHosts 
view.dataNodeComponent}}>{{view.dataNodeHostText}}</a>
           </div>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/templates/main/dashboard/service/yarn.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/service/yarn.hbs 
b/ambari-web/app/templates/main/dashboard/service/yarn.hbs
index abd69f0..3bc1618 100644
--- a/ambari-web/app/templates/main/dashboard/service/yarn.hbs
+++ b/ambari-web/app/templates/main/dashboard/service/yarn.hbs
@@ -48,7 +48,11 @@
       <tr>
         <td>{{t dashboard.services.yarn.nodeManagers}}</td>
         <td>
-          <span 
class="green-live">{{view.nodeManagersLive}}/{{view.service.nodeManagerNodes.length}}</span>
 {{t services.service.summary.nodeManagersLive}}
+          <span>
+            {{#view view.nodeManagersLiveTextView}}
+              {{view.liveComponents}}/{{view.totalComponents}}
+            {{/view}}
+          </span>{{t services.service.summary.nodeManagersLive}}
           <div class="summary-view-host">
             <a href="#" {{action filterHosts 
view.nodeManagerComponent}}>{{view.nodeManagerText}}</a>
           </div>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/ganglia.hbs 
b/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
index d6b2bb8..a558793 100644
--- a/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
@@ -23,7 +23,11 @@
 <tr>
   <td class="summary-label">{{t services.ganglia.monitors}}</td>
   <td>
-    <span class="green-live">{{view.monitors}} </span>{{t 
services.service.summary.GangliaMonitorsLIVE}}
+    <span>
+      {{#view view.monitorsLiveTextView}}
+        {{view.monitors}}
+      {{/view}}
+    </span> {{t services.service.summary.GangliaMonitorsLIVE}}
     <div class="summary-view-host">
        <a {{action filterHosts view.monitorsObj}} href="javascript:void(null)" 
>{{view.hasManyMonitors}}</a>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/views/main/dashboard/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service.js 
b/ambari-web/app/views/main/dashboard/service.js
index e736351..28d20aa 100644
--- a/ambari-web/app/views/main/dashboard/service.js
+++ b/ambari-web/app/views/main/dashboard/service.js
@@ -96,6 +96,18 @@ App.MainDashboardServiceHealthView = Em.View.extend({
   }
 });
 
+App.ComponentLiveTextView =  Em.View.extend({
+  classNameBindings: 
['color:service-summary-component-red-dead:service-summary-component-green-live'],
+  service: function() { return 
this.get("parentView").get("service")}.property("parentView.service"),
+  liveComponents: function() {
+  }.property(),
+  totalComponents: function() {
+  }.property(),
+  color: function() {
+    return this.get("liveComponents") == 0;
+  }.property("liveComponents")
+});
+
 App.MainDashboardServiceView = Em.View.extend({
   classNames: ['service', 'clearfix'],
 

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/views/main/dashboard/service/hbase.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/hbase.js 
b/ambari-web/app/views/main/dashboard/service/hbase.js
index b22d380..92f2ab5 100644
--- a/ambari-web/app/views/main/dashboard/service/hbase.js
+++ b/ambari-web/app/views/main/dashboard/service/hbase.js
@@ -51,6 +51,15 @@ App.MainDashboardServiceHbaseView = 
App.MainDashboardServiceView.extend({
     }
   }.property("service"),
 
+  regionServersLiveTextView: App.ComponentLiveTextView.extend({
+    liveComponents: function() {
+      return App.HostComponent.find().filterProperty('componentName', 
'HBASE_REGIONSERVER').filterProperty("workStatus","STARTED").get('length');
+    }.property("service.hostComponents.@each"),
+    totalComponents: function() {
+      return this.get("service.regionServers.length");
+    }.property("service.regionServers.length")
+  }),
+
   /**
    * Formatted output for passive master components
    */

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/views/main/dashboard/service/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/hdfs.js 
b/ambari-web/app/views/main/dashboard/service/hdfs.js
index 7ac93bc..c914932 100644
--- a/ambari-web/app/views/main/dashboard/service/hdfs.js
+++ b/ambari-web/app/views/main/dashboard/service/hdfs.js
@@ -52,6 +52,15 @@ App.MainDashboardServiceHdfsView = 
App.MainDashboardServiceView.extend({
     }
   }.property("service"),
 
+  dataNodesLiveTextView: App.ComponentLiveTextView.extend({
+    liveComponents: function() {
+      return App.HostComponent.find().filterProperty('componentName', 
'DATANODE').filterProperty("workStatus","STARTED").get("length");
+    }.property("service.hostComponents.@each"),
+    totalComponents: function() {
+      return this.get("service.dataNodes.length");
+    }.property("service.dataNodes.length")
+  }),
+
   dfsTotalBlocks: function(){
     return this.formatUnavailable(this.get('service.dfsTotalBlocks'));
   }.property('service.dfsTotalBlocks'),

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/views/main/dashboard/service/yarn.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/yarn.js 
b/ambari-web/app/views/main/dashboard/service/yarn.js
index 7ed0b3a..bedc02c 100644
--- a/ambari-web/app/views/main/dashboard/service/yarn.js
+++ b/ambari-web/app/views/main/dashboard/service/yarn.js
@@ -82,6 +82,15 @@ App.MainDashboardServiceYARNView = 
App.MainDashboardServiceView.extend({
     }
   }.property("service.nodeManagerNodes"),
 
+  nodeManagersLiveTextView: App.ComponentLiveTextView.extend({
+    liveComponents: function() {
+      return this.get("service.nodeManagerLiveNodes.length");
+    }.property('service.nodeManagerNodes', 'service.nodeManagerLiveNodes', 
'service.nodeManagerLiveNodes.length'),
+    totalComponents: function() {
+      return this.get("service.nodeManagerNodes.length");
+    }.property("service.nodeManagerNodes.length")
+  }),
+
   nodeManagersStatus: function () {
     var nmActive = this.get('service.nodeManagersCountActive');
     var nmLost = this.get('service.nodeManagersCountLost');

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d1299d1f/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js 
b/ambari-web/app/views/main/service/info/summary.js
index 5df9414..3178ce5 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -138,6 +138,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     if (service.get("id") == "GANGLIA") {
       var monitors = service.get('hostComponents').filterProperty('isMaster', 
false);
       var liveMonitors = 
monitors.filterProperty("workStatus","STARTED").length;
+      this.set("liveMonitors", liveMonitors);
       if (monitors.length) {
         result = 
Em.I18n.t('services.service.info.summary.hostsRunningMonitor').format(liveMonitors,
 monitors.length);
       }
@@ -145,6 +146,29 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     return result;
   }.property('controller.content'),
 
+  monitorsLiveTextView: App.ComponentLiveTextView.extend({
+    liveComponents: function () {
+      var service = this.get('service');
+      if (service.get("id") == "GANGLIA") {
+        return service.get('hostComponents').filterProperty('isMaster', 
false).filterProperty("workStatus","STARTED").length;
+      } else {
+        return null;
+      }
+    }.property('service.hostComponents.@each'),
+    monitors: function () {
+      var result = '';
+      var service = this.get('parentView.controller.content');
+      if (service.get("id") == "GANGLIA") {
+        var monitors = 
service.get('hostComponents').filterProperty('isMaster', false);
+        var liveMonitors = 
monitors.filterProperty("workStatus","STARTED").length;
+        if (monitors.length) {
+          result = 
Em.I18n.t('services.service.info.summary.hostsRunningMonitor').format(liveMonitors,
 monitors.length);
+        }
+      }
+      return result;
+    }.property('service.hostComponents.@each')
+  }),
+
   hasManyMonitors: function () {
     var service = this.get('controller.content');
     if (service.get("id") == "GANGLIA") {

Reply via email to