incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject git commit: AMBARI-3375. New and old dashboards displays different statuses for services. (srimanth via yusaku)
Date Sat, 28 Sep 2013 02:11:12 GMT
Updated Branches:
  refs/heads/branch-1.4.1 8b0d59254 -> 304672bd8


AMBARI-3375. New and old dashboards displays different statuses for services. (srimanth 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/304672bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/304672bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/304672bd

Branch: refs/heads/branch-1.4.1
Commit: 304672bd88793f2ced363ffbf5d8348bbc839b81
Parents: 8b0d592
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Fri Sep 27 19:10:25 2013 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Fri Sep 27 19:11:02 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/mappers/status_mapper.js | 38 ++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/304672bd/ambari-web/app/mappers/status_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/status_mapper.js b/ambari-web/app/mappers/status_mapper.js
index bd33817..72698f6 100644
--- a/ambari-web/app/mappers/status_mapper.js
+++ b/ambari-web/app/mappers/status_mapper.js
@@ -151,23 +151,56 @@ App.statusMapper = App.QuickDataMapper.create({
     services.forEach(function(_service){
       var service = servicesMap[_service.get('id')];
       var serviceName = _service.get('serviceName');
+      var serviceSpecificObj = null;
+      switch (serviceName) {
+        case "HDFS":
+          serviceSpecificObj = App.HDFSService.find(_service.get('id'));
+          break;
+        case "YARN":
+          serviceSpecificObj = App.YARNService.find(_service.get('id'));
+          break;
+        case "MAPREDUCE":
+          serviceSpecificObj = App.MapReduceService.find(_service.get('id'));
+          break;
+        case "HBASE":
+          serviceSpecificObj = App.HBaseService.find(_service.get('id'));
+          break;
+      }
       //computation of service health status
       var isGreen = serviceName === 'HBASE' && App.supports.multipleHBaseMasters
? service.isStarted : service.everyStartedOrMaintenance;
       if (isGreen) {
         _service.set('healthStatus', 'green');
+        if (serviceSpecificObj != null) {
+          serviceSpecificObj.set('healthStatus', 'green');
+        }
       } else if (service.isUnknown) {
         _service.set('healthStatus', 'yellow');
+        if (serviceSpecificObj != null) {
+          serviceSpecificObj.set('healthStatus', 'yellow');
+        }
       } else if (service.isStarting) {
         _service.set('healthStatus', 'green-blinking');
+        if (serviceSpecificObj != null) {
+          serviceSpecificObj.set('healthStatus', 'green-blinking');
+        }
       } else if (service.isStopped) {
         _service.set('healthStatus', 'red');
+        if (serviceSpecificObj != null) {
+          serviceSpecificObj.set('healthStatus', 'red');
+        }
       } else {
         _service.set('healthStatus', 'red-blinking');
+        if (serviceSpecificObj != null) {
+          serviceSpecificObj.set('healthStatus', 'red-blinking');
+        }
       }
 
       if (serviceName === 'HBASE' && App.supports.multipleHBaseMasters) {
         if (!service.isHbaseActive) {
           _service.set('healthStatus', 'red');
+          if (serviceSpecificObj != null) {
+            serviceSpecificObj.set('healthStatus', 'red');
+          }
         }
       }
 
@@ -176,6 +209,11 @@ App.statusMapper = App.QuickDataMapper.create({
       _service.set('unknownHostComponents', service.unknownHCs);
       _service.set('isStopped', service.isRunning);
       _service.set('toolTipContent', service.toolTipContent);
+      if (serviceSpecificObj != null) {
+        serviceSpecificObj.set('isStarted', service.everyStarted);
+        serviceSpecificObj.set('isStopped', service.isRunning);
+        serviceSpecificObj.set('toolTipContent', service.toolTipContent);
+      }
     }, this);
   },
 


Mime
View raw message