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

View File

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

View File

@@ -10,70 +10,88 @@
<div class="container"> <div class="container">
<div id="page-title"> <div id="page-title">
<h2 id="domainNamePage"><h2>{% trans "Configure Plugins" %}</h2> <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> </h2>
<p>{% trans "You can configure list of plugins that will automatically get installed while deploying WordPress." %}</p>
</div> </div>
<h3>List of Saved Plugins Bucket</h3> <div ng-controller="listTableUsers" class="panel">
<table class="table table-hover dataTable no-footer" id="basicTable" role="grid"> <div class="panel-body">
<thead style="background-color: #0a6ebd"> <h3 class="content-box-header">
<tr role="row" class="plans-head"> {% trans "Plugin Buckets" %} <img ng-hide="cyberpanelLoading"
<th style="color: #fff0ff" class="sorting_desc" tabindex="0" src="{% static 'images/loading.gif' %}">
aria-controls="basicTable" rowspan="1" colspan="1" </h3>
aria-sort="descending" <div class="example-box-wrapper">
aria-label="Title: activate to sort column ascending">ID
</th>
<th style="color: #fff0ff" 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" <!------ List of records --------------->
aria-controls="basicTable" rowspan="1" colspan="1"
aria-label="Places: activate to sort column ascending">Action <table class="table table-hover dataTable no-footer" id="basicTable" role="grid">
</th> <thead>
<tr role="row" class="plans-head">
<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 class="sorting" tabindex="0"
aria-controls="basicTable" rowspan="1" colspan="1"
aria-label="Places: activate to sort column ascending">File name
</th>
<th class="sorting" tabindex="0"
aria-controls="basicTable" rowspan="1" colspan="1"
aria-label="Places: activate to sort column ascending">Action
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for sub in Selectedplugins %} {% for sub in Selectedplugins %}
<tr role="row" class="odd"> <tr role="row" class="odd">
<td class="v-align-middle sorting_1"> <td class="v-align-middle sorting_1">
<p>{{ sub.id }}</p> <p>{{ sub.id }}</p>
</td> </td>
<td class="v-align-middle"> <td class="v-align-middle">
<p>{{ sub.Name }}</p> <p>{{ sub.Name }}</p>
</td> </td>
<td class="row"> <td class="row">
<div class="col-md-2"> <div class="col-md-2">
<a href="{% url 'EidtPlugin'%}?ID={{sub.id}}" <a href="{% url 'EidtPlugin' %}?ID={{ sub.id }}"
type="button" class="btn btn-border btn-alt border-green btn-link font-green"> type="button"
Edit class="btn btn-border btn-alt border-green btn-link font-green">
</a> Edit
</div> </a>
<div class="col-md-2"> </div>
<div class="col-md-2">
<button <button
onclick="DeletePluginBuucket('{% url 'ConfigurePlugins' %}?delete={{ sub.id }}')" onclick="DeletePluginBuucket('{% url 'ConfigurePlugins' %}?delete={{ sub.id }}')"
data-toggle="modal" data-toggle="modal"
data-target="#DeleteMember" aria-label="" data-target="#DeleteMember" aria-label=""
type="button" class="btn btn-border btn-alt border-red btn-link font-red"> type="button"
Delete class="btn btn-border btn-alt border-red btn-link font-red">
</button> Delete
</button>
</div> </div>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<!------ List of records --------------->
</div>
</div>
</div>
</div> </div>
@@ -81,21 +99,21 @@
<!------------Modal----> <!------------Modal---->
<div class="modal fade stick-up" id="DeleteMember" tabindex="-1"> <div class="modal fade stick-up" id="DeleteMember" tabindex="-1">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Deleting Plugin Bucket</h4> <h4 class="modal-title">Deleting Plugin Bucket</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>Are you sure?</p> <p>Are you sure?</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">No</button> <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
<button type="button" onclick="FinalDeletePluginBuucket()" class="btn btn-primary">Yes</button> <button type="button" onclick="FinalDeletePluginBuucket()" class="btn btn-primary">Yes</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

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