bug fixes

This commit is contained in:
Usman Nasir
2022-06-05 18:34:46 +05:00
parent 2e61794c50
commit db691c432d
4 changed files with 57 additions and 64 deletions

View File

@@ -673,6 +673,7 @@ class ACLManager:
@staticmethod @staticmethod
def checkOwnership(domain, admin, currentACL): def checkOwnership(domain, admin, currentACL):
try: try:
childDomain = ChildDomains.objects.get(domain=domain) childDomain = ChildDomains.objects.get(domain=domain)

View File

@@ -348,6 +348,7 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $
$scope.goBackDisable = true; $scope.goBackDisable = true;
$("#installProgress").css("width", "0%"); $("#installProgress").css("width", "0%");
}; };
function getCreationStatus() { function getCreationStatus() {
url = "/websites/installWordpressStatus"; url = "/websites/installWordpressStatus";
@@ -385,8 +386,7 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $
$scope.currentStatus = response.data.currentStatus; $scope.currentStatus = response.data.currentStatus;
$timeout.cancel(); $timeout.cancel();
} } else {
else {
$scope.webSiteCreationLoading = true; $scope.webSiteCreationLoading = true;
$scope.installationDetailsForm = true; $scope.installationDetailsForm = true;
@@ -433,16 +433,19 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $
}); });
//........... delete wp list //........... delete wp list
var FurlDeleteWP; var FurlDeleteWP;
function DeleteWPNow(url) {
FurlDeleteWP = url; function DeleteWPNow(url) {
FurlDeleteWP = url;
} }
function FinalDeleteWPNow() { function FinalDeleteWPNow() {
window.location.href = FurlDeleteWP; window.location.href = FurlDeleteWP;
} }
app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $window) { app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $window) {
$scope.wordpresshomeloading = true; $scope.wordpresshomeloading = true;
$scope.stagingDetailsForm = false; $scope.stagingDetailsForm = false;
$scope.installationProgress = true; $scope.installationProgress = true;
@@ -501,7 +504,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
} }
} else { } else {
new PNotify({ new PNotify({
title: 'Operation Failed!', title: 'Operation Failed!',
text: response.data.error_message, text: response.data.error_message,
type: 'error' type: 'error'
@@ -587,7 +590,6 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
}; };
$scope.GetCurrentPlugins = function () { $scope.GetCurrentPlugins = function () {
$('#wordpresshomeloading').show(); $('#wordpresshomeloading').show();
@@ -641,7 +643,6 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
}; };
$scope.GetCurrentThemes = function () { $scope.GetCurrentThemes = function () {
$('#wordpresshomeloading').show(); $('#wordpresshomeloading').show();
@@ -1032,7 +1033,6 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
}; };
function AddThemes(value, index, array) { function AddThemes(value, index, array) {
var FinalMarkup = '<tr>' var FinalMarkup = '<tr>'
FinalMarkup = FinalMarkup + '<td><input onclick="AddThemeToArray(this,\'' + value.name + '\')" type="checkbox" id="' + value.name + '"><label for="' + value.name + '"></label></td>'; FinalMarkup = FinalMarkup + '<td><input onclick="AddThemeToArray(this,\'' + value.name + '\')" type="checkbox" id="' + value.name + '"><label for="' + value.name + '"></label></td>';
@@ -1062,20 +1062,20 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
$scope.CreateStagingNow = function () { $scope.CreateStagingNow = function () {
$('#wordpresshomeloading').show(); $('#wordpresshomeloading').show();
$scope.wordpresshomeloading = false; $scope.wordpresshomeloading = false;
$scope.stagingDetailsForm = true; $scope.stagingDetailsForm = true;
$scope.installationProgress = false; $scope.installationProgress = false;
$scope.errorMessageBox = true; $scope.errorMessageBox = true;
$scope.success = true; $scope.success = true;
$scope.couldNotConnect = true; $scope.couldNotConnect = true;
$scope.goBackDisable = true; $scope.goBackDisable = true;
$scope.currentStatus = "Starting creation Staging.."; $scope.currentStatus = "Starting creation Staging..";
var data = { var data = {
StagingName: $('#stagingName').val(), StagingName: $('#stagingName').val(),
StagingDomain: $('#stagingDomain').val(), StagingDomain: $('#stagingDomain').val(),
WPid: $('#WPid').html(), WPid: $('#WPid').html(),
} }
var url = "/websites/CreateStagingNow"; var url = "/websites/CreateStagingNow";
@@ -1092,7 +1092,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
function ListInitialDatas(response) { function ListInitialDatas(response) {
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
if (response.data.status === 1) { if (response.data.status === 1) {
statusFile = response.data.tempStatusPath; statusFile = response.data.tempStatusPath;
getCreationStatus(); getCreationStatus();
} else { } else {
new PNotify({ new PNotify({
@@ -1182,7 +1182,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
} }
function cantLoadInitialDatas(response) { function cantLoadInitialDatas(response) {
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
$scope.wordpresshomeloading = true; $scope.wordpresshomeloading = true;
$scope.stagingDetailsForm = true; $scope.stagingDetailsForm = true;
$scope.installationProgress = false; $scope.installationProgress = false;
@@ -1197,7 +1197,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
} }
$scope.goBack = function () { $scope.goBack = function () {
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
$scope.wordpresshomeloading = true; $scope.wordpresshomeloading = true;
$scope.stagingDetailsForm = false; $scope.stagingDetailsForm = false;
$scope.installationProgress = true; $scope.installationProgress = true;
@@ -1209,7 +1209,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
}; };
$scope.fetchstaging = function () { $scope.fetchstaging = function () {
$('#wordpresshomeloading').show(); $('#wordpresshomeloading').show();
$scope.wordpresshomeloading = false; $scope.wordpresshomeloading = false;
var url = "/websites/fetchstaging"; var url = "/websites/fetchstaging";
@@ -1230,7 +1230,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
function ListInitialDatas(response) { function ListInitialDatas(response) {
wordpresshomeloading = true; wordpresshomeloading = true;
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
if (response.data.status === 1) { if (response.data.status === 1) {
@@ -1250,23 +1250,15 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
} }
function cantLoadInitialDatas(response) { function cantLoadInitialDatas(response) {
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
alert("Error"+response) alert("Error" + response)
} }
}; };
$scope.SaveUpdateConfig = function () {
$scope.autoLogin = function () { $('#wordpresshomeloading').show();
var url = "/websites/DeleteThemes";
//window.open("/wpmanager/" + $('#HostingCompanyID').html() + "/manage/" + server + "/" + wordpress + "/AutoLogin");
var WPid = $('#WPid').html();
window.open("/websites/AutoLogin?WordPressID="+sub.id);
}
$scope.SaveUpdateConfig =function () {
$('#wordpresshomeloading').show();
var data = { var data = {
AutomaticUpdates: $('#AutomaticUpdates').find(":selected").text(), AutomaticUpdates: $('#AutomaticUpdates').find(":selected").text(),
Plugins: $('#Plugins').find(":selected").text(), Plugins: $('#Plugins').find(":selected").text(),
@@ -1289,7 +1281,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
function ListInitialDatas(response) { function ListInitialDatas(response) {
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
$scope.wordpresshomeloading = true; $scope.wordpresshomeloading = true;
if (response.data.status === 1) { if (response.data.status === 1) {
@@ -1298,7 +1290,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
text: 'Update Configurations Sucessfully!.', text: 'Update Configurations Sucessfully!.',
type: 'success' type: 'success'
}); });
$("#autoUpdateConfig").modal('hide'); $("#autoUpdateConfig").modal('hide');
} else { } else {
new PNotify({ new PNotify({
title: 'Operation Failed!', title: 'Operation Failed!',
@@ -1311,18 +1303,27 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
} }
function cantLoadInitialDatas(response) { function cantLoadInitialDatas(response) {
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
new PNotify({ new PNotify({
title: 'Operation Failed!', title: 'Operation Failed!',
text: response, text: response,
type: 'error' type: 'error'
}); });
} }
}; };
var DeploytoProductionID;
function DeployToProductionInitial(vall) {
DeploytoProductionID = vall;
}
function FinalDeployToProduction() {
alert($('#WPid').html());
alert(DeploytoProductionID);
return 0;
FinalDeployToProduction = function () {
$('#wordpresshomeloading').show(); $('#wordpresshomeloading').show();
$('#DeployToProduction').modal('hide'); $('#DeployToProduction').modal('hide');
var data = { var data = {
@@ -1343,7 +1344,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
function ListInitialDatas(response) { function ListInitialDatas(response) {
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
if (response.data.status === 1) { if (response.data.status === 1) {
new PNotify({ new PNotify({
title: 'Success!', title: 'Success!',
@@ -1365,29 +1366,25 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
} }
function cantLoadInitialDatas(response) { function cantLoadInitialDatas(response) {
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
new PNotify({ new PNotify({
title: 'Operation Failed!', title: 'Operation Failed!',
text: response, text: response,
type: 'error' type: 'error'
}); });
} }
}; }
}); });
var DeploytoProductionID;
function DeployToProductionInitial(vall){
DeploytoProductionID=vall;
}
function AddStagings(value, index, array) { function AddStagings(value, index, array) {
var FinalMarkup = '<tr>' var FinalMarkup = '<tr>'
for (let x in value) { for (let x in value) {
if (x === 'name') { if (x === 'name') {
FinalMarkup = FinalMarkup + '<td><a href="' + value.url + '">' + value[x] + '</a></td>'; FinalMarkup = FinalMarkup + '<td><a href=/websites/WPHome?ID=' + value.id + '>' + value[x] + '</a></td>';
} else if (x !== 'url' && x !== 'deleteURL' && x !== 'id') { } else if (x !== 'url' && x !== 'deleteURL' && x !== 'id') {
FinalMarkup = FinalMarkup + '<td>' + value[x] + "</td>"; FinalMarkup = FinalMarkup + '<td>' + value[x] + "</td>";
} }

View File

@@ -304,7 +304,7 @@
<i class="glyph-icon icon-arrow-right"></i> <i class="glyph-icon icon-arrow-right"></i>
</button> </button>
</div> </div>
<div ng-hide="installationProgress" class="form-group"> <div style="margin-top: 1%" ng-hide="installationProgress" class="form-group">
<label class="col-sm-2 control-label"></label> <label class="col-sm-2 control-label"></label>
<div class="col-sm-7"> <div class="col-sm-7">

View File

@@ -672,11 +672,6 @@ class WebsiteManager:
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999)) extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
if ACLManager.checkOwnership(wpsite.owner.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadError()
background = ApplicationInstaller('CreateStagingNow', extraArgs) background = ApplicationInstaller('CreateStagingNow', extraArgs)
background.start() background.start()