Repository: ambari Updated Branches: refs/heads/trunk f89a0b9bb -> 28f01df4e
AMBARI-7947 [Perf400] Hive and other tabs rendering too slow during Customize service wizard. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/28f01df4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/28f01df4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/28f01df4 Branch: refs/heads/trunk Commit: 28f01df4e7ffabcc9edaa206a03a7935bffedb3c Parents: f89a0b9 Author: atkach <[email protected]> Authored: Fri Oct 24 17:58:05 2014 +0300 Committer: atkach <[email protected]> Committed: Fri Oct 24 17:58:05 2014 +0300 ---------------------------------------------------------------------- .../app/views/common/configs/services_config.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/28f01df4/ambari-web/app/views/common/configs/services_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/services_config.js b/ambari-web/app/views/common/configs/services_config.js index 1d8b5b1..24086f7 100644 --- a/ambari-web/app/views/common/configs/services_config.js +++ b/ambari-web/app/views/common/configs/services_config.js @@ -20,6 +20,7 @@ var App = require('app'); var validator = require('utils/validator'); var stringUtils = require('utils/string_utils'); var hostsUtils = require('utils/hosts'); +var lazyLoading = require('utils/lazy_loading'); App.ServicesConfigView = Em.View.extend({ templateName: require('templates/common/configs/services_config'), @@ -104,9 +105,9 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, { // default, // cacheable ) categoryConfigs: function () { - var categoryConfigs = this.get('serviceConfigs').filterProperty('category', this.get('category.name')); + var categoryConfigs = this.get('categoryConfigsAll'); return this.orderContentAtLast(categoryConfigs).filterProperty('isVisible', true); - }.property('serviceConfigs.@each', '[email protected]').cacheable(), + }.property('[email protected]').cacheable(), /** * This method provides all the properties which apply @@ -348,6 +349,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, { */ filteredCategoryConfigs: function () { $('.popover').remove(); + if (this.get('state') !== 'inDOM') return this.get('categoryConfigs'); var filter = this.get('parentView.filter').toLowerCase(); var selectedFilters = this.get('parentView.columns').filterProperty('selected'); var filteredResult = this.get('categoryConfigs').filter(function (config) { @@ -794,10 +796,11 @@ App.ServiceConfigContainerView = Em.ContainerView.extend({ } else { this.get('childViews').pushObject(this.get('view')); } + var categoriesToPush = []; this.get('controller.selectedService.configCategories').forEach(function (item) { var categoryView = item.get('isCustomView') ? (App.get('supports.capacitySchedulerUi') ? item.get('customView') : null) : App.ServiceConfigsByCategoryView; if (categoryView !== null) { - self.get('childViews.lastObject.serviceConfigsByCategoryView.childViews').pushObject(categoryView.extend({ + categoriesToPush.pushObject(categoryView.extend({ category: item, controllerBinding: controllerRoute, canEditBinding: 'parentView.canEdit', @@ -807,6 +810,14 @@ App.ServiceConfigContainerView = Em.ContainerView.extend({ })); } }); + lazyLoading.run({ + destination: self.get('childViews.lastObject.serviceConfigsByCategoryView.childViews'), + source: categoriesToPush, + initSize: 3, + chunkSize: 3, + delay: 200, + context: this + }); } }, selectedServiceObserver: function () {
