Browse Source

AMBARI-6326. Clicking on a single component link goes to Hosts page rather than directly to Host Details page.(xiwang)

Xi Wang 11 years ago
parent
commit
9f2517c925
1 changed files with 6 additions and 2 deletions
  1. 6 2
      ambari-web/app/controllers/global/update_controller.js

+ 6 - 2
ambari-web/app/controllers/global/update_controller.js

@@ -155,17 +155,21 @@ App.UpdateController = Em.Controller.extend({
 
 
     if (App.router.get('currentState.name') == 'index' && App.router.get('currentState.parentState.name') == 'hosts') {
     if (App.router.get('currentState.name') == 'index' && App.router.get('currentState.parentState.name') == 'hosts') {
       App.updater.updateInterval('updateHost', App.get('contentUpdateInterval'));
       App.updater.updateInterval('updateHost', App.get('contentUpdateInterval'));
+      this.get('queryParams').set('Hosts', App.router.get('mainHostController').getQueryParameters());
     } else if(App.router.get('currentState.name') == 'summary' && App.router.get('currentState.parentState.name') == 'hostDetails') {
     } else if(App.router.get('currentState.name') == 'summary' && App.router.get('currentState.parentState.name') == 'hostDetails') {
       realUrl = realUrl.replace('<parameters>', 'Hosts/host_name=' + App.router.get('location.lastSetURL').match(/\/hosts\/(.*)\/summary/)[1] + '&');
       realUrl = realUrl.replace('<parameters>', 'Hosts/host_name=' + App.router.get('location.lastSetURL').match(/\/hosts\/(.*)\/summary/)[1] + '&');
       App.updater.updateInterval('updateHost', App.get('componentsUpdateInterval'));
       App.updater.updateInterval('updateHost', App.get('componentsUpdateInterval'));
+      this.get('queryParams').set('Hosts', App.router.get('mainHostController').getQueryParameters());
     } else {
     } else {
       callback();
       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 (this.get('queryParams.Hosts') && this.get('queryParams.Hosts').length > 0) {
       if (this.get('queryParams.Hosts') && this.get('queryParams.Hosts').length > 0) {
+        // On pages except for hosts/hostDetails, making sure hostsMapper loaded only once on page load, no need to update, but at least once
         return;
         return;
+      } else {
+        // On pages except for hosts/hostDetails, set queryParams [] to ensure load all hosts, but not filtered hosts as shown on hosts page
+        this.get('queryParams').set('Hosts', []);
       }
       }
     }
     }
-    this.get('queryParams').set('Hosts', App.router.get('mainHostController').getQueryParameters());
     var clientCallback = function (skipCall, queryParams) {
     var clientCallback = function (skipCall, queryParams) {
       if (skipCall) {
       if (skipCall) {
         App.hostsMapper.map({items: []});
         App.hostsMapper.map({items: []});