瀏覽代碼

AMBARI-2875. 0/x NodeManagers shown in green color. This is a patch to fix the color coding for MapReduce service. (xiwang via yusaku)

Yusaku Sako 11 年之前
父節點
當前提交
a6b4a81be3

+ 5 - 2
ambari-web/app/templates/main/dashboard/service/mapreduce.hbs

@@ -48,8 +48,11 @@
       <tr>
       <tr>
         <td>{{t dashboard.services.mapreduce.taskTrackers}}</td>
         <td>{{t dashboard.services.mapreduce.taskTrackers}}</td>
         <td>
         <td>
-
-          <span class="green-live">{{view.trackersSummary}}</span> {{t services.service.summary.TrackersLive}}
+          <span>
+            {{#view view.trackersLiveTextView}}
+              {{view.liveComponents}}/{{view.totalComponents}}
+            {{/view}}
+          </span> {{t services.service.summary.TrackersLive}}
           <div class="summary-view-host">
           <div class="summary-view-host">
             <a href="#" {{action filterHosts view.taskTrackerComponent}}>{{view.trackersText}}</a>
             <a href="#" {{action filterHosts view.taskTrackerComponent}}>{{view.trackersText}}</a>
           </div>
           </div>

+ 9 - 0
ambari-web/app/views/main/dashboard/service/mapreduce.js

@@ -74,6 +74,15 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({
     return template.format(liveCount, totalCount);
     return template.format(liveCount, totalCount);
   }.property('service.aliveTrackers.length', 'service.taskTrackers.length'),
   }.property('service.aliveTrackers.length', 'service.taskTrackers.length'),
 
 
+  trackersLiveTextView: App.ComponentLiveTextView.extend({
+    liveComponents: function() {
+      return App.HostComponent.find().filterProperty('componentName', 'TASKTRACKER').filterProperty("workStatus","STARTED").get("length");
+    }.property("service.hostComponents.@each", "service.aliveTrackers.length"),
+    totalComponents: function() {
+      return this.get("service.taskTrackers.length");
+    }.property('service.taskTrackers.length')
+  }),
+
   trackersHeapSummary: function () {
   trackersHeapSummary: function () {
     var heapUsed = this.get('service').get('jobTrackerHeapUsed');
     var heapUsed = this.get('service').get('jobTrackerHeapUsed');
     var heapMax = this.get('service').get('jobTrackerHeapMax');
     var heapMax = this.get('service').get('jobTrackerHeapMax');