mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-06 21:07:56 +02:00
restart fun and stop function added
This commit is contained in:
@@ -35,4 +35,6 @@ urlpatterns = [
|
||||
path('getContainerAppinfo', views.getContainerAppinfo, name='getContainerAppinfo'),
|
||||
path('getContainerApplog', views.getContainerApplog, name='getContainerApplog'),
|
||||
path('recreateappcontainer', views.recreateappcontainer, name='recreateappcontainer'),
|
||||
path('RestartContainerAPP', views.RestartContainerAPP, name='RestartContainerAPP'),
|
||||
path('StopContainerAPP', views.StopContainerAPP, name='StopContainerAPP'),
|
||||
]
|
||||
@@ -494,6 +494,44 @@ def recreateappcontainer(request):
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.recreateappcontainer(userID, json.loads(request.body))
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def RestartContainerAPP(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
if currentACL['admin'] == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.RestartContainerAPP(userID, json.loads(request.body))
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def StopContainerAPP(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
if currentACL['admin'] == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.StopContainerAPP(userID, json.loads(request.body))
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
Reference in New Issue
Block a user