Updated Branches: refs/heads/trunk b9ac10628 -> 651d870c9
AMBARI-2806. Typing /#/installer/stepX in the UI takes the user to the Install Wizard even if the cluster already exists. (atkach via yusaku) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/651d870c Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/651d870c Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/651d870c Branch: refs/heads/trunk Commit: 651d870c93d453db274c0861cb8255a2c59e90f8 Parents: b9ac106 Author: Yusaku Sako <[email protected]> Authored: Mon Aug 5 12:01:52 2013 -0700 Committer: Yusaku Sako <[email protected]> Committed: Mon Aug 5 12:01:52 2013 -0700 ---------------------------------------------------------------------- ambari-web/app/routes/installer.js | 62 ++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/651d870c/ambari-web/app/routes/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js index 819b464..5222a5f 100644 --- a/ambari-web/app/routes/installer.js +++ b/ambari-web/app/routes/installer.js @@ -38,36 +38,40 @@ module.exports = Em.Route.extend({ Ember.run.next(function () { var installerController = router.get('installerController'); - App.clusterStatus.updateFromServer(); - var currentClusterStatus = App.clusterStatus.get('value'); - - if (currentClusterStatus) { - switch (currentClusterStatus.clusterState) { - case 'CLUSTER_DEPLOY_PREP_2' : - installerController.setCurrentStep('8'); - App.db.data = currentClusterStatus.localdb; - break; - case 'CLUSTER_INSTALLING_3' : - case 'SERVICE_STARTING_3' : - if(!installerController.get('isStep9')){ - installerController.setCurrentStep('9'); - } - App.db.data = currentClusterStatus.localdb; - break; - case 'CLUSTER_INSTALLED_4' : - if(!installerController.get('isStep10')){ - installerController.setCurrentStep('10'); - } - App.db.data = currentClusterStatus.localdb; - break; - case 'CLUSTER_STARTED_5' : - router.transitionTo('main.index'); - break; - default: - break; - } + App.clusterStatus.updateFromServer(); + var currentClusterStatus = App.clusterStatus.get('value'); + + if (currentClusterStatus) { + switch (currentClusterStatus.clusterState) { + case 'CLUSTER_NOT_CREATED_1' : + router.transitionTo('step' + installerController.get('currentStep')); + break; + case 'CLUSTER_DEPLOY_PREP_2' : + installerController.setCurrentStep('8'); + App.db.data = currentClusterStatus.localdb; + router.transitionTo('step' + installerController.get('currentStep')); + break; + case 'CLUSTER_INSTALLING_3' : + case 'SERVICE_STARTING_3' : + if (!installerController.get('isStep9')) { + installerController.setCurrentStep('9'); + } + App.db.data = currentClusterStatus.localdb; + router.transitionTo('step' + installerController.get('currentStep')); + break; + case 'CLUSTER_INSTALLED_4' : + if (!installerController.get('isStep10')) { + installerController.setCurrentStep('10'); + } + App.db.data = currentClusterStatus.localdb; + router.transitionTo('step' + installerController.get('currentStep')); + break; + case 'CLUSTER_STARTED_5' : + default: + router.transitionTo('main.index'); + break; } - router.transitionTo('step' + installerController.get('currentStep')); + } }); } else { Em.run.next(function () {
