浏览代码

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

Xi Wang 11 年之前
父节点
当前提交
9f2517c925
共有 1 个文件被更改,包括 6 次插入2 次删除
  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') {
       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') {
       realUrl = realUrl.replace('<parameters>', 'Hosts/host_name=' + App.router.get('location.lastSetURL').match(/\/hosts\/(.*)\/summary/)[1] + '&');
       App.updater.updateInterval('updateHost', App.get('componentsUpdateInterval'));
+      this.get('queryParams').set('Hosts', App.router.get('mainHostController').getQueryParameters());
     } else {
       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) {
+        // On pages except for hosts/hostDetails, making sure hostsMapper loaded only once on page load, no need to update, but at least once
         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) {
       if (skipCall) {
         App.hostsMapper.map({items: []});