Explorar el Código

AMBARI-3915. Stop/Start components action in service configs not calculating correctly. (akovalenko)

Aleksandr Kovalenko hace 11 años
padre
commit
89f4ef3d0e
Se han modificado 1 ficheros con 11 adiciones y 11 borrados
  1. 11 11
      ambari-web/app/views/main/service/info/configs.js

+ 11 - 11
ambari-web/app/views/main/service/info/configs.js

@@ -31,22 +31,22 @@ App.MainServiceInfoConfigsView = Em.View.extend({
 
 
   stopComponentsIsDisabled: function () {
-    var controller = this.get('controller');
-    if(controller.get('content.healthStatus') == 'green'){
-      return false;
-    }else{
+    var staleComponents = this.get('controller.content.hostComponents').filterProperty('staleConfigs', true).filterProperty('isClient', false);
+    if (!staleComponents.findProperty('workStatus', 'STARTED')) {
       return true;
+    } else {
+      return false;
     }
-  }.property('controller.content.healthStatus'),
+  }.property('controller.content.hostComponents.@each.workStatus', 'controller.content.hostComponents.@each.staleConfigs'),
 
-  startComponentsIsDisabled:function () {
-    var controller = this.get('controller');
-    if(controller.get('content.healthStatus') == 'red'){
-      return false;
-    }else{
+  startComponentsIsDisabled: function () {
+    var staleComponents = this.get('controller.content.hostComponents').filterProperty('staleConfigs', true).filterProperty('isClient', false);
+    if (!staleComponents.findProperty('workStatus', 'INSTALLED')) {
       return true;
+    } else {
+      return false;
     }
-  }.property('controller.content.healthStatus'),
+  }.property('controller.content.hostComponents.@each.workStatus', 'controller.content.hostComponents.@each.staleConfigs'),
 
   calculateCounts: function() {
     var hc = this.get('controller.content.restartRequiredHostsAndComponents');