createCluster.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. function handleCreateClusterError (errorResponse) {
  2. globalYui.one("#clusterNameId").addClass('formInputError');
  3. setFormStatus(errorResponse.error, true);
  4. globalYui.one("#clusterNameId").focus();
  5. }
  6. globalYui.one('#createClusterSubmitButtonId').on('click',function (e) {
  7. var createClusterData = {
  8. "clusterName" : globalYui.Lang.trim(globalYui.one("#clusterNameId").get('value')),
  9. };
  10. globalYui.log("Cluster Name: "+globalYui.Lang.dump(createClusterData));
  11. /* Always clear the slate with each submit. */
  12. clearFormStatus();
  13. globalYui.one("#clusterNameId").removeClass('formInputError');
  14. submitDataAndProgressToNextScreen(
  15. '../php/frontend/createCluster.php', createClusterData, e.target,
  16. '#createClusterCoreDivId', '#addNodesCoreDivId', InstallationWizard.AddNodes.render,
  17. handleCreateClusterError );
  18. });
  19. /* Signify that the containing application is ready for business. */
  20. hideLoadingImg();
  21. /* At the end of the installation wizard, we hide
  22. * #installationWizardProgressBarDivId, so make sure we explicitly show
  23. * it at the beginning, to ensure we work correctly when user flow
  24. * (potentially) cycles back here.
  25. */
  26. globalYui.one('#installationWizardProgressBarDivId').setStyle('display', 'block');