ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject git commit: AMBARI-4668. Request/task names shown for Maintenance Mode toggling don't make sense. (jaimin)
Date Sat, 15 Feb 2014 03:16:16 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 9f4df9fd8 -> 592db99f4


AMBARI-4668. Request/task names shown for Maintenance Mode toggling don't make sense. (jaimin)


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

Branch: refs/heads/trunk
Commit: 592db99f483f020ba288f3030d560e7299b9d8cf
Parents: 9f4df9f
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Fri Feb 14 19:15:35 2014 -0800
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Fri Feb 14 19:15:46 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js        | 13 ++++++++-----
 ambari-web/app/messages.js                             |  4 ++--
 .../app/views/main/host/hosts_table_menu_view.js       |  8 ++++----
 ambari-web/app/views/main/service/item.js              |  9 +++++++--
 4 files changed, 21 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/592db99f/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 6090686..ca3e15a 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -974,8 +974,9 @@ App.MainHostDetailsController = Em.Controller.extend({
   onOffPassiveModeForHost: function(context) {
     var state = context.active ? 'PASSIVE' : 'ACTIVE';
     var self = this;
+    var message = context.label + ' for host';
     App.showConfirmationPopup(function() {
-          self.hostPassiveModeRequest(state, context.label)
+          self.hostPassiveModeRequest(state, message)
         },
         Em.I18n.t('hosts.passiveMode.popup').format(context.active ? 'On' : 'Off',this.get('content.hostName'))
     );
@@ -1226,22 +1227,24 @@ App.MainHostDetailsController = Em.Controller.extend({
   turnOnOffPassiveConfirmation: function(event){
     var self = this;
     var component = event.context;
-    var state, onOff;
+    var state, onOff, message;
     if (component.get("passiveState") == "PASSIVE") {
       onOff = "Off";
       state = "ACTIVE";
+      message =  Em.I18n.t('passiveState.turnOffFor').format(component.get('displayName'));
     } else {
       onOff = "On";
       state = "PASSIVE";
+      message = Em.I18n.t('passiveState.turnOnFor').format(component.get('displayName'));
     }
     App.showConfirmationPopup(function() {
-          self.turnOnOffPassive(state, component)
+          self.turnOnOffPassive(state, component, message)
         },
         Em.I18n.t('hosts.passiveMode.popup').format(onOff,component.get('displayName'))
     );
   },
 
-  turnOnOffPassive: function(state,component) {
+  turnOnOffPassive: function(state,component,message) {
     var hostName = this.get('content.hostName');
     App.ajax.send({
       name: 'host_component.passive',
@@ -1251,7 +1254,7 @@ App.MainHostDetailsController = Em.Controller.extend({
         hostName: hostName,
         componentName: component.get('componentName'),
         passive_state: state,
-        requestInfo: component.get('componentName') + " " + state
+        requestInfo: message
       },
       success: 'updateComponentPassiveState'
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/592db99f/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 83e420c..6a48c64 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -190,8 +190,8 @@ Em.I18n.translations = {
   'common.hostLog.popup.errorLog.value': 'errors-{0}.txt',
   'passiveState.turnOn':'Turn On Maintenance Mode',
   'passiveState.turnOff':'Turn Off Maintenance Mode',
-  'passiveState.turnOnFor':'Turn On Maintenance Mode for',
-  'passiveState.turnOffFor':'Turn Off Maintenance Mode for',
+  'passiveState.turnOnFor':'Turn On Maintenance Mode for {0}',
+  'passiveState.turnOffFor':'Turn Off Maintenance Mode for {0}',
 
   'requestInfo.installComponents':'Install Components',
   'requestInfo.installServices':'Install Services',

http://git-wip-us.apache.org/repos/asf/ambari/blob/592db99f/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 073bff5..bec0bd2 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
@@ -93,7 +93,7 @@ App.HostTableMenuView = Em.View.extend({
         operationData: Em.Object.create({
           state: 'PASSIVE',
           action: 'PASSIVE_STATE',
-          message: Em.I18n.t('passiveState.turnOnFor'),
+          message: Em.I18n.t('passiveState.turnOnFor').format(App.format.components[componentNameForOtherActions]),
           componentName: componentNameForOtherActions
         })
       }),
@@ -102,7 +102,7 @@ App.HostTableMenuView = Em.View.extend({
         operationData: Em.Object.create({
           state: 'ACTIVE',
           action: 'PASSIVE_STATE',
-          message: Em.I18n.t('passiveState.turnOffFor'),
+          message: Em.I18n.t('passiveState.turnOffFor').format(App.format.components[componentNameForOtherActions]),
           componentName: componentNameForOtherActions
         })
       })
@@ -152,7 +152,7 @@ App.HostTableMenuView = Em.View.extend({
         operationData: Em.Object.create({
           state: 'PASSIVE',
           action: 'PASSIVE_STATE',
-          message: Em.I18n.t('passiveState.turnOn')
+          message: Em.I18n.t('passiveState.turnOnFor').format('hosts')
         })
       }),
       Em.Object.create({
@@ -160,7 +160,7 @@ App.HostTableMenuView = Em.View.extend({
         operationData: Em.Object.create({
           state: 'ACTIVE',
           action: 'PASSIVE_STATE',
-          message: Em.I18n.t('passiveState.turnOff')
+          message: Em.I18n.t('passiveState.turnOffFor').format('hosts')
         })
       })
     ]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/592db99f/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index e617e98..c375cee 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -55,8 +55,13 @@ App.MainServiceItemView = Em.View.extend({
       default:
         options.push({action: 'runSmokeTest', cssClass: 'icon-thumbs-up-alt', 'label': Em.I18n.t('services.service.actions.run.smoke'),
disabled:disabled});
     }
-    var passiveLabel = service.get('passiveState') === "ACTIVE" ? Em.I18n.t('passiveState.turnOn')
: Em.I18n.t('passiveState.turnOff');
-    options.push({action:'turnOnOffPassive', cssClass: 'icon-medkit', context:passiveLabel,
'label':passiveLabel , disabled: false});
+    var requestLabel = service.get('passiveState') === "ACTIVE" ?
+      Em.I18n.t('passiveState.turnOnFor').format(App.Service.DisplayNames[serviceName]) :
+      Em.I18n.t('passiveState.turnOffFor').format(App.Service.DisplayNames[serviceName]);
+    var passiveLabel = service.get('passiveState') === "ACTIVE" ?
+      Em.I18n.t('passiveState.turnOn') :
+      Em.I18n.t('passiveState.turnOff');
+    options.push({action:'turnOnOffPassive', cssClass: 'icon-medkit', context:requestLabel,
'label':passiveLabel , disabled: false});
     return options;
   }.property('controller.content', 'controller.isStopDisabled'),
   isMaintenanceActive: function() {


Mime
View raw message