Repository: ambari Updated Branches: refs/heads/branch-2.4 97ec99673 -> 3a808822b
AMBARI-17703 - Hosts page: after component filter hosts have wrong list of components<fix1> (rzang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3a808822 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3a808822 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3a808822 Branch: refs/heads/branch-2.4 Commit: 3a808822b946f62958c547adeaa711e228cd02a1 Parents: 97ec996 Author: Richard Zang <[email protected]> Authored: Fri Nov 4 15:01:18 2016 -0700 Committer: Richard Zang <[email protected]> Committed: Fri Nov 4 15:06:31 2016 -0700 ---------------------------------------------------------------------- .../app/controllers/global/update_controller.js | 19 ++++++------------- ambari-web/app/controllers/main/host.js | 3 ++- 2 files changed, 8 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3a808822/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 fda1704..4631f09 100644 --- a/ambari-web/app/controllers/global/update_controller.js +++ b/ambari-web/app/controllers/global/update_controller.js @@ -27,11 +27,6 @@ App.UpdateController = Em.Controller.extend({ timeIntervalId: null, clusterName: Em.computed.alias('App.router.clusterController.clusterName'), - /** - * keys which should be preloaded in order to filter hosts by host-components - */ - hostsPreLoadKeys: ['host_components/HostRoles/component_name', 'host_components/HostRoles/stale_configs', 'host_components/HostRoles/maintenance_state'], - paginationKeys: ['page_size', 'from'], /** @@ -363,10 +358,8 @@ App.UpdateController = Em.Controller.extend({ * @return {Boolean} */ preLoadHosts: function (callback) { - var preLoadKeys = this.get('hostsPreLoadKeys'); - if (this.get('queryParams.Hosts').length > 0 && this.get('queryParams.Hosts').filter(function (param) { - return preLoadKeys.contains(param.key); + return param.isComponentRelatedFilter; }, this).length > 0) { this.getHostByHostComponents(callback); return true; @@ -393,7 +386,6 @@ App.UpdateController = Em.Controller.extend({ }) }, getHostByHostComponentsSuccessCallback: function (data, opt, params) { - var preLoadKeys = this.get('hostsPreLoadKeys'); var queryParams = this.get('queryParams.Hosts'); var hostNames = data.items.mapProperty('Hosts.host_name'); var skipCall = hostNames.length === 0; @@ -406,15 +398,16 @@ App.UpdateController = Em.Controller.extend({ if (skipCall) { params.callback(skipCall); } else { + // get all non-hostcomponent related keys queryParams = queryParams.filter(function (param) { - return !preLoadKeys.contains(param.key); + return !param.isComponentRelatedFilter; }); - - queryParams = [{ + // force specific hosts + queryParams.push({ key: 'Hosts/host_name', value: hostNames, type: 'MULTIPLE' - }]; + }); params.callback(skipCall, queryParams); } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/3a808822/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 cea40cb..b85ed95 100644 --- a/ambari-web/app/controllers/main/host.js +++ b/ambari-web/app/controllers/main/host.js @@ -258,7 +258,8 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, { key: property.key, value: filter.value, type: property.type, - isFilter: true + isFilter: true, + isComponentRelatedFilter: ([13,15].indexOf(filter.iColumn) != -1) }; if (filter.type === 'string' && sortProperties.someProperty('name', colPropAssoc[filter.iColumn])) { if (Em.isArray(filter.value)) {
