ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-12829. Filtering in the "Select Alert Group Definitions"-popup is too slow, when there are more than 1000 definitions (onechiporenko)
Date Thu, 20 Aug 2015 13:14:42 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 d9a3c626b -> 2118259f9


AMBARI-12829. Filtering in the "Select Alert Group Definitions"-popup is too slow, when there
are more than 1000 definitions (onechiporenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2118259f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2118259f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2118259f

Branch: refs/heads/branch-2.1
Commit: 2118259f93ac80a3945efe8befc4975a8cc473e5
Parents: d9a3c62
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Thu Aug 20 16:12:06 2015 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Thu Aug 20 16:12:06 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/utils/hosts.js                         |  1 +
 .../select_definitions_popup_body_view.js             | 14 +++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2118259f/ambari-web/app/utils/hosts.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/hosts.js b/ambari-web/app/utils/hosts.js
index b89bd84..e7ea98c 100644
--- a/ambari-web/app/utils/hosts.js
+++ b/ambari-web/app/utils/hosts.js
@@ -132,6 +132,7 @@ module.exports = {
           initialHosts.setEach('filtered', true);
           this.set('parentView.availableHosts', initialHosts);
           this.set('parentView.isLoaded', true);
+          this.filteredContentObsOnce();
         },
 
         filterHosts: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2118259f/ambari-web/app/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view.js
b/ambari-web/app/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view.js
index f92b804..b92ddad 100644
--- a/ambari-web/app/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view.js
+++ b/ambari-web/app/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view.js
@@ -26,9 +26,16 @@ App.SelectDefinitionsPopupBodyView = App.TableView.extend({
 
   isPaginate: true,
 
-  filteredContent: function () {
-    return this.get('parentView.availableDefs').filterProperty('filtered') || [];
-  }.property('parentView.availableDefs.@each.filtered'),
+  filteredContent: [],
+
+  filteredContentObs: function () {
+    Em.run.once(this, this.filteredContentObsOnce);
+  }.observes('parentView.availableDefs.@each.filtered'),
+
+  filteredContentObsOnce: function () {
+    var filtered = this.get('parentView.availableDefs').filterProperty('filtered') || [];
+    this.set('filteredContent', filtered);
+  },
 
   showOnlySelectedDefs: false,
 
@@ -45,6 +52,7 @@ App.SelectDefinitionsPopupBodyView = App.TableView.extend({
     initialDefs.setEach('filtered', true);
     this.set('parentView.availableDefs', initialDefs);
     this.set('parentView.isLoaded', true);
+    this.filteredContentObsOnce();
   },
 
   filterDefs: function () {


Mime
View raw message