Repository: ambari Updated Branches: refs/heads/trunk f29ab2bdf -> 556b285e5
AMBARI-18777 Component actions confirmation window (from host details page) don't have the details about action to be confirmed (Vivek Ratnavel Subramanian via zhewang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/556b285e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/556b285e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/556b285e Branch: refs/heads/trunk Commit: 556b285e591211a2abf8a90830ee9d8bffc79562 Parents: f29ab2b Author: Zhe (Joe) Wang <[email protected]> Authored: Fri Nov 4 13:56:49 2016 -0700 Committer: Zhe (Joe) Wang <[email protected]> Committed: Fri Nov 4 13:56:49 2016 -0700 ---------------------------------------------------------------------- ambari-web/app/controllers/main/host/details.js | 39 ++++++++++---------- ambari-web/app/messages.js | 12 ++++++ 2 files changed, 31 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/556b285e/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 848e6f8..6851cbd 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -102,11 +102,11 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow */ startComponent: function (event) { var self = this; + var component = event.context; return App.showConfirmationPopup(function () { - var component = event.context; var context = Em.I18n.t('requestInfo.startHostComponent') + " " + component.get('displayName'); self.sendComponentCommand(component, context, App.HostComponentStatus.started); - }); + }, Em.I18n.t('question.sure.start').format(component.get('displayName'))); }, /** @@ -116,20 +116,19 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow */ stopComponent: function (event) { var self = this; + var component = event.context; if (event.context.get('componentName') == 'NAMENODE' ) { this.checkNnLastCheckpointTime(function () { return App.showConfirmationPopup(function () { - var component = event.context; var context = Em.I18n.t('requestInfo.stopHostComponent') + " " + component.get('displayName'); self.sendComponentCommand(component, context, App.HostComponentStatus.stopped); - }); + }, Em.I18n.t('question.sure.stop').format(component.get('displayName'))); }); } else { return App.showConfirmationPopup(function () { - var component = event.context; var context = Em.I18n.t('requestInfo.stopHostComponent') + " " + component.get('displayName'); self.sendComponentCommand(component, context, App.HostComponentStatus.stopped); - }); + }, Em.I18n.t('question.sure.stop').format(component.get('displayName'))); } }, /** @@ -493,7 +492,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow success: 'upgradeComponentSuccessCallback', error: 'ajaxErrorCallback' }); - }); + }, Em.I18n.t('question.sure.upgrade').format(component.get('displayName'))); }, /** @@ -521,12 +520,12 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow this.checkNnLastCheckpointTime(function () { return App.showConfirmationPopup(function () { batchUtils.restartHostComponents([component], Em.I18n.t('rollingrestart.context.selectedComponentOnSelectedHost').format(component.get('displayName')), "HOST_COMPONENT"); - }); + }, Em.I18n.t('question.sure.restart').format(component.get('displayName'))); }); } else { return App.showConfirmationPopup(function () { batchUtils.restartHostComponents([component], Em.I18n.t('rollingrestart.context.selectedComponentOnSelectedHost').format(component.get('displayName')), "HOST_COMPONENT"); - }); + }, Em.I18n.t('question.sure.restart').format(component.get('displayName'))); } }, @@ -1523,7 +1522,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow var self = this; return App.showConfirmationPopup(function () { self.runDecommission.call(self, self.get('content.hostName'), component.get('service.serviceName')); - }); + }, Em.I18n.t('question.sure.decommission').format(component.get('service.serviceName'))); }, /** * identify correct component to run decommission on them by service name, @@ -1553,7 +1552,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow var self = this; return App.showConfirmationPopup(function () { self.runRecommission.call(self, self.get('content.hostName'), component.get('service.serviceName')); - }); + }, Em.I18n.t('question.sure.recommission').format(component.get('service.serviceName'))); }, /** * identify correct component to run recommission on them by service name, @@ -2034,7 +2033,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow if (components && components.get('length')) { return App.showConfirmationPopup(function () { self.sendComponentCommand(components, Em.I18n.t('hosts.host.maintainance.startAllComponents.context'), App.HostComponentStatus.started); - }); + }, Em.I18n.t('question.sure.startAll')); } }, @@ -2052,12 +2051,12 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow this.checkNnLastCheckpointTime(function () { App.showConfirmationPopup(function () { self.sendComponentCommand(components, Em.I18n.t('hosts.host.maintainance.stopAllComponents.context'), App.HostComponentStatus.stopped); - }); + }, Em.I18n.t('question.sure.stopAll')); }); } else { return App.showConfirmationPopup(function () { self.sendComponentCommand(components, Em.I18n.t('hosts.host.maintainance.stopAllComponents.context'), App.HostComponentStatus.stopped); - }); + }, Em.I18n.t('question.sure.stopAll')); } } }, @@ -2076,12 +2075,12 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow this.checkNnLastCheckpointTime(function () { App.showConfirmationPopup(function () { batchUtils.restartHostComponents(components, Em.I18n.t('rollingrestart.context.allOnSelectedHost').format(self.get('content.hostName')), "HOST"); - }); + }, Em.I18n.t('question.sure.restartAll')); }); } else { return App.showConfirmationPopup(function () { batchUtils.restartHostComponents(components, Em.I18n.t('rollingrestart.context.allOnSelectedHost').format(self.get('content.hostName')), "HOST"); - }); + }, Em.I18n.t('question.sure.restartAll')); } } }, @@ -2460,16 +2459,16 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow * @method moveComponent */ moveComponent: function (event) { + var component = event.context; if ($(event.target).closest('li').hasClass('disabled')) { return; } return App.showConfirmationPopup(function () { - var component = event.context; var reassignMasterController = App.router.get('reassignMasterController'); reassignMasterController.saveComponentToReassign(component); reassignMasterController.setCurrentStep('1'); App.router.transitionTo('reassign'); - }); + }, Em.I18n.t('question.sure.move').format(component.get('displayName'))); }, /** @@ -2483,7 +2482,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow if (components.get('length') > 0) { return App.showConfirmationPopup(function () { batchUtils.restartHostComponents(components, Em.I18n.t('rollingrestart.context.allClientsOnSelectedHost').format(self.get('content.hostName')), "HOST"); - }); + }, Em.I18n.t('question.sure.refresh').format(self.get('content.hostName')) ); } }, @@ -2494,7 +2493,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow message = Em.I18n.t('passiveState.turn' + state.toCapital() + 'For').format(event.context.get('displayName')); return App.showConfirmationPopup(function () { self.updateComponentPassiveState(event.context, state, message); - }); + }, Em.I18n.t('question.sure.maintenance').format(event.context.get('displayName')) ); }, downloadClientConfigs: function (event) { http://git-wip-us.apache.org/repos/asf/ambari/blob/556b285e/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 7c8ac0e..1f113c8 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -413,6 +413,18 @@ Em.I18n.translations = { 'hostPopup.recommendation.beforeDecommission': '{0} Maintenance Mode is pre required for decommissioning.', 'question.sure':'Are you sure?', + 'question.sure.restart':'Are you sure you want to restart {0}?', + 'question.sure.start':'Are you sure you want to start {0}?', + 'question.sure.stop':'Are you sure you want to stop {0}?', + 'question.sure.move':'Are you sure you want to move {0}?', + 'question.sure.refresh':'Are you sure you want to restart all clients on {0}?', + 'question.sure.maintenance':'Are you sure you want to turn on maintenance mode for {0}?', + 'question.sure.upgrade':'Are you sure you want to upgrade {0}?', + 'question.sure.decommission':'Are you sure you want to decommission {0}?', + 'question.sure.recommission':'Are you sure you want to recommission {0}?', + 'question.sure.startAll':'Are you sure you want to start all the components?', + 'question.sure.stopAll':'Are you sure you want to stop all the components?', + 'question.sure.restartAll':'Are you sure you want to restart all the components?', 'popup.highlight':'click to highlight', 'popup.confirmation.commonHeader':'Confirmation',
