You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2016/06/30 21:51:33 UTC

ambari git commit: AMBARI-17511 - Hosts filter works incorrect with Flume (rzang)

Repository: ambari
Updated Branches:
  refs/heads/trunk 725c65130 -> 7d7a6f7ab


AMBARI-17511 - Hosts filter works incorrect with Flume (rzang)


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

Branch: refs/heads/trunk
Commit: 7d7a6f7abe67d42139d5770ef12cbffd6a066b91
Parents: 725c651
Author: Richard Zang <rz...@apache.org>
Authored: Thu Jun 30 14:50:05 2016 -0700
Committer: Richard Zang <rz...@apache.org>
Committed: Thu Jun 30 14:51:16 2016 -0700

----------------------------------------------------------------------
 ambari-web/app/views/main/host/combo_search_box.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7d7a6f7a/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 29a35ef..f417cc6 100644
--- a/ambari-web/app/views/main/host/combo_search_box.js
+++ b/ambari-web/app/views/main/host/combo_search_box.js
@@ -22,6 +22,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
   templateName: require('templates/main/host/combo_search_box'),
   healthStatusCategories: require('data/host/categories'),
   errMsg: '',
+  serviceMap : {},
 
   didInsertElement: function () {
     this.initVS();
@@ -104,6 +105,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
     var controller = App.router.get('mainHostComboSearchBoxController');
     this.showHideClearButton();
     var map = App.router.get('mainHostController.labelValueMap');
+    var serviceMap = this.get('serviceMap')
     var facetValue = map[facet] || facet;
     if (controller.isComponentStateFacet(facetValue)) {
       facetValue = 'componentState'
@@ -147,7 +149,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
         break;
       case 'services':
         callback(App.Service.find().toArray().map(function (service) {
-          map[App.format.role(service.get('serviceName'), true)] = service.get('serviceName');
+          serviceMap[App.format.role(service.get('serviceName'), true)] = service.get('serviceName');
           return App.format.role(service.get('serviceName'), true);
         }).reject(function (item) {
           return visualSearch.searchQuery.values(facet).indexOf(item) >= 0;
@@ -289,12 +291,13 @@ App.MainHostComboSearchBoxView = Em.View.extend({
   createFilterConditions: function(searchCollection) {
     var self = this;
     var mainHostController = App.router.get('mainHostController');
+    var map = mainHostController.get('labelValueMap');
+    var serviceMap = this.get('serviceMap');
     var filterConditions = Em.A();
     searchCollection.models.forEach(function (model) {
       var tag = model.attributes;
-      var map = mainHostController.get('labelValueMap');
       var category = map[tag.category] || tag.category;
-      var value = map[tag.value] || tag.value;
+      var value = (category == 'services')? (serviceMap[tag.value] || tag.value) : (map[tag.value] || tag.value);
 
       var iColumn = self.getFilterColumn(category, value);
       var filterValue = self.getFilterValue(category, value);