You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2015/08/12 03:26:41 UTC

[3/3] ambari git commit: AMBARI-12708. Hosts Page Performance: Reuse existing FE host model on drill in/out single host detail (rzang)

AMBARI-12708. Hosts Page Performance: Reuse existing FE host model on drill in/out single host detail (rzang)


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

Branch: refs/heads/trunk
Commit: cf3965b756423d42c264448f0d86adddec0a0f89
Parents: 721acd8
Author: Richard Zang <rz...@apache.org>
Authored: Tue Aug 11 11:47:55 2015 -0700
Committer: Richard Zang <rz...@apache.org>
Committed: Tue Aug 11 18:22:21 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js | 5 +++++
 ambari-web/app/mappers/hosts_mapper.js  | 4 +++-
 ambari-web/app/routes/main.js           | 2 +-
 ambari-web/app/views/main/host.js       | 5 ++++-
 4 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cf3965b7/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index 86dd2c2..aa82645 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -62,6 +62,11 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
    * if true, fire host loading immediately with out any postpone.
    */
   needQuickInitLoad: false,
+
+  /**
+   * true if from details page
+   */
+  isDrillUp: false,
   /**
    * Components which will be shown in component filter
    * @returns {Array}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cf3965b7/ambari-web/app/mappers/hosts_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js
index cd05499..69f0139 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -185,7 +185,9 @@ App.hostsMapper = App.QuickDataMapper.create({
         App.store.loadMany(App.HostStackVersion, stackVersions);
       }
       App.store.loadMany(App.HostComponent, components);
-      App.Host.find().clear();
+      if (App.router.get('currentState.parentState.name') != 'hostDetails') {
+        App.Host.find().clear();
+      }
       App.store.loadMany(App.Host, hostsWithFullInfo);
       var itemTotal = parseInt(json.itemTotal);
       if (!isNaN(itemTotal)) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/cf3965b7/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index acd6a39..de2f0a9 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -189,7 +189,6 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
       route: '/:host_id',
       connectOutlets: function (router, host) {
         router.get('mainHostController').set('showFilterConditionsFirstLoad', true);
-        router.set('mainHostController.needQuickInitLoad', true);
         router.get('mainController').connectOutlet('mainHostDetails', host);
       },
 
@@ -264,6 +263,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
     back: function (router, event) {
       var referer = router.get('mainHostDetailsController.referer');
       if (referer) {
+        router.set('mainHostController.isDrillUp', true);
         router.route(referer);
       }
       else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/cf3965b7/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index 3423fa2..e0f1cbf 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -212,7 +212,8 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
 
   onInitialLoad: function () {
     if (this.get('tableFilteringComplete')) {
-      if (this.get('controller.fromTopBarClicking') && !this.get('controller.filterClearHappened') && !this.get('controller.needQuickInitLoad')) {
+      if (this.get('controller.fromTopBarClicking') && !this.get('controller.filterClearHappened')
+      && !this.get('controller.needQuickInitLoad') || this.get('controller.isDrillUp')) {
         Em.run.later(this, this.refresh, App.get('contentUpdateInterval'));
         this.clearLoadRelatedStates();
       } else {
@@ -226,6 +227,8 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
     this.set('controller.filterClearHappened', false);
     this.set('controller.fromTopBarClicking', false);
     this.set('controller.needQuickInitLoad', false);
+    this.set('controller.isDrillUp', false);
+
   },
 
   /**