initializeClusterTest.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. *
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. *
  20. */
  21. // This is to aid development by jumping to a specified stage on page load
  22. // so that the developer does not have to run through each page to see code
  23. // changes made to the stage (assuming the developer has already run the wizard
  24. // up to that stage and all the necessary data are in the database).
  25. // This is a stop-gap measure until we implement actual state/history management
  26. // so that a browser refresh reloads the current stage, rather than forcing
  27. // the user back to the first stage.
  28. (function() {
  29. var clusterName = 'test';
  30. //var stage ='createCluster';
  31. //var stage = 'selectServices';
  32. var stage = 'configureServices';
  33. Y.one("#createClusterCoreDivId").hide();
  34. var hitCurrentStage = false;
  35. Y.all('#installationWizardProgressBarListId li').each(function(tab) {
  36. if (tab.get('id') === (stage + 'StageId')) {
  37. hitCurrentStage = true;
  38. tab.set('className', 'installationWizardCurrentStage');
  39. } else if (!hitCurrentStage) {
  40. tab.set('className', 'installationWizardVisitedStage');
  41. }
  42. });
  43. switch (stage) {
  44. case 'createCluster':
  45. globalYui.one("#createClusterCoreDivId").show();
  46. break;
  47. case 'selectServices':
  48. renderSelectServicesBlock({ "clusterName": clusterName, "txnId":1 });
  49. break;
  50. case 'assignMasters':
  51. // TODO
  52. break;
  53. case 'selectMountPoints':
  54. // TODO
  55. renderConfigureCluster({ "clusterName": clusterName});
  56. break;
  57. case 'configureServices':
  58. renderOptionsPage({ "clusterName": clusterName});
  59. break;
  60. default:
  61. break;
  62. }
  63. })();