ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject git commit: AMBARI-4673. Bulk Ops: add Supervisor to Bulk Ops on Hosts page. (onechiporenko)
Date Fri, 14 Feb 2014 12:17:06 GMT
Updated Branches:
  refs/heads/trunk ecf4ab543 -> dbee456ae


AMBARI-4673. Bulk Ops: add Supervisor to Bulk Ops on Hosts page. (onechiporenko)


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

Branch: refs/heads/trunk
Commit: dbee456ae88d54ac89f5a9e9b9cc454fa9eca262
Parents: ecf4ab5
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Fri Feb 14 14:09:46 2014 +0200
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Fri Feb 14 14:17:00 2014 +0200

----------------------------------------------------------------------
 .../views/main/host/hosts_table_menu_view.js    | 29 ++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dbee456a/ambari-web/app/views/main/host/hosts_table_menu_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/hosts_table_menu_view.js b/ambari-web/app/views/main/host/hosts_table_menu_view.js
index 8f30484..073bff5 100644
--- a/ambari-web/app/views/main/host/hosts_table_menu_view.js
+++ b/ambari-web/app/views/main/host/hosts_table_menu_view.js
@@ -41,7 +41,7 @@ App.HostTableMenuView = Em.View.extend({
    * @returns {Array}
    */
   getSlaveItemsTemplate: function(componentNameForDecommission, componentNameForOtherActions)
{
-    return Em.A([
+    var menuItems = Em.A([
       Em.Object.create({
         label: Em.I18n.t('common.start'),
         operationData: Em.Object.create({
@@ -65,8 +65,10 @@ App.HostTableMenuView = Em.View.extend({
           message: Em.I18n.t('common.restart'),
           componentName: componentNameForOtherActions
         })
-      }),
-      Em.Object.create({
+      })
+    ]);
+    if(App.get('components.decommissionAllowed').contains(componentNameForOtherActions))
{
+      menuItems.pushObject(Em.Object.create({
         label: Em.I18n.t('common.decommission'),
         operationData: Em.Object.create({
           action: 'DECOMMISSION',
@@ -74,8 +76,8 @@ App.HostTableMenuView = Em.View.extend({
           componentName: componentNameForDecommission,
           realComponentName: componentNameForOtherActions
         })
-      }),
-      Em.Object.create({
+      }));
+      menuItems.pushObject(Em.Object.create({
         label: Em.I18n.t('common.recommission'),
         operationData: Em.Object.create({
           action: 'DECOMMISSION_OFF',
@@ -83,7 +85,9 @@ App.HostTableMenuView = Em.View.extend({
           componentName: componentNameForDecommission,
           realComponentName: componentNameForOtherActions
         })
-      }),
+      }));
+    }
+    menuItems.pushObjects(Em.A([
       Em.Object.create({
         label: Em.I18n.t('passiveState.turnOn'),
         operationData: Em.Object.create({
@@ -102,7 +106,8 @@ App.HostTableMenuView = Em.View.extend({
           componentName: componentNameForOtherActions
         })
       })
-    ]);
+    ]));
+    return menuItems;
   },
 
   /**
@@ -201,6 +206,14 @@ App.HostTableMenuView = Em.View.extend({
       slaveItemsForMapReduce.setEach('operationData.componentNameFormatted', Em.I18n.t('dashboard.services.mapreduce.taskTrackers'));
       submenu.push({label: Em.I18n.t('dashboard.services.mapreduce.taskTrackers'), submenu:
slaveItemsForMapReduce});
     }
+
+    if (!!App.Service.find().filterProperty('serviceName', 'STORM').length) {
+      var slaveItemsForStorm = this.getSlaveItemsTemplate('SUPERVISOR', 'SUPERVISOR');
+      slaveItemsForStorm.setEach('operationData.serviceName', 'STORM');
+      slaveItemsForStorm.setEach('operationData.componentNameFormatted', Em.I18n.t('dashboard.services.storm.supervisors'));
+      submenu.push({label: Em.I18n.t('dashboard.services.storm.supervisors'), submenu: slaveItemsForStorm});
+    }
+
     submenu.forEach(function(item) {
       item.submenu.forEach(function(subitem) {
         subitem.operationData.selection = selection;
@@ -211,7 +224,7 @@ App.HostTableMenuView = Em.View.extend({
 
   /**
    * Menu-items for Hosts table
-   * {Object}
+   * @type {Object}
    */
   menuItems: function() {
     return {


Mime
View raw message