This is an automated email from the ASF dual-hosted git repository. wuzhiguo pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push: new e39be67fae AMBARI-25164: Make Rack "Config Refresh" behaviour is the same as 2.7 (#3412) e39be67fae is described below commit e39be67faeceefd2bb49d14dd62ddc5759bcfb88 Author: Zhiguo Wu <wuzhi...@apache.org> AuthorDate: Thu Oct 27 14:30:06 2022 +0800 AMBARI-25164: Make Rack "Config Refresh" behaviour is the same as 2.7 (#3412) --- ambari-web/app/controllers/main/host/details.js | 10 ++++++---- ambari-web/app/messages.js | 4 ++-- ambari-web/app/templates/main/host/details/host_component.hbs | 2 +- ambari-web/test/controllers/main/host/details_test.js | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 59f863b632..25d0255d37 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -2896,11 +2896,13 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow */ refreshConfigs: function (event) { var self = this; - var components = event.context; - if (components.get('length') > 0) { + var component = event.context; + if (!Em.isNone(component)) { 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')) ); + var message = Em.I18n.t('rollingrestart.context.ClientOnSelectedHost') + .format(component.get('displayName'), self.get('content.hostName')); + batchUtils.restartHostComponents([component], message, "HOST"); + }, Em.I18n.t('question.sure.refresh').format(component.get('displayName'), self.get('content.hostName'))); } }, diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index eef17b6f80..e8b4d27948 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -441,7 +441,7 @@ Em.I18n.translations = { '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.refresh':'Are you sure you want to restart {0} on {1}?', '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}?', @@ -3302,7 +3302,7 @@ Em.I18n.translations = { 'rollingrestart.context.configs.allOnSelectedHosts':'Refresh all configs on the selected hosts', 'rollingrestart.context.allForSelectedService':'Restart all components for {0}', 'rollingrestart.context.allWithStaleConfigsForSelectedService':'Restart all components with Stale Configs for {0}', - 'rollingrestart.context.allClientsOnSelectedHost':'Restart all clients on {0}', + 'rollingrestart.context.ClientOnSelectedHost':'Restart {0} on {1}', 'rollingrestart.context.allWithStaleConfigsOnSelectedHost':'Restart components with Stale Configs on {0}', 'rollingrestart.context.allOnSelectedHost':'Restart all components on {0}', 'rollingrestart.context.selectedComponentOnSelectedHost':'Restart {0}', diff --git a/ambari-web/app/templates/main/host/details/host_component.hbs b/ambari-web/app/templates/main/host/details/host_component.hbs index e2c4d5d1d7..3865203ddc 100644 --- a/ambari-web/app/templates/main/host/details/host_component.hbs +++ b/ambari-web/app/templates/main/host/details/host_component.hbs @@ -78,7 +78,7 @@ <ul class="dropdown-menu"> <li> <a href="javascript:void(null)" data-toggle="modal" - {{action "refreshComponentConfigs" view.content target="controller"}}> + {{action "refreshConfigs" view.content target="controller"}}> {{t hosts.host.details.refreshConfigs}} </a> </li> diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js index be596ec7a1..ffe23d8153 100644 --- a/ambari-web/test/controllers/main/host/details_test.js +++ b/ambari-web/test/controllers/main/host/details_test.js @@ -2550,16 +2550,16 @@ describe('App.MainHostDetailsController', function () { }); it('No components', function () { - var event = {context: Em.A([])}; + var event = {context: null}; controller.refreshConfigs(event); expect(App.showConfirmationPopup.called).to.be.false; }); it('Some components present', function () { - var event = {context: Em.A([Em.Object.create()])}; + var event = {context: Em.Object.create({displayName: 'c1'})}; var popup = controller.refreshConfigs(event); expect(App.showConfirmationPopup.calledOnce).to.be.true; popup.onPrimary(); - expect(batchUtils.restartHostComponents.calledWith(event.context)).to.be.true; + expect(batchUtils.restartHostComponents.calledWith([event.context])).to.be.true; }); }); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@ambari.apache.org For additional commands, e-mail: commits-h...@ambari.apache.org