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/02/29 22:50:09 UTC

ambari git commit: AMBARI-15229 Combo Search: Implement "version" related filters (Joe Wang via rzang)

Repository: ambari
Updated Branches:
  refs/heads/trunk 6bdc7fc7f -> 3286b00f3


AMBARI-15229 Combo Search: Implement "version" related filters (Joe Wang via rzang)


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

Branch: refs/heads/trunk
Commit: 3286b00f3d69be4b9944a8243a69613677e1a90f
Parents: 6bdc7fc
Author: Richard Zang <rz...@apache.org>
Authored: Mon Feb 29 13:48:43 2016 -0800
Committer: Richard Zang <rz...@apache.org>
Committed: Mon Feb 29 13:49:24 2016 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js         | 12 ++++++++++
 .../app/views/main/host/combo_search_box.js     | 23 +++++++++++++++-----
 2 files changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3286b00f/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 b7f6208..bfed1ba 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -143,6 +143,16 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
       type: 'MULTIPLE'
     },
     {
+      name: 'version',
+      key: 'stack_versions/repository_versions/RepositoryVersions/display_name',
+      type: 'EQUAL'
+    },
+    {
+      name: 'versionState',
+      key: 'stack_versions/HostStackVersions/state',
+      type: 'EQUAL'
+    },
+    {
       name: 'hostStackVersion',
       key: 'stack_versions',
       type: 'EQUAL'
@@ -570,6 +580,8 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
     associations[13] = 'services';
     associations[14] = 'state';
     associations[15] = 'componentState';
+    associations[16] = 'version';
+    associations[17] = 'versionState';
     return associations;
   }.property()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3286b00f/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 b52d91f..86f0c2f 100644
--- a/ambari-web/app/views/main/host/combo_search_box.js
+++ b/ambari-web/app/views/main/host/combo_search_box.js
@@ -46,6 +46,8 @@ App.MainHostComboSearchBoxView = Em.View.extend({
             {label: 'Host Name', value: 'hostName', category: 'Host'},
             {label: 'IP', value: 'ip', category: 'Host'},
             {label: 'Heath Status', value: 'healthClass', category: 'Host'},
+            {label: 'Stack Version', value: 'version', category: 'Host'},
+            {label: 'Version State', value: 'versionState', category: 'Host'},
             {label: 'Rack', value: 'rack', category: 'Host'},
             {label: 'Service', value: 'services', category: 'Service'},
             {label: 'Has Component', value: 'hostComponents', category: 'Service'},
@@ -66,7 +68,6 @@ App.MainHostComboSearchBoxView = Em.View.extend({
         },
 
         valueMatches: function (facet, searchTerm, callback) {
-          var category_mocks = require('data/host/categories');
           if (controller.isComponentStateFacet(facet)) {
             facet = 'componentState'
           }
@@ -82,16 +83,28 @@ App.MainHostComboSearchBoxView = Em.View.extend({
               callback(App.Host.find().toArray().mapProperty('rack').uniq());
               break;
             case 'version':
-              callback(App.StackVersion.find().toArray().mapProperty('name'));
+              callback(App.HostStackVersion.find().toArray().filterProperty('isVisible', true).mapProperty('displayName').uniq());
+              break;
+            case 'versionState':
+              callback(App.HostStackVersion.statusDefinition.map(function (status) {
+                return {label: App.HostStackVersion.formatStatus(status), value: status};
+              }));
               break;
             case 'healthClass':
-              callback(category_mocks.slice(1).mapProperty('healthStatus'), {preserveOrder: true});
+              var category_mocks = require('data/host/categories');
+              callback(category_mocks.slice(1).map(function (category) {
+                return {label: category.value, value: category.healthStatus}
+              }), {preserveOrder: true});
               break;
             case 'services':
-              callback(App.Service.find().toArray().mapProperty('serviceName'), {preserveOrder: true});
+              callback(App.Service.find().toArray().map(function (service) {
+                return {label: App.format.role(service.get('serviceName')), value: service.get('serviceName')};
+              }), {preserveOrder: true});
               break;
             case 'hostComponents':
-              callback(App.HostComponent.find().toArray().mapProperty('componentName').uniq(), {preserveOrder: true});
+              callback(App.HostComponent.find().toArray().mapProperty('componentName').uniq().map(function (componentName) {
+                return {label: App.format.role(componentName), value: componentName};
+              }));
               break;
             case 'state':
               callback(App.HostComponentStatus.getStatusesList(), {preserveOrder: true});