Improved Joomla Installation process.

This commit is contained in:
usmannasir
2018-07-13 21:45:40 +05:00
parent eb3bd4844f
commit 86702824cc
12 changed files with 880 additions and 388 deletions

View File

@@ -457,6 +457,7 @@ app.controller('websitePages', function($scope,$http) {
$scope.fileManagerURL = "/filemanager/"+$("#domainNamePage").text();
$scope.wordPressInstallURL = $("#domainNamePage").text() + "/wordpressInstall";
$scope.joomlaInstallURL = $("#domainNamePage").text() + "/joomlaInstall";
$scope.domainAliasURL = "/websites/"+$("#domainNamePage").text()+"/domainAlias";
$scope.previewUrl = "/preview/"+$("#domainNamePage").text()+"/";
@@ -3870,9 +3871,6 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
$("#installProgress").css("width", "0%");
};
$scope.installWordPress = function(){
$scope.installationDetailsForm = true;
@@ -4036,28 +4034,148 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
}
});
app.controller('installJoomlaCTRL', function($scope, $http, $timeout) {
$scope.installationDetailsForm = false;
$scope.installationProgress = true;
$scope.installationFailed = true;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
$scope.wpInstallLoading = true;
$scope.goBackDisable = true;
$scope.databasePrefix = 'jm_'
var statusFile;
var domain = $("#domainNamePage").text();
var path;
$scope.goBack = function () {
$scope.installationDetailsForm = false;
$scope.installationProgress = true;
$scope.installationFailed = true;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
$scope.wpInstallLoading = true;
$scope.goBackDisable = true;
$("#installProgress").css("width", "0%");
};
function getInstallStatus(){
url = "/websites/installWordpressStatus";
var data = {
statusFile: statusFile,
domainName: domain
};
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.installationDetailsForm = true;
$scope.installationProgress = false;
$scope.installationFailed = true;
$scope.installationSuccessfull = false;
$scope.couldNotConnect = true;
$scope.wpInstallLoading = true;
$scope.goBackDisable = false;
if (typeof path !== 'undefined'){
$scope.installationURL = "http://"+domain+"/"+path;
}
else{
$scope.installationURL = domain;
}
$("#installProgress").css("width", "100%");
$scope.installPercentage = "100";
$scope.currentStatus = response.data.currentStatus;
$timeout.cancel();
}
else{
$scope.installationDetailsForm = true;
$scope.installationProgress = false;
$scope.installationFailed = false;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
$scope.wpInstallLoading = true;
$scope.goBackDisable = false;
$scope.errorMessage = response.data.error_message;
$("#installProgress").css("width", "0%");
$scope.installPercentage = "0";
}
}
else{
$("#installProgress").css("width", response.data.installationProgress + "%");
$scope.installPercentage = response.data.installationProgress;
$scope.currentStatus = response.data.currentStatus;
$timeout(getInstallStatus,1000);
}
}
function cantLoadInitialDatas(response) {
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
}
}
$scope.installJoomla = function(){
$scope.installationDetailsFormJoomla = false;
$scope.applicationInstallerLoading = false;
$scope.installationDetailsForm = true;
$scope.installationProgress = false;
$scope.installationFailed = true;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
$scope.wpInstallLoading = false;
$scope.goBackDisable = true;
$scope.currentStatus = "Starting installation..";
var domain = $("#domainNamePage").text();
var path = $scope.installPath;
var sitename = $scope.sitename
var username = $scope.username
var password = $scope.password
var prefix = $scope.prefix
path = $scope.installPath;
url = "/websites/installJoomla";
var home = "1";
if (typeof path != 'undefined'){
if (typeof path !== 'undefined'){
home = "0";
}
@@ -4066,10 +4184,10 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
domain: domain,
home:home,
path:path,
sitename:sitename,
username:username,
password:password,
prefix:prefix,
sitename: $scope.blogTitle,
username: $scope.adminUser,
password: $scope.adminPassword,
prefix: $scope.databasePrefix
};
var config = {
@@ -4083,29 +4201,20 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
function ListInitialDatas(response) {
if (response.data.installStatus == 1)
if (response.data.installStatus === 1)
{
if (typeof path != 'undefined'){
$scope.installationURL = "http://"+domain+"/"+path;
}
else{
$scope.installationURL = domain;
}
$scope.installationDetailsFormJoomla = false;
$scope.applicationInstallerLoading = true;
$scope.installationFailed = true;
$scope.installationSuccessfull = false;
$scope.couldNotConnect = true;
statusFile = response.data.tempStatusPath;
getInstallStatus();
}
else{
$scope.installationDetailsFormJoomla = false;
$scope.applicationInstallerLoading = true;
$scope.installationDetailsForm = true;
$scope.installationProgress = false;
$scope.installationFailed = false;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
$scope.wpInstallLoading = true;
$scope.goBackDisable = false;
$scope.errorMessage = response.data.error_message;
@@ -4115,11 +4224,7 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
}
function cantLoadInitialDatas(response) {
$scope.installationDetailsFormJoomla = false;
$scope.applicationInstallerLoading = true;
$scope.installationFailed = true;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = false;
}