configureServices.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. var globalOptionsInfo = null;
  2. globalYui.one('#configureClusterAdvancedSubmitButtonId').on('click',function (e) {
  3. var retval = checkPasswordCorrectness();
  4. if (retval.passwdMatched !== true) {
  5. setFormStatus(retval.errorString, true, true);
  6. document.getElementById(retval.focusOn).scrollIntoView();
  7. return;
  8. }
  9. cleanupClassesForPasswordErrors();
  10. clearFormStatus();
  11. clearErrorReasons(opts);
  12. var opts = generateUserOpts();
  13. e.target.set('disabled', true);
  14. var url = "../php/frontend/configureServices.php?clusterName="+globalOptionsInfo.clusterName;
  15. var requestData = opts;
  16. var submitButton = e.target;
  17. var thisScreenId = "#configureClusterAdvancedCoreDivId";
  18. var nextScreenId = "#deployCoreDivId";
  19. var nextScreenRenderFunction = renderDeploy;
  20. submitDataAndProgressToNextScreen(url, requestData, submitButton, thisScreenId, nextScreenId, nextScreenRenderFunction, handleConfigureServiceErrors);
  21. });
  22. // register an event handler for the password fields
  23. globalYui.one("#configureClusterAdvancedDynamicRenderDivId").delegate(
  24. {
  25. 'keyup' : function (passwordEvent) {
  26. checkPasswordCorrectness();
  27. }
  28. },
  29. "input[type=password]"
  30. );
  31. function renderConfigureServicesInternal (optionsInfo) {
  32. globalPasswordsArray = [];
  33. var optionsSummary = constructDOM(optionsInfo);
  34. globalYui.one("#configureClusterAdvancedDynamicRenderDivId").setContent( optionsSummary );
  35. hideLoadingImg();
  36. globalYui.one("#configureClusterAdvancedCoreDivId").setStyle("display", "block");
  37. }
  38. function renderOptionsPage (optionsInfo) {
  39. globalOptionsInfo = optionsInfo;
  40. var inputUrl = "../php/frontend/fetchClusterServices.php?clusterName=" + optionsInfo.clusterName + "&getConfigs=true";
  41. executeStage(inputUrl, renderConfigureServicesInternal);
  42. }