Browse Source

AMBARI-3327. NameNode HA wizard (rollback): Add page refresh after rollback is done. (alexantonenko)

Alex Antonenko 11 years ago
parent
commit
81e8423255

+ 2 - 3
ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js

@@ -145,7 +145,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
     App.clusterStatus.setClusterStatus({
       clusterName: this.get('content.cluster.name'),
       clusterState: 'HIGH_AVAILABILITY_ROLLBACK',
-      wizardControllerName: this.get('content.controllerName'),
+      wizardControllerName: 'highAvailabilityRollbackController',
       localdb: App.db.data
     });
   },
@@ -176,8 +176,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   done: function () {
     if (!this.get('isSubmitDisabled')) {
       this.removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
-      this.get('popup').hide();
-      App.router.transitionTo('main.admin.adminHighAvailability');
+      this.popup.proceedOnClose();
     }
   },
 

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js

@@ -26,7 +26,7 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
 
   hbaseSiteTag: "",
 
-  clearStep: function () {
+  initializeTasks: function () {
     this._super();
     if (!App.Service.find().someProperty('serviceName', 'HBASE')) {
       this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureHBase').get('id'), 1);

+ 5 - 1
ambari-web/app/router.js

@@ -271,7 +271,8 @@ App.Router = Em.Router.extend({
     var clusterStatusOnServer = App.clusterStatus.get('value');
     if (!localStorage.getObject('ambari').app.user.admin || clusterStatusOnServer && (clusterStatusOnServer.clusterState === 'CLUSTER_STARTED_5' ||
       clusterStatusOnServer.clusterState === 'ADD_HOSTS_COMPLETED_5' || clusterStatusOnServer.clusterState === 'STACK_UPGRADE_COMPLETED' ||
-      clusterStatusOnServer.clusterState === 'REASSIGN_MASTER_COMPLETED' || clusterStatusOnServer.clusterState === 'SECURITY_COMPLETED' || clusterStatusOnServer.clusterState === 'HIGH_AVAILABILITY_COMPLETED')) {
+      clusterStatusOnServer.clusterState === 'REASSIGN_MASTER_COMPLETED' || clusterStatusOnServer.clusterState === 'SECURITY_COMPLETED' || clusterStatusOnServer.clusterState === 'HIGH_AVAILABILITY_COMPLETED'
+      || clusterStatusOnServer.clusterState === 'HIGH_AVAILABILITY_DISABLED')) {
       return 'main.index';
     } else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('addHostController.name')) {
       // if wizardControllerName == "addHostController", then it means someone closed the browser or the browser was crashed when we were last in Add Hosts wizard
@@ -291,6 +292,9 @@ App.Router = Em.Router.extend({
     } else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('highAvailabilityWizardController.name')) {
       // if wizardControllerName == "highAvailabilityWizardController", then it means someone closed the browser or the browser was crashed when we were last in NameNode High Availability wizard
       return 'main.admin.enableHighAvailability';
+    }else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('highAvailabilityRollbackController.name')) {
+      // if wizardControllerName == "highAvailabilityRollbackController", then it means someone closed the browser or the browser was crashed when we were last in NameNode High Availability Rollback wizard
+      return 'main.admin.highAvailabilityRollback';
     } else {
       // if wizardControllerName == "installerController", then it means someone closed the browser or the browser was crashed when we were last in Installer wizard
       return 'installer';

+ 7 - 14
ambari-web/app/routes/main.js

@@ -692,25 +692,18 @@ module.exports = Em.Route.extend({
             secondary: null,
             showFooter: false,
 
-            onClose: function () {
-              var self = this;
-              var controller = router.get('highAvailabilityRollbackController');
-//                if (!controller.get('isSubmitDisabled')) {
-              self.proceedOnClose();
-//                }
-            },
             proceedOnClose: function () {
-                var controller = router.get('highAvailabilityWizardController');
-                controller.clearStorageData();
+              var controller = router.get('highAvailabilityWizardController');
+              controller.clearStorageData();
               App.router.get('updateController').set('isWorking', true);
               App.clusterStatus.setClusterStatus({
-                clusterName: router.get('content.cluster.name'),
-                clusterState: 'HIGH_AVAILABILITY_DISABLED',
-                wizardControllerName: router.get('highAvailabilityRollbackController.name'),
-                localdb: App.db.data
+              clusterName: router.get('content.cluster.name'),
+              clusterState: 'HIGH_AVAILABILITY_DISABLED',
+              wizardControllerName: router.get('highAvailabilityRollbackController.name'),
+              localdb: App.db.data
               });
               this.hide();
-              router.transitionTo('main.admin.adminHighAvailability');
+              router.transitionTo('main.admin.index');
               location.reload();
             },
             didInsertElement: function () {