Przeglądaj źródła

AMBARI-3570 Assign Slaves and Clients step perfomance defects. (atkach)

atkach 11 lat temu
rodzic
commit
b356135d2f

+ 2 - 0
ambari-web/app/controllers/wizard/step6_controller.js

@@ -141,10 +141,12 @@ App.WizardStep6Controller = Em.Controller.extend({
     this.get('hosts').forEach(function (host) {
       host.get('checkboxes').filterProperty('isInstalled', false).forEach(function (checkbox) {
         if (checkbox.get('title') === label) {
+          checkbox.set('setAll', true);
           checkbox.set('checked', checked);
         }
       });
     });
+    this.checkCallback(label);
   },
 
   /**

+ 10 - 4
ambari-web/app/views/wizard/step6_view.js

@@ -97,16 +97,22 @@ App.WizardStep6CheckboxView = Em.Checkbox.extend({
    */
   checkbox: null,
 
+  //if setAll true there is no need to check every checkbox whether all checked or not
+  setAllBinding: 'checkbox.setAll',
+
   checkedBinding: 'checkbox.checked',
 
   disabledBinding: 'checkbox.isInstalled',
 
   checkCallback: function() {
     var self = this;
-    Ember.run.next(function(){
-      self.get('controller').checkCallback(self.get('checkbox.title'));
-    });
-
+    if(this.get('setAll')){
+      this.set('setAll', false);
+    } else {
+      Ember.run.next(function(){
+        self.get('controller').checkCallback(self.get('checkbox.title'));
+      });
+    }
   }.observes('checked'),
 
   template: Ember.Handlebars.compile('{{checkbox.title}}')