Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 6260332ea -> f7e85204b


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/f7e85204
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f7e85204
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f7e85204

Branch: refs/heads/branch-1.7.0
Commit: f7e85204b67e9f54d64f6cddbc3d8197b3cb6517
Parents: 6260332
Author: atkach <[email protected]>
Authored: Fri Oct 24 17:55:44 2014 +0300
Committer: atkach <[email protected]>
Committed: Fri Oct 24 17:55:44 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/f7e85204/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 () {

Reply via email to