some improvements to wpmanager

This commit is contained in:
Usman Nasir
2022-06-01 15:49:30 +05:00
parent c008db812a
commit d4306af197
4 changed files with 93 additions and 76 deletions

View File

@@ -1647,7 +1647,7 @@ $parameters = array(
import json
tempStatusPath = self.data['tempStatusPath']
statusFile = open(tempStatusPath, 'w')
statusFile.writelines('Creating Website...')
statusFile.writelines('Creating Website...,10')
statusFile.close()
@@ -1677,7 +1677,7 @@ $parameters = array(
break
elif lastLine.find('[404]') > -1:
statusFile = open(currentTemp, 'w')
statusFile.writelines('Failed to Create Website: error: %s[404]' % lastLine)
statusFile.writelines('Failed to Create Website: error: %s. [404]' % lastLine)
statusFile.close()
return 0
else:
@@ -1687,7 +1687,7 @@ $parameters = array(
time.sleep(2)
statusFile = open(tempStatusPath, 'w')
statusFile.writelines('Installing WordPress....')
statusFile.writelines('Installing WordPress....,30')
statusFile.close()
## Install WordPress

View File

@@ -310,12 +310,14 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $
getCreationStatus();
} else {
// $scope.errorMessage = response.data.error_message;
alert("Status not = 1: Error..." + response.data.error_message)
$scope.goBackDisable = false;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {

View File

@@ -10,24 +10,34 @@
<div class="container">
<div id="page-title">
<h2 id="domainNamePage"><h2>{% trans "Configure Plugins" %}</h2>
<a class="pull-right btn btn-primary" href="{% url "Addnewplugin" %}">{% trans "Add New Plugin" %}</a>
<a class="pull-right btn btn-primary" href="{% url "Addnewplugin" %}">{% trans "Create New Bucket" %}</a>
</h2>
<p>{% trans "You can configure list of plugins that will automatically get installed while deploying WordPress." %}</p>
</div>
<h3>List of Saved Plugins Bucket</h3>
<div ng-controller="listTableUsers" class="panel">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "Plugin Buckets" %} <img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</h3>
<div class="example-box-wrapper">
<!------ List of records --------------->
<table class="table table-hover dataTable no-footer" id="basicTable" role="grid">
<thead style="background-color: #0a6ebd">
<thead>
<tr role="row" class="plans-head">
<th style="color: #fff0ff" class="sorting_desc" tabindex="0"
<th class="sorting_desc" tabindex="0"
aria-controls="basicTable" rowspan="1" colspan="1"
aria-sort="descending"
aria-label="Title: activate to sort column ascending">ID
</th>
<th style="color: #fff0ff" class="sorting" tabindex="0"
<th class="sorting" tabindex="0"
aria-controls="basicTable" rowspan="1" colspan="1"
aria-label="Places: activate to sort column ascending">File name
</th>
<th style="color: #fff0ff" class="sorting" tabindex="0"
<th class="sorting" tabindex="0"
aria-controls="basicTable" rowspan="1" colspan="1"
aria-label="Places: activate to sort column ascending">Action
</th>
@@ -50,7 +60,8 @@
<td class="row">
<div class="col-md-2">
<a href="{% url 'EidtPlugin' %}?ID={{ sub.id }}"
type="button" class="btn btn-border btn-alt border-green btn-link font-green">
type="button"
class="btn btn-border btn-alt border-green btn-link font-green">
Edit
</a>
</div>
@@ -61,7 +72,8 @@
onclick="DeletePluginBuucket('{% url 'ConfigurePlugins' %}?delete={{ sub.id }}')"
data-toggle="modal"
data-target="#DeleteMember" aria-label=""
type="button" class="btn btn-border btn-alt border-red btn-link font-red">
type="button"
class="btn btn-border btn-alt border-red btn-link font-red">
Delete
</button>
@@ -75,6 +87,12 @@
</tbody>
</table>
<!------ List of records --------------->
</div>
</div>
</div>
</div>

View File

@@ -168,8 +168,6 @@ class WebsiteManager:
userobj = Administrator.objects.get(pk=userID)
Selectedplugins = wpplugins.objects.filter(owner = userobj)
#data['Selectedplugins'] = wpplugins.objects.filter(ProjectOwner=HostingCompany)
@@ -1051,7 +1049,6 @@ class WebsiteManager:
extraArgs['home'] = "1"
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
background = ApplicationInstaller('wordpressInstallNew', extraArgs)
background.start()
@@ -2798,7 +2795,7 @@ class WebsiteManager:
return HttpResponse(json_data)
elif lastLine.find('[404]') > -1:
data_ret = {'abort': 1, 'installStatus': 0, 'installationProgress': "0",
'error_message': lastLine}
'error_message': ProcessUtilities.outputExecutioner("cat " + statusFile).splitlines()}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
else: