initializeClusterTest.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // This is to aid development by jumping to a specified stage on page load
  2. // so that the developer does not have to run through each page to see code
  3. // changes made to the stage (assuming the developer has already run the wizard
  4. // up to that stage and all the necessary data are in the database).
  5. // This is a stop-gap measure until we implement actual state/history management
  6. // so that a browser refresh reloads the current stage, rather than forcing
  7. // the user back to the first stage.
  8. (function() {
  9. var clusterName = 'test';
  10. //var stage ='createCluster';
  11. //var stage = 'selectServices';
  12. var stage = 'configureServices';
  13. Y.one("#createClusterCoreDivId").hide();
  14. var hitCurrentStage = false;
  15. Y.all('#installationWizardProgressBarListId li').each(function(tab) {
  16. if (tab.get('id') === (stage + 'StageId')) {
  17. hitCurrentStage = true;
  18. tab.set('className', 'installationWizardCurrentStage');
  19. } else if (!hitCurrentStage) {
  20. tab.set('className', 'installationWizardVisitedStage');
  21. }
  22. });
  23. switch (stage) {
  24. case 'createCluster':
  25. globalYui.one("#createClusterCoreDivId").show();
  26. break;
  27. case 'selectServices':
  28. renderSelectServicesBlock({ "clusterName": clusterName, "txnId":1 });
  29. break;
  30. case 'assignMasters':
  31. // TODO
  32. break;
  33. case 'selectMountPoints':
  34. // TODO
  35. renderConfigureCluster({ "clusterName": clusterName});
  36. break;
  37. case 'configureServices':
  38. renderOptionsPage({ "clusterName": clusterName});
  39. break;
  40. default:
  41. break;
  42. }
  43. })();