Browse Source

AMBARI-2776. When a master component is in maintenance mode, the service health icon always shows a red blinking dot. (yusaku)

Yusaku Sako 12 years ago
parent
commit
7c8e240e6a
2 changed files with 7 additions and 2 deletions
  1. 3 0
      ambari-web/app/models/host_component.js
  2. 4 2
      ambari-web/app/models/service.js

+ 3 - 0
ambari-web/app/models/host_component.js

@@ -128,6 +128,7 @@ App.HostComponentStatus = {
   install_failed: "INSTALL_FAILED",
   installing: "INSTALLING",
   upgrade_failed: "UPGRADE_FAILED",
+  maintenance: "MAINTENANCE",
   unknown: "UNKNOWN",
 
   getKeyName:function(value){
@@ -146,6 +147,8 @@ App.HostComponentStatus = {
         return 'installing';
       case this.upgrade_failed:
         return 'upgrade_failed';
+      case this.maintenance:
+        return 'maintenance';
       case this.unknown:
         return 'unknown';
     }

+ 4 - 2
ambari-web/app/models/service.js

@@ -43,9 +43,11 @@ App.Service = DS.Model.extend({
   updateHealthStatus: function () {
     // console.log('model:service.healthStatus ' + this.get('serviceName'));
     var components = this.get('hostComponents').filterProperty('isMaster', true);
-    var isGreen = (this.get('serviceName') === 'HBASE' && App.supports.multipleHBaseMasters ?
+    var isGreen = this.get('serviceName') === 'HBASE' && App.supports.multipleHBaseMasters ?
       components.someProperty('workStatus', App.HostComponentStatus.started) :
-      components.everyProperty('workStatus', App.HostComponentStatus.started));
+      components.every(function (_component) {
+        return ([App.HostComponentStatus.started, App.HostComponentStatus.maintenance].contains(_component.get('workStatus')));
+      }, this);
 
     if (isGreen) {
       this.set('healthStatus', 'green');