From 1d86587dccf1ebd20e7b88db51fa62c175575d4b Mon Sep 17 00:00:00 2001 From: usmannasir Date: Sun, 13 Apr 2025 23:22:54 +0500 Subject: [PATCH] remove duplicate createwbesite controller --- .../websiteFunctions/websiteFunctions.js | 455 ------------------ 1 file changed, 455 deletions(-) diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index cb5e9f74a..143947cb5 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -2355,234 +2355,6 @@ function website_create_checkbox_function() { // alert(domain_check); } -app.controller('createWebsite', function ($scope, $http, $timeout, $window) { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = false; - $scope.installationProgress = true; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = true; - - var statusFile; - - $scope.createWebsite = function () { - - $scope.webSiteCreationLoading = false; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = true; - - $scope.currentStatus = "Starting creation.."; - - var ssl, dkimCheck, openBasedir, mailDomain, apacheBackend; - - if ($scope.sslCheck === true) { - ssl = 1; - } else { - ssl = 0 - } - - if ($scope.apacheBackend === true) { - apacheBackend = 1; - } else { - apacheBackend = 0 - } - - if ($scope.dkimCheck === true) { - dkimCheck = 1; - } else { - dkimCheck = 0 - } - - if ($scope.openBasedir === true) { - openBasedir = 1; - } else { - openBasedir = 0 - } - - if ($scope.mailDomain === true) { - mailDomain = 1; - } else { - mailDomain = 0 - } - - - url = "/websites/submitWebsiteCreation"; - - var package = $scope.packageForWebsite; - - // if (website_create_domain_check == 0) { - // var Part2_domainNameCreate = document.getElementById('Part2_domainNameCreate').value; - // var domainName = document.getElementById('TestDomainNameCreate').value + Part2_domainNameCreate; - // } - // if (website_create_domain_check == 1) { - // - // var domainName = $scope.domainNameCreate; - // } - var domainName = $scope.domainNameCreate; - - // var domainName = $scope.domainNameCreate; - - var adminEmail = $scope.adminEmail; - var phpSelection = $scope.phpSelection; - var websiteOwner = $scope.websiteOwner; - - - var data = { - package: package, - domainName: domainName, - adminEmail: adminEmail, - phpSelection: phpSelection, - ssl: ssl, - websiteOwner: websiteOwner, - dkimCheck: dkimCheck, - openBasedir: openBasedir, - mailDomain: mailDomain, - apacheBackend: apacheBackend - }; - - - var config = { - headers: { - 'X-CSRFToken': getCookie('csrftoken') - } - }; - - $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - - - function ListInitialDatas(response) { - - if (response.data.createWebSiteStatus === 1) { - statusFile = response.data.tempStatusPath; - getCreationStatus(); - } else { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = false; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = false; - - $scope.errorMessage = response.data.error_message; - } - - - } - - function cantLoadInitialDatas(response) { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = false; - $scope.goBackDisable = false; - - } - - - }; - $scope.goBack = function () { - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = false; - $scope.installationProgress = true; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = true; - $("#installProgress").css("width", "0%"); - }; - - function getCreationStatus() { - - url = "/websites/installWordpressStatus"; - - var data = { - statusFile: statusFile - }; - - var config = { - headers: { - 'X-CSRFToken': getCookie('csrftoken') - } - }; - - - $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - - - function ListInitialDatas(response) { - - - if (response.data.abort === 1) { - - if (response.data.installStatus === 1) { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = false; - $scope.couldNotConnect = true; - $scope.goBackDisable = false; - - $("#installProgress").css("width", "100%"); - $scope.installPercentage = "100"; - $scope.currentStatus = response.data.currentStatus; - $timeout.cancel(); - - } else { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = false; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = false; - - $scope.errorMessage = response.data.error_message; - - $("#installProgress").css("width", "0%"); - $scope.installPercentage = "0"; - $scope.goBackDisable = false; - - } - - } else { - $("#installProgress").css("width", response.data.installationProgress + "%"); - $scope.installPercentage = response.data.installationProgress; - $scope.currentStatus = response.data.currentStatus; - $timeout(getCreationStatus, 1000); - } - - } - - function cantLoadInitialDatas(response) { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = false; - $scope.goBackDisable = false; - - } - - - } - -}); /* Java script code to create account ends here */ @@ -9208,234 +8980,7 @@ function website_create_checkbox_function() { // alert(domain_check); } -app.controller('createWebsite', function ($scope, $http, $timeout, $window) { - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = true; - - var statusFile; - - $scope.createWebsite = function () { - - $scope.webSiteCreationLoading = false; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = true; - - $scope.currentStatus = "Starting creation.."; - - var ssl, dkimCheck, openBasedir, mailDomain, apacheBackend; - - if ($scope.sslCheck === true) { - ssl = 1; - } else { - ssl = 0 - } - - if ($scope.apacheBackend === true) { - apacheBackend = 1; - } else { - apacheBackend = 0 - } - - if ($scope.dkimCheck === true) { - dkimCheck = 1; - } else { - dkimCheck = 0 - } - - if ($scope.openBasedir === true) { - openBasedir = 1; - } else { - openBasedir = 0 - } - - if ($scope.mailDomain === true) { - mailDomain = 1; - } else { - mailDomain = 0 - } - - - url = "/websites/submitWebsiteCreation"; - - var package = $scope.packageForWebsite; - - // if (website_create_domain_check == 0) { - // var Part2_domainNameCreate = document.getElementById('Part2_domainNameCreate').value; - // var domainName = document.getElementById('TestDomainNameCreate').value + Part2_domainNameCreate; - // } - // if (website_create_domain_check == 1) { - // - // var domainName = $scope.domainNameCreate; - // } - var domainName = $scope.domainNameCreate; - - // var domainName = $scope.domainNameCreate; - - var adminEmail = $scope.adminEmail; - var phpSelection = $scope.phpSelection; - var websiteOwner = $scope.websiteOwner; - - - var data = { - package: package, - domainName: domainName, - adminEmail: adminEmail, - phpSelection: phpSelection, - ssl: ssl, - websiteOwner: websiteOwner, - dkimCheck: dkimCheck, - openBasedir: openBasedir, - mailDomain: mailDomain, - apacheBackend: apacheBackend - }; - - - var config = { - headers: { - 'X-CSRFToken': getCookie('csrftoken') - } - }; - - $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - - - function ListInitialDatas(response) { - - if (response.data.createWebSiteStatus === 1) { - statusFile = response.data.tempStatusPath; - getCreationStatus(); - } else { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = false; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = false; - - $scope.errorMessage = response.data.error_message; - } - - - } - - function cantLoadInitialDatas(response) { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = false; - $scope.goBackDisable = false; - - } - - - }; - $scope.goBack = function () { - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = false; - $scope.installationProgress = true; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = true; - $("#installProgress").css("width", "0%"); - }; - - function getCreationStatus() { - - url = "/websites/installWordpressStatus"; - - var data = { - statusFile: statusFile - }; - - var config = { - headers: { - 'X-CSRFToken': getCookie('csrftoken') - } - }; - - - $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - - - function ListInitialDatas(response) { - - - if (response.data.abort === 1) { - - if (response.data.installStatus === 1) { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = false; - $scope.couldNotConnect = true; - $scope.goBackDisable = false; - - $("#installProgress").css("width", "100%"); - $scope.installPercentage = "100"; - $scope.currentStatus = response.data.currentStatus; - $timeout.cancel(); - - } else { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = false; - $scope.success = true; - $scope.couldNotConnect = true; - $scope.goBackDisable = false; - - $scope.errorMessage = response.data.error_message; - - $("#installProgress").css("width", "0%"); - $scope.installPercentage = "0"; - $scope.goBackDisable = false; - - } - - } else { - $("#installProgress").css("width", response.data.installationProgress + "%"); - $scope.installPercentage = response.data.installationProgress; - $scope.currentStatus = response.data.currentStatus; - $timeout(getCreationStatus, 1000); - } - - } - - function cantLoadInitialDatas(response) { - - $scope.webSiteCreationLoading = true; - $scope.installationDetailsForm = true; - $scope.installationProgress = false; - $scope.errorMessageBox = true; - $scope.success = true; - $scope.couldNotConnect = false; - $scope.goBackDisable = false; - - } - - - } - -}); /* Java script code to create account ends here */ /* Java script code to list accounts */