mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-11 07:46:10 +01:00
wordpresscreateandinstalldone
This commit is contained in:
@@ -93,7 +93,7 @@ app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window, $co
|
||||
for (i = 0; i <= res.length; i++) {
|
||||
//
|
||||
var tml = '<option ng-click="Addplugin(\'' + res[i].slug + '\')" style=" border-bottom: 1px solid rgba(90, 91, 92, 0.5); padding: 5px; " value="' + res[i].slug + '">' + res[i].name + '</option> <br>';
|
||||
var temp = $compile(tml)($scope)
|
||||
var temp = $compile(tml)($scope)
|
||||
angular.element(document.getElementById('mysearch')).append(temp);
|
||||
}
|
||||
|
||||
@@ -199,9 +199,9 @@ app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window, $co
|
||||
}
|
||||
|
||||
$scope.Addplugin = function (slug) {
|
||||
$('#mysearch').hide()
|
||||
$('#mysearch').hide()
|
||||
|
||||
url = "/websites/Addplugineidt";
|
||||
url = "/websites/Addplugineidt";
|
||||
|
||||
|
||||
var data = {
|
||||
@@ -244,6 +244,183 @@ app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window, $co
|
||||
});
|
||||
|
||||
|
||||
app.controller('createWordpress', 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.createWordPresssite = 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 package = $scope.packageForWebsite;
|
||||
var websiteOwner = $scope.websiteOwner;
|
||||
var WPtitle = $scope.WPtitle;
|
||||
var domainNameCreate = $scope.domainNameCreate;
|
||||
var WPUsername = $scope.WPUsername;
|
||||
var adminEmail = $scope.adminEmail;
|
||||
var WPPassword = $scope.WPPassword;
|
||||
var WPVersions = $scope.WPVersions;
|
||||
var pluginbucket = $scope.pluginbucket;
|
||||
var autoupdates = $scope.autoupdates;
|
||||
var pluginupdates = $scope.pluginupdates;
|
||||
var themeupdates = $scope.themeupdates;
|
||||
var data = {
|
||||
|
||||
title: WPtitle,
|
||||
domain: domainNameCreate,
|
||||
WPVersion: WPVersions,
|
||||
PluginsThemes: pluginbucket,
|
||||
adminUser: WPUsername,
|
||||
Email: adminEmail,
|
||||
PasswordByPass: WPPassword,
|
||||
AutomaticUpdates: autoupdates,
|
||||
Plugins: pluginupdates,
|
||||
Themes: themeupdates,
|
||||
websiteOwner: websiteOwner,
|
||||
package: package,
|
||||
}
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
var url = "/websites/submitWorpressCreation";
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
statusFile = response.data.tempStatusPath;
|
||||
getCreationStatus();
|
||||
|
||||
} else {
|
||||
|
||||
// $scope.errorMessage = response.data.error_message;
|
||||
alert("Status not = 1: Error..." + response.data.error_message)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
alert("Error..." + response)
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
$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 */
|
||||
app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user