Parcourir la source

AMBARI-8902. Kerberos wizard: Tasks related to a stage should be shown in the hostpopup. (jaimin)

Jaimin Jetly il y a 10 ans
Parent
commit
c1c980525b

+ 17 - 3
ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js

@@ -56,6 +56,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'
       })

+ 2 - 1
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 () {

+ 5 - 0
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'