You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/06/11 14:00:41 UTC

git commit: AMBARI-6080. Hosts Components filter on Service summary page doesn't work. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk d9682afc7 -> 6f0723794


AMBARI-6080. Hosts Components filter on Service summary page doesn't work. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 6f0723794efd4d3ea6e6e0c5465e13b78c6e21c6
Parents: d9682af
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Wed Jun 11 14:57:41 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Wed Jun 11 14:57:41 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js         |  2 +-
 .../main/service/info/summary/falcon.hbs        |  4 +-
 .../main/service/info/summary/hive.hbs          |  4 +-
 .../main/service/info/summary/mapreduce2.hbs    |  4 +-
 .../main/service/info/summary/oozie.hbs         |  4 +-
 .../templates/main/service/info/summary/pig.hbs |  4 +-
 .../main/service/info/summary/sqoop.hbs         |  4 +-
 .../templates/main/service/info/summary/tez.hbs |  4 +-
 .../main/service/info/summary/zookeeper.hbs     |  4 +-
 ambari-web/app/views/main/host.js               |  5 +-
 .../app/views/main/service/info/summary.js      | 51 ++++++++------------
 11 files changed, 39 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/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 023bdc7..57c4a83 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -379,7 +379,7 @@ App.MainHostController = Em.ArrayController.extend(App.UserPref, {
 
     var filterForComponent = {
       iColumn: column,
-      value: id,
+      value: [id],
       type: 'multiple'
     };
     App.db.setFilterConditions(this.get('name'), [filterForComponent]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/templates/main/service/info/summary/falcon.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/falcon.hbs b/ambari-web/app/templates/main/service/info/summary/falcon.hbs
index 5f82156..59bb096 100644
--- a/ambari-web/app/templates/main/service/info/summary/falcon.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/falcon.hbs
@@ -19,8 +19,8 @@
 {{view view.sumMasterComponentView}}
 
 <tr>
-    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.falcon.client" plural="t:services.falcon.clients"}}</a></td>
+    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.service.installedClients singular="t:services.falcon.client" plural="t:services.falcon.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.falcon.client" plural="t:services.falcon.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.service.installedClients singular="t:services.falcon.client" plural="t:services.falcon.clients"}} {{t common.installed}}
     </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/templates/main/service/info/summary/hive.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/hive.hbs b/ambari-web/app/templates/main/service/info/summary/hive.hbs
index 93705ce..054e431 100644
--- a/ambari-web/app/templates/main/service/info/summary/hive.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/hive.hbs
@@ -19,8 +19,8 @@
 {{view view.sumMasterComponentView}}
 
 <tr>
-    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.hive.client" plural="t:services.hive.clients"}}</a></td>
+    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.service.installedClients singular="t:services.hive.client" plural="t:services.hive.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.hive.client" plural="t:services.hive.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.service.installedClients singular="t:services.hive.client" plural="t:services.hive.clients"}} {{t common.installed}}
     </td>
 </tr>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs b/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs
index 7158dec..79ef7e0 100644
--- a/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/mapreduce2.hbs
@@ -18,8 +18,8 @@
 
 {{view view.sumMasterComponentView}}
 <tr>
-    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.service.summary.mapreduce2.client" plural="t:services.service.summary.mapreduce2.clients"}}</a></td>
+    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.service.mapReduce2Clients singular="t:services.service.summary.mapreduce2.client" plural="t:services.service.summary.mapreduce2.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.service.mapReduce2Clients}} </span>{{pluralize view.clients.length singular="t:services.service.summary.mapreduce2.client" plural="t:services.service.summary.mapreduce2.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.mapReduce2Clients}} </span>{{pluralize view.service.mapReduce2Clients singular="t:services.service.summary.mapreduce2.client" plural="t:services.service.summary.mapreduce2.clients"}} {{t common.installed}}
     </td>
 </tr>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/templates/main/service/info/summary/oozie.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/oozie.hbs b/ambari-web/app/templates/main/service/info/summary/oozie.hbs
index af84caa..9625b73 100644
--- a/ambari-web/app/templates/main/service/info/summary/oozie.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/oozie.hbs
@@ -20,9 +20,9 @@
 {{view view.sumMasterComponentView}}
 
 <tr>
-    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.oozie.client" plural="t:services.oozie.clients"}}</a></td>
+    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.service.installedClients singular="t:services.oozie.client" plural="t:services.oozie.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.oozie.client" plural="t:services.oozie.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.service.installedClients singular="t:services.oozie.client" plural="t:services.oozie.clients"}} {{t common.installed}}
     </td>
 </tr>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/templates/main/service/info/summary/pig.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/pig.hbs b/ambari-web/app/templates/main/service/info/summary/pig.hbs
index 0f687c1..d4d48fd 100644
--- a/ambari-web/app/templates/main/service/info/summary/pig.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/pig.hbs
@@ -16,8 +16,8 @@
 * limitations under the License.
 }}
 <tr>
-  <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.pig.client" plural="t:services.pig.clients"}}</a></td>
+  <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.service.installedClients singular="t:services.pig.client" plural="t:services.pig.clients"}}</a></td>
   <td>
-    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.pig.client" plural="t:services.pig.clients"}} {{t common.installed}}
+    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.service.installedClients singular="t:services.pig.client" plural="t:services.pig.clients"}} {{t common.installed}}
   </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/templates/main/service/info/summary/sqoop.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/sqoop.hbs b/ambari-web/app/templates/main/service/info/summary/sqoop.hbs
index 5d6384b..db80425 100644
--- a/ambari-web/app/templates/main/service/info/summary/sqoop.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/sqoop.hbs
@@ -16,8 +16,8 @@
 * limitations under the License.
 }}
 <tr>
