Skip to content

Commit

Permalink
Docker site delete done
Browse files Browse the repository at this point in the history
  • Loading branch information
hassanhashmey committed Dec 21, 2023
1 parent 7baa302 commit af6a5dc
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 33 deletions.
73 changes: 44 additions & 29 deletions websiteFunctions/templates/websiteFunctions/ListDockersite.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,24 @@

<div ng-controller="listDockersite" class="container">

{% if Deleted %}
<div class="alert alert-success" role="alert">
<button aria-label="" class="close" data-dismiss="alert"></button>
<strong>Success: </strong>Website successfully deleted.
</div>
{% endif %}

{% if LPError %}
<div class="alert alert-danger" role="alert">
<button aria-label="" class="close" data-dismiss="alert"></button>
<strong>Error: </strong> {{ LPMessage }}
</div>
{% endif %}

<div id="page-title">
<h2 id="domainNamePage">{% trans "List Docker Site" %}
<a class="pull-right btn btn-primary" href="{% url "CreateDockersite" %}">{% trans "Create Docker Site" %}</a>
<a class="pull-right btn btn-primary"
href="{% url "CreateDockersite" %}">{% trans "Create Docker Site" %}</a>
</h2>
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
<p>{% trans "On this page you can launch, list, modify and delete Dockersite from your server." %}</p>
Expand Down Expand Up @@ -105,37 +120,37 @@ <h2 style="display: inline; color: #414C59;" ng-bind="web.domain"></h2>
</div>
</div>
<div id="deleteDockersite" class="modal fade" role="dialog">
<div class="modal-dialog modal-sm">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
&times;
</button>
<h4 class="modal-title">Delete Package
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</h4>
</div>
<div class="modal-body">

<h4> Are you sure to delete the Docker Site?</h4>

</div>
<div class="modal-footer">
<button type="button"
class="btn btn-default" data-dismiss="modal">
Close
</button>
<button type="button"
class="btn btn-warning" ng-click="ConfirmDelete()">
Delete
</button>
</div>
<div class="modal-dialog modal-sm">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
&times;
</button>
<h4 class="modal-title">Delete Package
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</h4>
</div>
<div class="modal-body">

<h4> Are you sure to delete the Docker Site?</h4>

</div>
<div class="modal-footer">
<button type="button"
class="btn btn-default" data-dismiss="modal">
Close
</button>
<button type="button"
class="btn btn-warning" ng-click="ConfirmDelete()">
Delete
</button>
</div>
</div>
</div>
</div>

<div id="listFail" class="alert alert-danger">
<p>{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}</p>
Expand Down
19 changes: 15 additions & 4 deletions websiteFunctions/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -6846,15 +6846,26 @@ def submitDockerSiteCreation(self, userID=None, data=None):

def ListDockerSites(self, request=None, userID=None, data=None, DeleteID=None):
currentACL = ACLManager.loadedACL(userID)
fdata={}
try:
if DeleteID != None:
DockerSitesDelete = DockerSites.objects.get(pk=DeleteID)
passdata={}
passdata["domain"] = DockerSitesDelete.admin.domain
passdata["JobID"] = None
da = Docker_Sites(None, passdata)
da.DeleteDockerApp()
DockerSitesDelete.delete()
except:
pass
pagination = self.DockersitePagination(currentACL, userID)
fdata['Deleted'] = 1
except BaseException as msg:
fdata['LPError'] = 1
fdata['LPMessage'] = str(msg)


fdata['pagination'] = self.DockersitePagination(currentACL, userID)

proc = httpProc(request, 'websiteFunctions/ListDockersite.html',
{"pagination": pagination})
fdata)
return proc.render()

def fetchDockersite(self, userID=None, data=None):
Expand Down

0 comments on commit af6a5dc

Please sign in to comment.