Repository: ambari Updated Branches: refs/heads/trunk 568a1385f -> c1c980525
AMBARI-8902. Kerberos wizard: Tasks related to a stage should be shown in the hostpopup. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c1c98052 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c1c98052 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c1c98052 Branch: refs/heads/trunk Commit: c1c980525b46c62e43501f23e8acc3a7b49fa575 Parents: 568a138 Author: Jaimin Jetly <[email protected]> Authored: Tue Dec 23 17:52:46 2014 -0800 Committer: Jaimin Jetly <[email protected]> Committed: Tue Dec 23 17:52:46 2014 -0800 ---------------------------------------------------------------------- .../progress_popup_controller.js | 20 +++++++++++++++++--- .../wizard/wizardProgressPageController.js | 3 ++- ambari-web/app/utils/ajax/ajax.js | 5 +++++ 3 files changed, 24 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c1c98052/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js index c1d161c..e22365a 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js @@ -57,6 +57,12 @@ App.HighAvailabilityProgressPopupController = Ember.Controller.extend({ hostsData: [], /** + * StageId for the command. + * @type {Number} + */ + stageId: null, + + /** * During loading and calculations show popup with spinner * @type {Object} */ @@ -68,8 +74,9 @@ App.HighAvailabilityProgressPopupController = Ember.Controller.extend({ * @param requestIds {Array} * @param progressController {App.HighAvailabilityProgressPageController} * @param showSpinner {Boolean} + * @param stageId {Number} */ - initPopup: function (popupTitle, requestIds, progressController, showSpinner) { + initPopup: function (popupTitle, requestIds, progressController, showSpinner, stageId) { if(showSpinner){ var loadingPopup = App.ModalPopup.show({ header: Em.I18n.t('jobs.loadingTasks'), @@ -85,6 +92,7 @@ App.HighAvailabilityProgressPopupController = Ember.Controller.extend({ this.set('popupTitle', popupTitle); this.set('requestIds', requestIds); this.set('hostsData', []); + this.set('stageId', stageId); this.getHosts(); }, @@ -93,12 +101,18 @@ App.HighAvailabilityProgressPopupController = Ember.Controller.extend({ */ getHosts: function () { var requestIds = this.get('requestIds'); + var stageId = this.get('stageId'); + var name = 'admin.high_availability.polling'; + if (stageId) { + name = 'common.request.polling'; + } requestIds.forEach(function (requestId) { App.ajax.send({ - name: 'admin.high_availability.polling', + name: name, sender: this, data: { - requestId: requestId + requestId: requestId, + stageId: stageId }, success: 'onGetHostsSuccess' }) http://git-wip-us.apache.org/repos/asf/ambari/blob/c1c98052/ambari-web/app/mixins/wizard/wizardProgressPageController.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js index 843978a..9d12aff 100644 --- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js +++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js @@ -516,8 +516,9 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create({ showHostProgressPopup: function (event) { var popupTitle = event.contexts[0].title; var requestIds = event.contexts[0].requestIds; + var stageId = event.contexts[0].stageId; var hostProgressPopupController = App.router.get('highAvailabilityProgressPopupController'); - hostProgressPopupController.initPopup(popupTitle, requestIds, this, true); + hostProgressPopupController.initPopup(popupTitle, requestIds, this, true, stageId); }, done: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/c1c98052/ambari-web/app/utils/ajax/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js index 75f4e2e..0b5ef6d 100644 --- a/ambari-web/app/utils/ajax/ajax.js +++ b/ambari-web/app/utils/ajax/ajax.js @@ -186,6 +186,11 @@ var urls = { } }, + 'common.request.polling': { + 'real': '/clusters/{clusterName}/requests/{requestId}?fields=tasks/*,Requests/*&tasks/Tasks/stage_id={stageId}', + 'mock': '/data/background_operations/host_upgrade_tasks.json' + }, + 'service.ambari': { 'real': '/services/AMBARI?fields=components/RootServiceComponents', 'mock': '/data/services/ambari.json'
