mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-06 04:10:44 +01:00
remove duplicate createwbesite controller
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user