Repository: ambari Updated Branches: refs/heads/trunk 70ffe8d1e -> 9290e0091
AMBARI-16414: Clients are not present in Hosts filter (rzang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9290e009 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9290e009 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9290e009 Branch: refs/heads/trunk Commit: 9290e0091bef9b84dc1ae227186aa5c077f9c71d Parents: 70ffe8d Author: Richard Zang <[email protected]> Authored: Tue May 10 13:21:25 2016 -0700 Committer: Richard Zang <[email protected]> Committed: Tue May 10 13:21:44 2016 -0700 ---------------------------------------------------------------------- .../app/views/main/host/combo_search_box.js | 39 +++++++++++--------- 1 file changed, 22 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9290e009/ambari-web/app/views/main/host/combo_search_box.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/combo_search_box.js b/ambari-web/app/views/main/host/combo_search_box.js index 0b8c95b..caf200f 100644 --- a/ambari-web/app/views/main/host/combo_search_box.js +++ b/ambari-web/app/views/main/host/combo_search_box.js @@ -44,7 +44,8 @@ App.MainHostComboSearchBoxView = Em.View.extend({ getHostComponentList: function() { var hostComponentList = []; App.MasterComponent.find().rejectProperty('totalCount', 0).toArray() - .concat(App.SlaveComponent.find().rejectProperty('totalCount', 0).toArray()) + .concat(App.SlaveComponent.find().rejectProperty('totalCount', 0).toArray() + .concat(App.ClientComponent.find().rejectProperty('totalCount', 0).toArray())) .forEach(function(component) { var displayName = component.get('displayName'); if (displayName) { @@ -208,22 +209,26 @@ App.MainHostComboSearchBoxView = Em.View.extend({ case 'componentState': var list = [ "All" ]; map['All'] = 'ALL'; - var currentComponentFacets = self.getComponentStateFacets(null, true); - if (currentComponentFacets.length == 0) { - list = list.concat(App.HostComponentStatus.getStatusesList() - .reject(function(status){return status == "UPGRADE_FAILED"}) // take out 'UPGRADE_FAILED' - .map(function (status) { - map[App.HostComponentStatus.getTextStatus(status)] = status; - return App.HostComponentStatus.getTextStatus(status); - })) - .concat([ - "Inservice", - "Decommissioned", - "Decommissioning", - "RS Decommissioned", - "Maintenance Mode On", - "Maintenance Mode Off" - ]); + // client only have "ALL" state + if (facet.toLowerCase().indexOf("client") == -1) + { + var currentComponentFacets = self.getComponentStateFacets(null, true); + if (currentComponentFacets.length == 0) { + list = list.concat(App.HostComponentStatus.getStatusesList() + .reject(function(status){return status == "UPGRADE_FAILED"}) // take out 'UPGRADE_FAILED' + .map(function (status) { + map[App.HostComponentStatus.getTextStatus(status)] = status; + return App.HostComponentStatus.getTextStatus(status); + })) + .concat([ + "Inservice", + "Decommissioned", + "Decommissioning", + "RS Decommissioned", + "Maintenance Mode On", + "Maintenance Mode Off" + ]); + } } callback(list, {preserveOrder: true}); break;
