ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-13102. Hosts table is empty after refreshing page (akovalenko)
Date Tue, 15 Sep 2015 14:53:27 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d32556a03 -> 05a0932e8


AMBARI-13102. Hosts table is empty after refreshing page (akovalenko)


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

Branch: refs/heads/trunk
Commit: 05a0932e85276d6b283b3bc45bee4f6c3e1b55b1
Parents: d32556a
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Tue Sep 15 16:37:32 2015 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Tue Sep 15 17:51:39 2015 +0300

----------------------------------------------------------------------
 .../app/controllers/global/update_controller.js | 29 +++++++++++---------
 1 file changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/05a0932e/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index 23d9ff2..ac19d19 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -165,18 +165,19 @@ App.UpdateController = Em.Controller.extend({
    */
   updateHost: function (callback, error, lazyLoadMetrics) {
     var testUrl = this.get('HOSTS_TEST_URL'),
-      self = this,
-      hostDetailsFilter = '',
-      realUrl = '/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,'
+
-      'alerts_summary,Hosts/host_status,Hosts/last_heartbeat_time,Hosts/ip,host_components/HostRoles/state,host_components/HostRoles/maintenance_state,'
+
-      'host_components/HostRoles/stale_configs,host_components/HostRoles/service_name,host_components/HostRoles/desired_admin_state,'
+
-        '<metrics>Hosts/total_mem<hostDetailsParams><stackVersions>&minimal_response=true',
-      hostDetailsParams = ',Hosts/os_arch,Hosts/os_type,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free',
-      stackVersionInfo = ',stack_versions/HostStackVersions,' +
-      'stack_versions/repository_versions/RepositoryVersions/repository_version,stack_versions/repository_versions/RepositoryVersions/id,'
+
-      'stack_versions/repository_versions/RepositoryVersions/display_name',
-      mainHostController = App.router.get('mainHostController'),
-      sortProperties = mainHostController.getSortProps();
+        self = this,
+        hostDetailsFilter = '',
+        realUrl = '/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,'
+
+            'alerts_summary,Hosts/host_status,Hosts/last_heartbeat_time,Hosts/ip,host_components/HostRoles/state,host_components/HostRoles/maintenance_state,'
+
+            'host_components/HostRoles/stale_configs,host_components/HostRoles/service_name,host_components/HostRoles/desired_admin_state,'
+
+            '<metrics>Hosts/total_mem<hostDetailsParams><stackVersions>&minimal_response=true',
+        hostDetailsParams = ',Hosts/os_arch,Hosts/os_type,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free',
+        stackVersionInfo = ',stack_versions/HostStackVersions,' +
+            'stack_versions/repository_versions/RepositoryVersions/repository_version,stack_versions/repository_versions/RepositoryVersions/id,'
+
+            'stack_versions/repository_versions/RepositoryVersions/display_name',
+        mainHostController = App.router.get('mainHostController'),
+        sortProperties = mainHostController.getSortProps(),
+        isHostsLoaded = false;
     this.get('queryParams').set('Hosts', mainHostController.getQueryParameters(true));
     if (App.router.get('currentState.parentState.name') == 'hosts') {
       App.updater.updateInterval('updateHost', App.get('contentUpdateInterval'));
@@ -196,9 +197,11 @@ App.UpdateController = Em.Controller.extend({
         ]);
       }
       else {
+        // clusterController.isHostsLoaded may be changed in callback, that is why it's value
is cached before calling callback
+        isHostsLoaded = App.router.get('clusterController.isHostsLoaded');
         callback();
         // On pages except for hosts/hostDetails, making sure hostsMapper loaded only once
on page load, no need to update, but at least once
-        if (App.router.get('clusterController.isLoaded')) {
+        if (isHostsLoaded) {
           return;
         }
       }


Mime
View raw message