فهرست منبع

AMBARI-5301 Table of Confirm Hosts step is collapsed. (atkach)

atkach 11 سال پیش
والد
کامیت
0efe870dab
2فایلهای تغییر یافته به همراه31 افزوده شده و 24 حذف شده
  1. 11 8
      ambari-web/app/views/wizard/step3_view.js
  2. 20 16
      ambari-web/app/views/wizard/step9_view.js

+ 11 - 8
ambari-web/app/views/wizard/step3_view.js

@@ -145,14 +145,17 @@ App.WizardStep3View = App.TableView.extend({
    * filter hosts by category
    */
   filter: function () {
-    var result = [];
-    var selectedCategory = this.get('selectedCategory');
-    if (!selectedCategory || selectedCategory.get('hostsBootStatus') === 'ALL') {
-      result = this.get('content');
-    } else {
-      result = this.get('content').filterProperty('bootStatus', this.get('selectedCategory.hostsBootStatus'));
-    }
-    this.set('filteredContent', result);
+    var self = this;
+    Em.run.next(function () {
+      var result = [];
+      var selectedCategory = self.get('selectedCategory');
+      if (!selectedCategory || selectedCategory.get('hostsBootStatus') === 'ALL') {
+        result = self.get('content');
+      } else {
+        result = self.get('content').filterProperty('bootStatus', self.get('selectedCategory.hostsBootStatus'));
+      }
+      self.set('filteredContent', result);
+    });
   }.observes('selectedCategory'),
   /**
    * Trigger on Category click

+ 20 - 16
ambari-web/app/views/wizard/step9_view.js

@@ -112,22 +112,26 @@ App.WizardStep9View = App.TableView.extend({
    * filter hosts by category
    */
   filter: function () {
-    var result = [];
-    var selectedCategory = this.get('selectedCategory');
-    if (!selectedCategory || selectedCategory.get('hostStatus') === 'all') {
-      result = this.get('content');
-    } else if (selectedCategory.get('hostStatus') == 'inProgress') {
-      result = this.get('content').filter(function (_host) {
-        return (_host.get('status') == 'info' || _host.get('status') == 'pending' || _host.get('status') == 'in_progress');
-      });
-    } else if (selectedCategory.get('hostStatus') == 'failed') {
-      result = this.get('content').filter(function (_host) {
-        return (_host.get('status') == 'failed' || _host.get('status') == 'heartbeat_lost');
-      });
-    } else {
-      result = this.get('content').filterProperty('status', selectedCategory.get('hostStatus'));
-    }
-    this.set('filteredContent', result);
+    var self = this;
+    Em.run.next(function () {
+      var result = [];
+      var content = self.get('content');
+      var selectedCategory = self.get('selectedCategory');
+      if (!selectedCategory || selectedCategory.get('hostStatus') === 'all') {
+        result = content;
+      } else if (selectedCategory.get('hostStatus') == 'inProgress') {
+        result = content.filter(function (_host) {
+          return (_host.get('status') == 'info' || _host.get('status') == 'pending' || _host.get('status') == 'in_progress');
+        });
+      } else if (selectedCategory.get('hostStatus') == 'failed') {
+        result = content.filter(function (_host) {
+          return (_host.get('status') == 'failed' || _host.get('status') == 'heartbeat_lost');
+        });
+      } else {
+        result = content.filterProperty('status', selectedCategory.get('hostStatus'));
+      }
+      self.set('filteredContent', result);
+    });
   }.observes('selectedCategory'),
   /**
    * Trigger on Category click