-  <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.sqoop.client" plural="t:services.sqoop.clients"}}</a></td>
+  <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.service.installedClients singular="t:services.sqoop.client" plural="t:services.sqoop.clients"}}</a></td>
   <td>
-    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.sqoop.client" plural="t:services.sqoop.clients"}} {{t common.installed}}
+    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.service.installedClients singular="t:services.sqoop.client" plural="t:services.sqoop.clients"}} {{t common.installed}}
   </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/templates/main/service/info/summary/tez.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/tez.hbs b/ambari-web/app/templates/main/service/info/summary/tez.hbs
index d06c67d..162c7b4 100644
--- a/ambari-web/app/templates/main/service/info/summary/tez.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/tez.hbs
@@ -16,8 +16,8 @@
 * limitations under the License.
 }}
 <tr>
-  <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.tez.client" plural="t:services.tez.clients"}}</a></td>
+  <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.service.installedClients singular="t:services.tez.client" plural="t:services.tez.clients"}}</a></td>
   <td>
-    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.tez.client" plural="t:services.tez.clients"}} {{t common.installed}}
+    <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.service.installedClients singular="t:services.tez.client" plural="t:services.tez.clients"}} {{t common.installed}}
   </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs b/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs
index 5ec6185..551e243 100644
--- a/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/zookeeper.hbs
@@ -20,8 +20,8 @@
 
 {{view view.sumMasterComponentView}}
 <tr>
-    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.clients.length singular="t:services.zookeeper.client" plural="t:services.zookeeper.clients"}}</a></td>
+    <td class="summary-label"><a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{pluralize view.service.installedClients singular="t:services.zookeeper.client" plural="t:services.zookeeper.clients"}}</a></td>
     <td>
-        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.clients.length singular="t:services.zookeeper.client" plural="t:services.zookeeper.clients"}} {{t common.installed}}
+        <span class="green-live">{{view.service.installedClients}} </span>{{pluralize view.service.installedClients singular="t:services.zookeeper.client" plural="t:services.zookeeper.clients"}} {{t common.installed}}
     </td>
 </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index a3a7ff4..81aad57 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -115,6 +115,7 @@ App.MainHostView = App.TableView.extend(App.TableServerProvider, {
     } else {
       this.clearFilters();
     }
+    this.addObserver('pageContent.@each.selected', this, this.selectedHostsObserver);
   },
 
   /**
@@ -174,7 +175,7 @@ App.MainHostView = App.TableView.extend(App.TableServerProvider, {
    */
   selectedHostsObserver: function() {
     Ember.run.once(this, 'updateCheckedFlags');
-  }.observes('pageContent.@each.selected'),
+  },
 
   /**
    * Update <code>selectAllHosts</code> value
@@ -747,7 +748,7 @@ App.MainHostView = App.TableView.extend(App.TableServerProvider, {
        * Verify that checked checkboxes are equal to value stored in hidden field (components ids list)
        */
       checkComponents: function() {
-        var components = this.get('value').split(',');
+        var components = this.get('value');
         var self = this;
         if (components) {
           components.forEach(function(componentId) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f072379/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index 69e51f4..e4e006e 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -154,35 +154,21 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     return result;
   }.property('controller.content'),
 
-  hasManyMonitors: function () {
-    var service = this.get('controller.content');
-    if (service.get("id") == "GANGLIA") {
-      var monitors = service.get('hostComponents').filterProperty('isMaster', false);
-      if (monitors.length == 0) {
-        return '';
-      } else if (monitors.length > 1) {
-        return Em.I18n.t('services.service.summary.viewHosts');
-      } else {
-        return Em.I18n.t('services.service.summary.viewHost');
-      }
-    }
-    return result;
-  }.property('controller.content'),
-
   /**
    * Property related to GANGLIA service, is unused for other services
-   * @return {Object}
+   * @type {Object}
    */
-  monitorsObj: function(){
-    var service = this.get('controller.content');
-    if (service.get("id") == "GANGLIA") {
-      var monitors = service.get('hostComponents').filterProperty('isMaster', false);
+  monitorsObj: function () {
+    if (this.get('controller.content.id') == "GANGLIA") {
+      var monitors = App.StackServiceComponent.find().filterProperty('serviceName', 'GANGLIA').filterProperty('isMaster', false);
       if (monitors.length) {
-        return monitors[0];
+        return Em.Object.create({
+          componentName: monitors.objectAt(0).get('componentName')
+        });
       }
     }
     return {};
-  }.property('controller.content'),
+  }.property('controller.content.id'),
 
   /**
    * Property related to ZOOKEEPER service, is unused for other services
@@ -200,20 +186,21 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   }.property('controller.content'),
 
   /**
-   * Property related to OOZIE and ZOOKEEPER services, is unused for other services
-   * HIVE is supported too
-   * @return {Object}
+   * Contain Object with <code>componentName</code> property for <code>filterByComponent</code> method
+   * @type {Object}
    */
-  clientObj: function() {
-    var service = this.get('controller.content');
-    if (this.get('servicesHaveClients').contains(service.get("id"))) {
-      var clients = service.get('hostComponents').filterProperty('isClient', true);
-      if (clients.length > 0) {
-        return clients[0];
+  clientObj: function () {
+    var serviceName = this.get('controller.content.id');
+    if (this.get('servicesHaveClients').contains(serviceName)) {
+      var clients = App.StackServiceComponent.find().filterProperty('serviceName', serviceName).filterProperty('isClient');
+      if (clients.length) {
+        return Em.Object.create({
+          componentName: clients.objectAt(0).get('componentName')
+        });
       }
     }
     return {};
-  }.property('controller.content'),
+  }.property('controller.content.id'),
 
   data:{
     hive:{