ServerStatus
This commit is contained in:
parent
a50ec75a2d
commit
7afb36764e
|
|
@ -0,0 +1,167 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
<head>
|
||||
<title>{% trans "File Manager - CyberPanel" %}</title>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
{% load static %}
|
||||
<link rel="icon" type="image/png" href="{% static 'baseTemplate/assets/finalBase/favicon.png' %}">
|
||||
|
||||
<!-- Angular JS -->
|
||||
|
||||
<script src="https://code.angularjs.org/1.6.5/angular.min.js"></script>
|
||||
<script src="{% static 'filemanager/js/fileManager.js' %}"></script>
|
||||
|
||||
<!-- Fix for old browsers -->
|
||||
<script src="{% static 'filemanager/js/es5-shim.min.js' %}"></script>
|
||||
<script src="{% static 'filemanager/js/es5-sham.min.js' %}"></script>
|
||||
<script src="{% static 'filemanager/js/jquery-1.8.3.min.js' %}"></script>
|
||||
<script src="{% static 'filemanager/js/console-sham.js' %}"></script>
|
||||
|
||||
<!--<script src="../bower_components/angular/angular.js"></script>-->
|
||||
<script src="{% static 'filemanager/js/angular-file-upload.min.js' %}"></script>
|
||||
|
||||
|
||||
<!-- HTML Editor Include -->
|
||||
|
||||
</head>
|
||||
|
||||
<div ng-app="fileManager" ng-controller="fileManagerCtrl" class="p-8">
|
||||
<div class="flex py-2 px-6 items-center gap-4">
|
||||
<div>
|
||||
<p class="font-bold w-32">Current Path</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" id="currentRPath" ng-model="currentRPath"
|
||||
readonly>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="flex text-orange-500">
|
||||
<a href="#" onclick="return false;" ng-click="fetchChilds($event,currentRPath,'primary')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/>
|
||||
</svg>
|
||||
</a>
|
||||
<a onclick="return false;"
|
||||
ng-click="fetchForTableSecondary($event,'fromTree',completeStartingPath)" href="#">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/>
|
||||
</svg>
|
||||
</a>
|
||||
<a href="" class="ml-2">{$ startingPath $}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-4">
|
||||
<div>
|
||||
<ul class="flex justify-between bg-blue-200 py-5 px-5 rounded-lg shadow-lg font-semibold">
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="showUploadBox()" class="nav-link point-events" href="#"><i
|
||||
class="fa fa-upload" aria-hidden="true"></i> {% trans "Upload" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="showCreateFileModal()" class="nav-link point-events"
|
||||
href="#"><i class="fa fa-plus-square" aria-hidden="true"></i> {% trans "New File" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="showCreateFolderModal()" class="nav-link point-events"
|
||||
href="#"><i class="fa fa-folder" aria-hidden="true"></i> {% trans "New Folder" %}</a>
|
||||
</li>
|
||||
<li id="deleteFile">
|
||||
<a onclick="return false;" ng-click="showDeleteModal()" class="nav-link point-events"
|
||||
href="#"><i
|
||||
class="fa fa-trash-o" aria-hidden="true"></i> {% trans "Delete" %}</a>
|
||||
</li>
|
||||
<li id="copyFile">
|
||||
<a onclick="return false;" ng-click="showCopyModal()" class="nav-link point-events" href="#"><i
|
||||
class="fa fa-files-o" aria-hidden="true"></i> {% trans "Copy" %}</a>
|
||||
</li>
|
||||
<li id="moveFile">
|
||||
<a onclick="return false;" ng-click="showMoveModal()" class="nav-link point-events" href="#"><i
|
||||
class="fa fa-arrows-alt" aria-hidden="true"></i> {% trans "Move" %}</a>
|
||||
</li>
|
||||
<li id="renameFile">
|
||||
<a onclick="return false;" ng-click="showRenameModal()" class="nav-link point-events"
|
||||
href="#"><i
|
||||
class="fa fa-file-text-o" aria-hidden="true"></i> {% trans "Rename" %}</a>
|
||||
</li>
|
||||
<li id="editFile">
|
||||
<a onclick="return false;" ng-click="showHTMLEditorModal()" class="nav-link point-events"
|
||||
href="#"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {% trans "Edit" %}</a>
|
||||
</li>
|
||||
<li id="compressFile">
|
||||
<a onclick="return false;" ng-click="showCompressionModal()" class="nav-link point-events"
|
||||
href="#"><i
|
||||
class="fa fa-compress" aria-hidden="true"></i> {% trans "Compress" %}</a>
|
||||
</li>
|
||||
<li id="extractFile">
|
||||
<a onclick="return false;" ng-click="showExtractionModal()" class="nav-link point-events"
|
||||
href="#"><i class="fa fa-expand" aria-hidden="true"></i> {% trans "Extract" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<ul class="flex py-5 px-5 gap-10 font-semibold">
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="fetchForTableSecondary($event,'homeFetch')"
|
||||
href="#"><i class="fa fa-home fa-lg" aria-hidden="true"></i> {% trans "Home" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="fetchForTableSecondary($event,'goBackOnPath')"
|
||||
href="#"><i class="fa fa-arrow-left fa-lg"
|
||||
aria-hidden="true"></i> {% trans "Back" %}</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="fetchForTableSecondary($event,'refresh')"
|
||||
href="#"><i class="fa fa-refresh fa-lg" aria-hidden="true"></i> {% trans "Refresh" %}</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="selectAll()" href="#"><i
|
||||
class="fa fa-check-square-o fa-lg" aria-hidden="true"></i> {% trans "Select All" %}</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="unSelectAll()" href="#"><i
|
||||
class="fa fa-square-o fa-lg" aria-hidden="true"></i> {% trans "UnSelect All" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead id="tableHead">
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
File Name
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Size (KB)
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Last Modified
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Permissions
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tableBodyFiles">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -3,61 +3,77 @@
|
|||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
<head>
|
||||
<title>{% trans "File Manager - CyberPanel" %}</title>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{# <head>#}
|
||||
{# <title>{% trans "File Manager - CyberPanel" %}</title>#}
|
||||
{# <!-- Required meta tags -->#}
|
||||
{# <meta charset="utf-8">#}
|
||||
{# <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">#}
|
||||
{##}
|
||||
{# {% load static %}#}
|
||||
{# <link rel="icon" type="image/png" href="{% static 'baseTemplate/assets/finalBase/favicon.png' %}">#}
|
||||
{##}
|
||||
{# <!-- Angular JS -->#}
|
||||
{##}
|
||||
{##}
|
||||
{# <!-- Fix for old browsers -->#}
|
||||
{# <script src="{% static 'filemanager/js/es5-shim.min.js' %}"></script>#}
|
||||
{# <script src="{% static 'filemanager/js/es5-sham.min.js' %}"></script>#}
|
||||
{# <script src="{% static 'filemanager/js/jquery-1.8.3.min.js' %}"></script>#}
|
||||
{# <script src="{% static 'filemanager/js/console-sham.js' %}"></script>#}
|
||||
{##}
|
||||
{# <!--<script src="../bower_components/angular/angular.js"></script>-->#}
|
||||
{# <script src="{% static 'filemanager/js/angular-file-upload.min.js' %}"></script>#}
|
||||
{##}
|
||||
{##}
|
||||
{# <!-- HTML Editor Include -->#}
|
||||
{##}
|
||||
{# </head>#}
|
||||
|
||||
{% load static %}
|
||||
<link rel="icon" type="image/png" href="{% static 'baseTemplate/assets/finalBase/favicon.png' %}">
|
||||
<script src="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.0/build/alertify.min.js"></script>
|
||||
|
||||
<!-- Angular JS -->
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.0/build/css/alertify.min.css"/>
|
||||
<!-- Default theme -->
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.0/build/css/themes/default.min.css"/>
|
||||
<!-- Semantic UI theme -->
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.0/build/css/themes/semantic.min.css"/>
|
||||
<!-- Bootstrap theme -->
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.0/build/css/themes/bootstrap.min.css"/>
|
||||
|
||||
<script src="https://code.angularjs.org/1.6.5/angular.min.js"></script>
|
||||
<script src="{% static 'filemanager/js/fileManager.js' %}"></script>
|
||||
<div ng-controller="fileManagerCtrlV2" class="p-8">
|
||||
|
||||
<!-- Fix for old browsers -->
|
||||
<script src="{% static 'filemanager/js/es5-shim.min.js' %}"></script>
|
||||
<script src="{% static 'filemanager/js/es5-sham.min.js' %}"></script>
|
||||
<script src="{% static 'filemanager/js/jquery-1.8.3.min.js' %}"></script>
|
||||
<script src="{% static 'filemanager/js/console-sham.js' %}"></script>
|
||||
<div style="display: none">
|
||||
<a href="/websites/{{ domainName }}">
|
||||
<span id="domainNameInitial">{{ domainName }}</span></a>
|
||||
</div>
|
||||
|
||||
<!--<script src="../bower_components/angular/angular.js"></script>-->
|
||||
<script src="{% static 'filemanager/js/angular-file-upload.min.js' %}"></script>
|
||||
|
||||
|
||||
<!-- HTML Editor Include -->
|
||||
|
||||
</head>
|
||||
|
||||
<div ng-app="fileManager" ng-controller="fileManagerCtrl" class="p-8">
|
||||
<div class="flex py-2 px-6 items-center gap-4">
|
||||
<div id="treeView" class="flex py-2 px-6 items-center gap-4">
|
||||
<div>
|
||||
<p class="font-bold w-32">Current Path</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" id="currentRPath" ng-model="currentRPath"
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" id="currentPath" ng-model="currentPath"
|
||||
readonly>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="flex text-orange-500">
|
||||
<a href="#" onclick="return false;" ng-click="fetchChilds($event,currentRPath,'primary')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/>
|
||||
</svg>
|
||||
<li class="flex text-orange-500 items-center">
|
||||
<a class="mb-2 mr-1" href="#" onclick="return false;"
|
||||
ng-click="fetchChilds($event,completeStartingPath,'primary')">
|
||||
<i class="font-bold text-3xl">+</i>
|
||||
</a>
|
||||
<a onclick="return false;"
|
||||
ng-click="fetchForTableSecondary($event,'fromTree',completeStartingPath)" href="#">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/>
|
||||
</svg>
|
||||
<div class="flex">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/>
|
||||
</svg>
|
||||
<span class="ml-2">{$ startingPath $}</span>
|
||||
</div>
|
||||
</a>
|
||||
<a href="" class="ml-2">{$ startingPath $}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -65,49 +81,670 @@
|
|||
<div class="py-4">
|
||||
<div>
|
||||
<ul class="flex justify-between bg-blue-200 py-5 px-5 rounded-lg shadow-lg font-semibold">
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="showUploadBox()" class="nav-link point-events" href="#"><i
|
||||
class="fa fa-upload" aria-hidden="true"></i> {% trans "Upload" %}</a>
|
||||
<li id="uploadBox" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter">
|
||||
<a class="cursor-pointer" onclick="return false;"
|
||||
ng-click="showUploadBox()"
|
||||
data-modal-target="upload"
|
||||
data-modal-toggle="upload"> {% trans "Upload" %}</a>
|
||||
<div id="upload" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-2 py-4">
|
||||
<button type="button" data-modal-toggle="upload"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="upload">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
<h5 class="text-2xl font-bold">Upload File -</h5>
|
||||
|
||||
<a class="text-white text-md"
|
||||
target="_blank"
|
||||
href="https://go.cyberpanel.net/upload-limits"
|
||||
title="">{% trans " Upload Limits" %}</a>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div class="mt-4">
|
||||
<h3 class="text-xl">{% trans "Upload queue" %}</h3>
|
||||
<p>{% trans "Queue length:" %} {$ uploader.queue.length $}</p>
|
||||
<div>
|
||||
<div class="border border-4 border-dotted px-4 py-4" nv-file-over=""
|
||||
uploader="uploader">
|
||||
<div>
|
||||
<h4 class="font-bold">{% trans "Drop" %}</h4>
|
||||
<p class="text-sm">{% trans "Drop Files here to upload them." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div>
|
||||
<label class="text-xl"
|
||||
for="uploadControlMultiple">{% trans "Upload" %}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" nv-file-select="" uploader="uploader"
|
||||
class="form-control-file" id="uploadControlMultiple"
|
||||
multiple>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Size
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Progress
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Status
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Actions
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="item in uploader.queue"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
<strong>{$ item.file.name $}</strong>
|
||||
</td>
|
||||
<td ng-show="uploader.isHTML5" nowrap class="px-6 py-4">
|
||||
{$ item.file.size / 1024 / 1024 | number:2 $} MB
|
||||
</td>
|
||||
<td ng-show="uploader.isHTML5" class="px-6 py-4">
|
||||
<div class="w-full bg-gray-100 rounded-full">
|
||||
<div id="installProgress"
|
||||
ng-style="{ 'width': item.progress + '%' }"
|
||||
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
|
||||
style="width:0%">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="flex justify-center px-6 py-4">
|
||||
<span ng-show="item.isSuccess"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
|
||||
</svg>
|
||||
</span>
|
||||
<span ng-show="item.isCancel"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"/>
|
||||
</svg>
|
||||
</span>
|
||||
<span ng-show="item.isError"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>
|
||||
</svg>
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<div class="flex items-center gap-1">
|
||||
<button type="button"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 font-medium rounded-lg text-sm inline-flex items-center px-1 py-1 text-center"
|
||||
ng-click="item.upload()"
|
||||
ng-disabled="item.isReady || item.isUploading || item.isSuccess">
|
||||
<i class="fa fa-upload"
|
||||
aria-hidden="true"></i> {% trans "Upload" %}
|
||||
</button>
|
||||
<button type="button"
|
||||
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-1 py-1 hover:text-gray-900 focus:z-10"
|
||||
ng-click="item.cancel()"
|
||||
ng-disabled="!item.isUploading">
|
||||
<i class="fa fa-ban"
|
||||
aria-hidden="true"></i> {% trans "Cancel" %}
|
||||
</button>
|
||||
<button type="button"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-1 py-1 text-center"
|
||||
ng-click="item.remove()">
|
||||
<i class="fa fa-trash"
|
||||
aria-hidden="true"></i> {% trans "Remove" %}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<div id="queueProg">
|
||||
{% trans "Queue progress:" %}
|
||||
<div class="w-full bg-gray-100 rounded-full">
|
||||
<div id="installProgress"
|
||||
ng-style="{ 'width': uploader.progress + '%' }"
|
||||
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
|
||||
style="width:0%">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="errorMessage"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold"
|
||||
role="alert">
|
||||
{$ fileName $} {% trans "can not be uploaded, Error message:" %}
|
||||
{$ error_message $}
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2 justify-center mt-4">
|
||||
<button type="button"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
ng-click="uploader.uploadAll()"
|
||||
ng-disabled="!uploader.getNotUploadedItems().length">
|
||||
<i class="fa fa-upload"
|
||||
aria-hidden="true"></i> {% trans "Upload all" %}
|
||||
</button>
|
||||
<button type="button"
|
||||
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"
|
||||
ng-click="uploader.cancelAll()"
|
||||
ng-disabled="!uploader.isUploading">
|
||||
<i class="fa fa-ban"
|
||||
aria-hidden="true"></i> {% trans "Cancel all" %}
|
||||
</button>
|
||||
<button type="button"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
ng-click="uploader.clearQueue()"
|
||||
ng-disabled="!uploader.queue.length">
|
||||
<i class="fa fa-trash"
|
||||
aria-hidden="true"></i> {% trans "Remove all" %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="showCreateFileModal()" class="nav-link point-events"
|
||||
href="#"><i class="fa fa-plus-square" aria-hidden="true"></i> {% trans "New File" %}</a>
|
||||
<li id="showCreateFile">
|
||||
<a onclick="return false;"
|
||||
ng-click="showCreateFileModal()"
|
||||
class="nav-link point-events"
|
||||
href="#" data-modal-target="newfile" data-modal-toggle="newfile"><i class="fa fa-plus-square"
|
||||
aria-hidden="true"></i> {% trans "New File" %}
|
||||
</a>
|
||||
<div id="newfile" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">Create New File</p>
|
||||
<button type="button" data-modal-toggle="newfile"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="newfile">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div>
|
||||
<div>
|
||||
<label>{% trans "New File Name" %}</label>
|
||||
<input ng-keypress="createFileEnter($event)" ng-model="newFileName"
|
||||
type="text" class="w-full bg-gray-100 rounded px-2 py-1">
|
||||
</div>
|
||||
<small class="form-text text-muted">{% trans "File will be created in your current directory, if it already exists it will not overwirte." %}</small>
|
||||
<div class="flex justify-center mt-3">
|
||||
<button type="button" ng-click="createNewFile()"
|
||||
data-modal-toggle="newfile" data-modal-hide="newfile"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1 text-xl">{% trans "Create File" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
<div ng-hide="errorMessageFile"
|
||||
class="flex justify-center bg-red-500 text-white px-2 py-1 font-semibold"
|
||||
role="alert">
|
||||
{$error_message$}
|
||||
</div>
|
||||
<div ng-hide="createSuccess"
|
||||
class="flex justify-center bg-green-500 px-2 py-1 font-semibold"
|
||||
role="alert">
|
||||
{% trans "File Successfully created." %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a onclick="return false;" ng-click="showCreateFolderModal()" class="nav-link point-events"
|
||||
href="#"><i class="fa fa-folder" aria-hidden="true"></i> {% trans "New Folder" %}</a>
|
||||
<li id="showCreateFolder">
|
||||
<a onclick="return false;"
|
||||
ng-click="showCreateFolderModal()"
|
||||
class="nav-link point-events"
|
||||
href="#" data-modal-target="newfolder" data-modal-toggle="newfolder"><i class="fa fa-folder"
|
||||
aria-hidden="true"></i> {% trans "New Folder" %}
|
||||
</a>
|
||||
<div id="newfolder" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">Create New Folder</p>
|
||||
<button type="button" data-modal-toggle="newfolder"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="newfolder">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div>
|
||||
<div>
|
||||
<label class="w-80">{% trans "New File Name" %}</label>
|
||||
<input ng-keypress="createFolderEnter($event)" ng-model="newFolderName"
|
||||
type="text" class="w-full bg-gray-100 rounded px-2 py-1">
|
||||
</div>
|
||||
<small class="form-text text-muted">{% trans "Folder will be created in your current directory" %}</small>
|
||||
<div class="flex justify-center mt-3">
|
||||
<button type="button" ng-click="createNewFolder()"
|
||||
data-modal-toggle="newfolder" data-modal-hide="newfolder"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1 text-xl">{% trans "Create Folder" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div ng-hide="errorMessageFolder"
|
||||
class="flex justify-center bg-red-500 text-white px-2 py-1 font-semibold"
|
||||
role="alert">
|
||||
{$error_message$}
|
||||
</div>
|
||||
<div ng-hide="createSuccess"
|
||||
class="flex justify-center bg-green-500 px-2 py-1 font-semibold"
|
||||
role="alert">
|
||||
{% trans "Folder Successfully created." %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="deleteFile">
|
||||
<a onclick="return false;" ng-click="showDeleteModal()" class="nav-link point-events"
|
||||
href="#"><i
|
||||
<a onclick="return false;"
|
||||
ng-click="showDeleteModal()"
|
||||
class="nav-link point-events"
|
||||
href="#" data-modal-target="delete" data-modal-toggle="delete"><i
|
||||
class="fa fa-trash-o" aria-hidden="true"></i> {% trans "Delete" %}</a>
|
||||
<div id="delete" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">Confirm Deletion !</p>
|
||||
<button type="button" data-modal-toggle="delete"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="delete">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div>
|
||||
<div>
|
||||
<input ng-model="skipTrash" type="checkbox" value=""> Skip Trash Folder
|
||||
</div>
|
||||
<small class="form-text text-muted">{% trans "Skip trash and permanently delete this file." %}</small>
|
||||
<p class="mt-3">Are you sure ?</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button ng-click="deleteFolderOrFile()" type="button" data-modal-toggle="delete"
|
||||
data-modal-hide="delete"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Confirm" %}</button>
|
||||
<button type="button" data-modal-toggle="delete" data-modal-hide="delete"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-dismiss="modal">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="copyFile">
|
||||
<a onclick="return false;" ng-click="showCopyModal()" class="nav-link point-events" href="#"><i
|
||||
<li id="">
|
||||
<a onclick="return false;"
|
||||
ng-click="showCopyModal()"
|
||||
class="nav-link point-events" href="#"
|
||||
data-modal-target="copy" data-modal-toggle="copy"><i
|
||||
class="fa fa-files-o" aria-hidden="true"></i> {% trans "Copy" %}</a>
|
||||
<div id="copy" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">Copy Files</p>
|
||||
<button type="button" data-modal-toggle="copy"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="copy">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<p>List of files/folders !</p>
|
||||
<textarea ng-model="listOfFiles" class="w-full border" rows="3"></textarea>
|
||||
<p>Copy to</p>
|
||||
<input ng-model="pathToCopyTo" class="w-full bg-gray-100 rounded px-2 py-1"
|
||||
type="text">
|
||||
<small class="form-text text-muted">{% trans "Enter a path to copy your files to!" %}</small>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button ng-click="startCopying()" type="button" data-modal-toggle="copy"
|
||||
data-modal-hide="copy"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Copy" %}</button>
|
||||
<button type="button" data-modal-toggle="copy" data-modal-hide="copy"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-dismiss="modal">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="moveFile">
|
||||
<a onclick="return false;" ng-click="showMoveModal()" class="nav-link point-events" href="#"><i
|
||||
<li id="">
|
||||
<a onclick="return false;"
|
||||
ng-click="showMoveModal()"
|
||||
class="nav-link point-events" href="#"
|
||||
data-modal-target="move" data-modal-toggle="move"><i
|
||||
class="fa fa-arrows-alt" aria-hidden="true"></i> {% trans "Move" %}</a>
|
||||
<div id="move" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">Move Files</p>
|
||||
<button type="button" data-modal-toggle="move"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="move">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<p>List of files/folders !</p>
|
||||
<textarea ng-model="listOfFiles" class="w-full border" rows="3"></textarea>
|
||||
<p>Move to</p>
|
||||
<input ng-model="pathToMoveTo" type="text"
|
||||
class="w-full bg-gray-100 rounded px-2 py-1">
|
||||
<small class="form-text text-muted">{% trans "Enter a path to move your files!" %}</small>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button ng-click="startMoving()" type="button" data-modal-toggle="move"
|
||||
data-modal-hide="move"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Move" %}</button>
|
||||
<button type="button" data-modal-toggle="move" data-modal-hide="move"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-dismiss="modal">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="renameFile">
|
||||
<a onclick="return false;" ng-click="showRenameModal()" class="nav-link point-events"
|
||||
href="#"><i
|
||||
<li id="">
|
||||
<a onclick="return false;"
|
||||
ng-click="showRenameModal()"
|
||||
class="nav-link point-events"
|
||||
href="#" data-modal-target="rename" data-modal-toggle="rename"><i
|
||||
class="fa fa-file-text-o" aria-hidden="true"></i> {% trans "Rename" %}</a>
|
||||
<div id="rename" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">{% trans "Renaming" %} {$ fileToRename $}</p>
|
||||
<button type="button" data-modal-toggle="rename"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="rename">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div>
|
||||
<label>{% trans "New Name" %}</label>
|
||||
<input ng-keypress="renameEnter($event)" ng-model="newFileName" type="text"
|
||||
class="w-full bg-gray-100 rounded px-2 py-1">
|
||||
<small class="form-text text-muted">{% trans "Enter new name of file!" %}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button ng-click="renameFile()" type="button" data-modal-toggle="rename"
|
||||
data-modal-hide="rename"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Rename" %}</button>
|
||||
<button type="button"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-modal-toggle="rename"
|
||||
data-modal-hide="rename">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="editFile">
|
||||
<a onclick="return false;" ng-click="showHTMLEditorModal()" class="nav-link point-events"
|
||||
href="#"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {% trans "Edit" %}</a>
|
||||
<a onclick="return false;"
|
||||
ng-click="showHTMLEditorModal(1)"
|
||||
class="nav-link point-events"
|
||||
href="#" data-modal-target="edit" data-modal-toggle="edit"><i
|
||||
class="fa fa-pencil-square-o" aria-hidden="true"></i> {% trans "Edit" %}</a>
|
||||
<div id="edit" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">{$fileInEditor$} - HTML Editor</p>
|
||||
<button type="button" data-modal-toggle="edit"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="edit">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div>
|
||||
<div id="htmlEditorContent" style="height: 300px;">
|
||||
<!-- Set a height for the editor -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div id="htmlEditorStyles" class="row">
|
||||
<div class="col-sm-12">
|
||||
<div ng-hide="errorMessageEditor"
|
||||
class="flex justify-center bg-red-500 text-white px-2 py-1 font-semibold"
|
||||
role="alert">
|
||||
{$error_message$}
|
||||
</div>
|
||||
<div ng-hide="saveSuccess"
|
||||
class="flex justify-center bg-green-500 px-2 py-1 font-semibold"
|
||||
role="alert">
|
||||
{% trans "File Successfully saved." %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end py-3 px-3">
|
||||
<button ng-click="putFileContents()" type="button"
|
||||
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1 text-xl">
|
||||
<i class="fa" aria-hidden="true"></i> {% trans "Save Changes" %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="compressFile">
|
||||
<a onclick="return false;" ng-click="showCompressionModal()" class="nav-link point-events"
|
||||
href="#"><i
|
||||
<a onclick="return false;"
|
||||
ng-click="showCompressionModal()"
|
||||
class="nav-link point-events"
|
||||
href="#" data-modal-target="compress" data-modal-toggle="compress"><i
|
||||
class="fa fa-compress" aria-hidden="true"></i> {% trans "Compress" %}</a>
|
||||
<div id="compress" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">Compress</p>
|
||||
<button type="button" data-modal-toggle="compress"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="compress">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<p>List of files/folders !</p>
|
||||
<textarea ng-model="listOfFiles" class="w-full border"
|
||||
rows="3"></textarea>
|
||||
<p>Compressed File Name</p>
|
||||
<input ng-model="compressedFileName" type="text"
|
||||
class="w-full bg-gray-100 rounded px-2 py-1">
|
||||
<small class="form-text text-muted">{% trans "Enter without extension name!" %}</small>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<label>{% trans "Compression Type" %}</label>
|
||||
<select ng-model="compressionType" class="w-full bg-gray-100 rounded px-2 py-1">
|
||||
<option>zip</option>
|
||||
<option>tar.gz</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<div>
|
||||
<button ng-click="startCompression()" type="button"
|
||||
data-modal-toggle="compress" data-modal-hide="compress"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Compress" %}</button>
|
||||
<button type="button" data-modal-toggle="compress"
|
||||
data-modal-hide="compress"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-dismiss="modal">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="extractFile">
|
||||
<a onclick="return false;" ng-click="showExtractionModal()" class="nav-link point-events"
|
||||
href="#"><i class="fa fa-expand" aria-hidden="true"></i> {% trans "Extract" %}</a>
|
||||
<a onclick="return false;"
|
||||
ng-click="showExtractionModal()"
|
||||
class="nav-link point-events"
|
||||
href="#" data-modal-target="extract" data-modal-toggle="extract"><i class="fa fa-expand"
|
||||
aria-hidden="true"></i> {% trans "Extract" %}
|
||||
</a>
|
||||
<div id="extract" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">{% trans "Extracting" %} {$ fileToBeExtracted $}</p>
|
||||
<button type="button" data-modal-toggle="extract"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="extract">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<p>Extract in</p>
|
||||
<input ng-model="extractionLocation" type="text"
|
||||
class="w-full bg-gray-100 rounded px-2 py-1">
|
||||
<small class="form-text text-muted">{% trans "You can enter . to extract in current directory!" %}</small>
|
||||
</div>
|
||||
<div class="flex justify-center py-2">
|
||||
<button type="button" ng-click="startExtraction()" data-modal-toggle="extract"
|
||||
data-modal-hide="extract"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1 text-xl">{% trans "Extract" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="fixPermissions">
|
||||
<a onclick="return false;" ng-click="fixPermissions()" class="nav-link point-events" href="#"><i
|
||||
class="fa fa-wrench" aria-hidden="true"></i> {% trans "Fix Permissions" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
|
|
@ -139,20 +776,23 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<div class="relative overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead id="tableHead">
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
<tr class="bg-gray-200 w-full rounded-t-lg border-b-2 border-gray-400">
|
||||
<th scope="col" class="py-3">
|
||||
|
||||
</th>
|
||||
<th scope="col" class="py-3">
|
||||
File Name
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
<th scope="col" class="py-3">
|
||||
Size (KB)
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
<th scope="col" class="py-3">
|
||||
Last Modified
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
<th scope="col" class="py-3">
|
||||
Permissions
|
||||
</th>
|
||||
</tr>
|
||||
|
|
@ -163,5 +803,65 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="position: absolute;top: 0;left: 0;" id="rightClick" class="border bg-gray-50 px-4 py-2">
|
||||
<ul>
|
||||
<a style="border-bottom: 1px solid #000000;" onclick="return false;" ng-click="showMoveModal()"
|
||||
href="#" data-modal-target="move" data-modal-toggle="move">
|
||||
<li class="list-group-item"><i class="fa fa-arrows-alt" aria-hidden="true"></i> {% trans "Move" %}
|
||||
</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" id="downloadOnRight" onclick="return false;"
|
||||
ng-click="downloadFile()" href="#">
|
||||
<li class="list-group-item"><i class="fa fa-download" aria-hidden="true"></i> {% trans "Download" %}
|
||||
</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" onclick="return false;" ng-click="showCopyModal()"
|
||||
href="#" data-modal-target="copy" data-modal-toggle="copy">
|
||||
<li class="list-group-item"><i class="fa fa-files-o" aria-hidden="true"></i> {% trans "Copy" %}</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" onclick="return false;"
|
||||
href="#" ng-click="showRenameModal()" data-modal-target="rename" data-modal-toggle="rename">
|
||||
<li class="list-group-item"><i class="fa fa-file-text-o"
|
||||
aria-hidden="true"></i> {% trans "Rename" %}</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" onclick="return false;" ng-click="showPermissionsModal()"
|
||||
href="#">
|
||||
<li class="list-group-item"><i class="fa fa-lock"
|
||||
aria-hidden="true"></i> {% trans "Change Permissions" %}</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" onclick="return false;" ng-click="showDeleteModal()"
|
||||
href="#" data-modal-target="delete" data-modal-toggle="delete">
|
||||
<li class="list-group-item"><i class="fa fa-trash" aria-hidden="true"></i> {% trans "Delete" %}</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" onclick="return false;" ng-click="showCompressionModal()"
|
||||
href="#" data-modal-target="compress" data-modal-toggle="compress">
|
||||
<li class="list-group-item"><i class="fa fa-compress" aria-hidden="true"></i> {% trans "Compress" %}
|
||||
</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" id="extractOnRight" onclick="return false;"
|
||||
ng-click="showExtractionModal()"
|
||||
data-modal-target="extract" data-modal-toggle="extract" href="#">
|
||||
<li class="list-group-item"><i class="fa fa-expand" aria-hidden="true"></i> {% trans "Extract" %}
|
||||
</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" id="editOnRight" onclick="return false;"
|
||||
ng-click="showHTMLEditorModal(1)"
|
||||
data-modal-target="edit" data-modal-toggle="edit" href="#">
|
||||
<li class="list-group-item"><i class="fa fa-pencil-square-o"
|
||||
aria-hidden="true"></i> {% trans "Edit" %}</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" id="editOnRightCodeMirror" onclick="return false;"
|
||||
ng-click="editWithCodeMirror()" href="#">
|
||||
<li class="list-group-item"><i class="fa fa-pencil-square-o"
|
||||
aria-hidden="true"></i> {% trans "Edit with CodeMirror" %}</li>
|
||||
</a>
|
||||
<a style="border-bottom: 1px solid #007bff;" id="restoreRight" onclick="return false;"
|
||||
ng-click="showRestoreModal()" href="#">
|
||||
<li class="list-group-item"><i class="fa fa-window-restore"
|
||||
aria-hidden="true"></i> {% trans "Restore" %}</li>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -1036,7 +1036,7 @@
|
|||
</div>
|
||||
<ul id="dropdown-example-14" class="hidden py-2 space-y-2">
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'FilemanagerV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
View
|
||||
Profile</a>
|
||||
|
|
@ -1123,7 +1123,7 @@
|
|||
</div>
|
||||
<ul id="dropdown-example-16" class="hidden py-2 space-y-2">
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'litespeedStatusV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Create Limits</a>
|
||||
</li>
|
||||
|
|
@ -1163,17 +1163,17 @@
|
|||
</div>
|
||||
<ul id="dropdown-example-17" class="hidden py-2 space-y-2">
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'manageImagesV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Manage Images</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'listContainersV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Manage Containers</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'containerImageV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Create New Container</a>
|
||||
</li>
|
||||
|
|
@ -1205,12 +1205,12 @@
|
|||
</div>
|
||||
<ul id="dropdown-example-18" class="hidden py-2 space-y-2">
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'liteSpeedTuningV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Litespeed Tuning</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'phpTuningV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
PHP Tuning</a>
|
||||
</li>
|
||||
|
|
@ -1250,12 +1250,12 @@
|
|||
</div>
|
||||
<ul id="dropdown-example-19" class="hidden py-2 space-y-2">
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'topProcessesV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Top Processes</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'litespeedStatusV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
LiteSpeed Status</a>
|
||||
</li>
|
||||
|
|
@ -1310,12 +1310,12 @@
|
|||
</div>
|
||||
<ul id="dropdown-example-20" class="hidden py-2 space-y-2">
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'installExtensionsV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Install Extension</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'editPHPConfigsV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Edit PHP Configs</a>
|
||||
</li>
|
||||
|
|
@ -1346,32 +1346,37 @@
|
|||
</div>
|
||||
<ul id="dropdown-example-21" class="hidden py-2 space-y-2">
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'serverMailV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Server Mail</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'cyberCPMainLogFileV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Cyberpanel Main Log File</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'accessLogsV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Access Log</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'errorLogsV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Error Logs</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'emaillogsV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Email Logs</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'ftplogsV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
FTP Logs</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'modSecAuditLogsV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
ModSec Audit Logs</a>
|
||||
</li>
|
||||
|
|
@ -1403,42 +1408,42 @@
|
|||
</div>
|
||||
<ul id="dropdown-example-22" class="hidden py-2 space-y-2">
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'firewallHomeV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Firewall</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'secureSSHV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Security SSH</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'modSecurityV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
ModSecurity Conf</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'modSecRulesV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
ModSecurity Rules</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'modSecRulesPacksV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
ModSecurity Rules Pack</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'csfV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
CSF</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'imunifyV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
Imunify 360</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
<a href="{% url 'imunifyAVV2' %}"
|
||||
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">•
|
||||
ImunifyAV</a>
|
||||
</li>
|
||||
|
|
@ -1695,6 +1700,12 @@
|
|||
<script src="{% static 'emailMarketing/emailMarketingV2.js' %}"></script>
|
||||
<script src="{% static 'IncBackups/IncBackupsV2.js' %}"></script>
|
||||
<script src="{% static 'manageSSL/manageSSLV2.js' %}"></script>
|
||||
<script src="{% static 'serverLogs/serverLogsV2.js' %}"></script>
|
||||
<script src="{% static 'serverStatus/serverStatusV2.js' %}"></script>
|
||||
<script src="{% static 'firewall/firewallV2.js' %}"></script>
|
||||
<script src="{% static 'dockerManager/dockerManagerV2.js' %}"></script>
|
||||
<script src="{% static 'managePHP/managePHPV2.js' %}"></script>
|
||||
<script src="{% static 'tuning/tuningV2.js' %}"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
import os.path
|
||||
import sys
|
||||
import django
|
||||
|
||||
sys.path.append('/usr/local/CyberCP')
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
||||
django.setup()
|
||||
|
|
@ -24,10 +25,11 @@ from serverStatus.serverStatusUtil import ServerStatusUtil
|
|||
import threading as multi
|
||||
from plogical.httpProc import httpProc
|
||||
|
||||
|
||||
# Use default socket to connect
|
||||
class ContainerManager(multi.Thread):
|
||||
|
||||
def __init__(self, name=None, function=None, request = None, templateName = None, data = None):
|
||||
def __init__(self, name=None, function=None, request=None, templateName=None, data=None):
|
||||
multi.Thread.__init__(self)
|
||||
self.name = name
|
||||
self.function = function
|
||||
|
|
@ -47,7 +49,7 @@ class ContainerManager(multi.Thread):
|
|||
command = 'sudo systemctl restart gunicorn.socket'
|
||||
ProcessUtilities.executioner(command)
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile( str(msg) + ' [ContainerManager.run]')
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [ContainerManager.run]')
|
||||
|
||||
@staticmethod
|
||||
def executioner(command, statusFile):
|
||||
|
|
@ -99,8 +101,8 @@ class ContainerManager(multi.Thread):
|
|||
val = request.session['userID']
|
||||
admin = Administrator.objects.get(pk=val)
|
||||
proc = httpProc(request, 'dockerManager/images.html', {"type": admin.type,
|
||||
'image': image,
|
||||
'tag': tag})
|
||||
'image': image,
|
||||
'tag': tag})
|
||||
return proc.render()
|
||||
|
||||
envList = {};
|
||||
|
|
@ -129,6 +131,56 @@ class ContainerManager(multi.Thread):
|
|||
proc = httpProc(request, template, Data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def createContainerV2(self, request=None, userID=None, data=None):
|
||||
client = docker.from_env()
|
||||
dockerAPI = docker.APIClient()
|
||||
|
||||
adminNames = ACLManager.loadAllUsers(userID)
|
||||
tag = request.GET.get('tag')
|
||||
image = request.GET.get('image')
|
||||
tag = tag.split(" (")[0]
|
||||
|
||||
if "/" in image:
|
||||
name = image.split("/")[0] + "." + image.split("/")[1]
|
||||
else:
|
||||
name = image
|
||||
|
||||
try:
|
||||
inspectImage = dockerAPI.inspect_image(image + ":" + tag)
|
||||
except docker.errors.ImageNotFound:
|
||||
val = request.session['userID']
|
||||
admin = Administrator.objects.get(pk=val)
|
||||
proc = httpProc(request, 'dockerManager/images.html', {"type": admin.type,
|
||||
'image': image,
|
||||
'tag': tag})
|
||||
return proc.render()
|
||||
|
||||
envList = {};
|
||||
if 'Env' in inspectImage['Config']:
|
||||
for item in inspectImage['Config']['Env']:
|
||||
if '=' in item:
|
||||
splitedItem = item.split('=', 1)
|
||||
print(splitedItem)
|
||||
envList[splitedItem[0]] = splitedItem[1]
|
||||
else:
|
||||
envList[item] = ""
|
||||
|
||||
portConfig = {};
|
||||
if 'ExposedPorts' in inspectImage['Config']:
|
||||
for item in inspectImage['Config']['ExposedPorts']:
|
||||
portDef = item.split('/')
|
||||
portConfig[portDef[0]] = portDef[1]
|
||||
|
||||
if image is None or image is '' or tag is None or tag is '':
|
||||
return redirect(loadImages)
|
||||
|
||||
Data = {"ownerList": adminNames, "image": image, "name": name, "tag": tag, "portConfig": portConfig,
|
||||
"envList": envList}
|
||||
|
||||
template = 'dockerManager/runContainerV2.html'
|
||||
proc = httpProc(request, template, Data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def loadContainerHome(self, request=None, userID=None, data=None):
|
||||
try:
|
||||
name = self.name
|
||||
|
|
@ -192,6 +244,69 @@ class ContainerManager(multi.Thread):
|
|||
except BaseException as msg:
|
||||
return HttpResponse(str(msg))
|
||||
|
||||
def loadContainerHomeV2(self, request=None, userID=None, data=None):
|
||||
try:
|
||||
name = self.name
|
||||
|
||||
if ACLManager.checkContainerOwnership(name, userID) != 1:
|
||||
return ACLManager.loadError()
|
||||
|
||||
client = docker.from_env()
|
||||
dockerAPI = docker.APIClient()
|
||||
|
||||
try:
|
||||
container = client.containers.get(name)
|
||||
except docker.errors.NotFound as err:
|
||||
return HttpResponse("Container not found")
|
||||
|
||||
data = {}
|
||||
con = Containers.objects.get(name=name)
|
||||
data['name'] = name
|
||||
data['image'] = con.image + ":" + con.tag
|
||||
data['ports'] = json.loads(con.ports)
|
||||
data['cid'] = con.cid
|
||||
data['envList'] = json.loads(con.env)
|
||||
data['volList'] = json.loads(con.volumes)
|
||||
|
||||
stats = container.stats(decode=False, stream=False)
|
||||
logs = container.logs(stream=True)
|
||||
|
||||
data['status'] = container.status
|
||||
data['memoryLimit'] = con.memory
|
||||
if con.startOnReboot == 1:
|
||||
data['startOnReboot'] = 'true'
|
||||
data['restartPolicy'] = "Yes"
|
||||
else:
|
||||
data['startOnReboot'] = 'false'
|
||||
data['restartPolicy'] = "No"
|
||||
|
||||
if 'usage' in stats['memory_stats']:
|
||||
# Calculate Usage
|
||||
# Source: https://github.com/docker/docker/blob/28a7577a029780e4533faf3d057ec9f6c7a10948/api/client/stats.go#L309
|
||||
data['memoryUsage'] = (stats['memory_stats']['usage'] / stats['memory_stats']['limit']) * 100
|
||||
|
||||
try:
|
||||
cpu_count = len(stats["cpu_stats"]["cpu_usage"]["percpu_usage"])
|
||||
except:
|
||||
cpu_count = 0
|
||||
|
||||
data['cpuUsage'] = 0.0
|
||||
cpu_delta = float(stats["cpu_stats"]["cpu_usage"]["total_usage"]) - \
|
||||
float(stats["precpu_stats"]["cpu_usage"]["total_usage"])
|
||||
system_delta = float(stats["cpu_stats"]["system_cpu_usage"]) - \
|
||||
float(stats["precpu_stats"]["system_cpu_usage"])
|
||||
if system_delta > 0.0:
|
||||
data['cpuUsage'] = round(cpu_delta / system_delta * 100.0 * cpu_count, 3)
|
||||
else:
|
||||
data['memoryUsage'] = 0
|
||||
data['cpuUsage'] = 0
|
||||
|
||||
template = 'dockerManager/viewContainerV2.html'
|
||||
proc = httpProc(request, template, data, 'admin')
|
||||
return proc.render()
|
||||
except BaseException as msg:
|
||||
return HttpResponse(str(msg))
|
||||
|
||||
def listContainers(self, request=None, userID=None, data=None):
|
||||
client = docker.from_env()
|
||||
dockerAPI = docker.APIClient()
|
||||
|
|
@ -235,6 +350,49 @@ class ContainerManager(multi.Thread):
|
|||
"showUnlistedContainer": showUnlistedContainer}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def listContainersV2(self, request=None, userID=None, data=None):
|
||||
client = docker.from_env()
|
||||
dockerAPI = docker.APIClient()
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
containers = ACLManager.findAllContainers(currentACL, userID)
|
||||
|
||||
allContainers = client.containers.list()
|
||||
containersList = []
|
||||
showUnlistedContainer = True
|
||||
|
||||
# TODO: Add condition to show unlisted Containers only if user has admin level access
|
||||
|
||||
unlistedContainers = []
|
||||
for container in allContainers:
|
||||
if container.name not in containers:
|
||||
unlistedContainers.append(container)
|
||||
|
||||
if not unlistedContainers:
|
||||
showUnlistedContainer = False
|
||||
|
||||
adminNames = ACLManager.loadAllUsers(userID)
|
||||
|
||||
pages = float(len(containers)) / float(10)
|
||||
pagination = []
|
||||
|
||||
if pages <= 1.0:
|
||||
pages = 1
|
||||
pagination.append('<li><a href="\#"></a></li>')
|
||||
else:
|
||||
pages = ceil(pages)
|
||||
finalPages = int(pages) + 1
|
||||
|
||||
for i in range(1, finalPages):
|
||||
pagination.append('<li><a href="\#">' + str(i) + '</a></li>')
|
||||
|
||||
template = 'dockerManager/listContainersV2.html'
|
||||
proc = httpProc(request, template, {"pagination": pagination,
|
||||
"unlistedContainers": unlistedContainers,
|
||||
"adminNames": adminNames,
|
||||
"showUnlistedContainer": showUnlistedContainer}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def getContainerLogs(self, userID=None, data=None):
|
||||
try:
|
||||
name = data['name']
|
||||
|
|
@ -299,7 +457,7 @@ class ContainerManager(multi.Thread):
|
|||
volumes = {}
|
||||
for index, volume in volList.items():
|
||||
volumes[volume['src']] = {'bind': volume['dest'],
|
||||
'mode': 'rw'}
|
||||
'mode': 'rw'}
|
||||
|
||||
## Create Configurations
|
||||
admin = Administrator.objects.get(userName=dockerOwner)
|
||||
|
|
@ -772,6 +930,54 @@ class ContainerManager(multi.Thread):
|
|||
except BaseException as msg:
|
||||
return HttpResponse(str(msg))
|
||||
|
||||
def imagesV2(self, request=None, userID=None, data=None):
|
||||
try:
|
||||
admin = Administrator.objects.get(pk=userID)
|
||||
|
||||
client = docker.from_env()
|
||||
dockerAPI = docker.APIClient()
|
||||
|
||||
try:
|
||||
imageList = client.images.list()
|
||||
except docker.errors.APIError as err:
|
||||
return HttpResponse(str(err))
|
||||
|
||||
images = {}
|
||||
names = []
|
||||
|
||||
for image in imageList:
|
||||
try:
|
||||
name = image.attrs['RepoTags'][0].split(":")[0]
|
||||
if "/" in name:
|
||||
name2 = ""
|
||||
for item in name.split("/"):
|
||||
name2 += ":" + item
|
||||
else:
|
||||
name2 = name
|
||||
|
||||
tags = []
|
||||
for tag in image.tags:
|
||||
getTag = tag.split(":")
|
||||
if len(getTag) == 2:
|
||||
tags.append(getTag[1])
|
||||
print(tags)
|
||||
if name in names:
|
||||
images[name]['tags'].extend(tags)
|
||||
else:
|
||||
names.append(name)
|
||||
images[name] = {"name": name,
|
||||
"name2": name2,
|
||||
"tags": tags}
|
||||
except:
|
||||
continue
|
||||
|
||||
template = 'dockerManager/imagesV2.html'
|
||||
proc = httpProc(request, template, {"images": images, "test": ''}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
except BaseException as msg:
|
||||
return HttpResponse(str(msg))
|
||||
|
||||
def manageImages(self, request=None, userID=None, data=None):
|
||||
try:
|
||||
|
||||
|
|
@ -802,6 +1008,36 @@ class ContainerManager(multi.Thread):
|
|||
except BaseException as msg:
|
||||
return HttpResponse(str(msg))
|
||||
|
||||
def manageImagesV2(self, request=None, userID=None, data=None):
|
||||
try:
|
||||
|
||||
client = docker.from_env()
|
||||
dockerAPI = docker.APIClient()
|
||||
|
||||
imageList = client.images.list()
|
||||
|
||||
images = {}
|
||||
names = []
|
||||
|
||||
for image in imageList:
|
||||
try:
|
||||
name = image.attrs['RepoTags'][0].split(":")[0]
|
||||
if name in names:
|
||||
images[name]['tags'].extend(image.tags)
|
||||
else:
|
||||
names.append(name)
|
||||
images[name] = {"name": name,
|
||||
"tags": image.tags}
|
||||
except:
|
||||
continue
|
||||
|
||||
template = 'dockerManager/manageImagesV2.html'
|
||||
proc = httpProc(request, template, {"images": images}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
except BaseException as msg:
|
||||
return HttpResponse(str(msg))
|
||||
|
||||
def getImageHistory(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
|
|
@ -1076,4 +1312,4 @@ class ContainerManager(multi.Thread):
|
|||
except BaseException as msg:
|
||||
data_ret = {'getTagsStatus': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
return HttpResponse(json_data)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,67 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="manageImagesV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Create new container</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white"
|
||||
href="{% url "manageImagesV2" %}">{% trans "Manage Images" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border px-8 py-2 mt-3">
|
||||
<div class="flex justify-between items-center py-4">
|
||||
<div class="flex items-center">
|
||||
<p class="text-xl font-bold">Locally Available Images</p>
|
||||
<img id="imageLoading" src="/static/images/loading.gif" style="display: none;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table id="imageList" class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Name (Installed)
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Tags
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Action
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
{% for name, image in images.items %}
|
||||
<tr>
|
||||
<td class="px-6 py-4">{{ image.name }}</td>
|
||||
<td class="px-6 py-4">
|
||||
<select class="w-80 bg-gray-100 rounded px-2 py-1" id="{{ forloop.counter }}"
|
||||
ng-model="imageTag['{{ image.name2 }}']">
|
||||
{% for tag in image.tags %}
|
||||
<option>{{ tag }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<a class="bg-orange-500 px-3 py-1 rounded-lg font-semibold text-white cursor-pointer"
|
||||
ng-href="/docker/V2/runContainerV2/?image={{ image.name }}&tag={$ imageTag['{{ image.name2 }}'] $}">{% trans "Create" %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,219 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="listContainersV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p id="domainNamePage" class="text-4xl font-bold">List Containers</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white"
|
||||
href="{% url "containerImage" %}">{% trans "Create" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Manage containers on server</p>
|
||||
</div>
|
||||
<div class="border px-8 py-2">
|
||||
<div class="flex justify-between items-center py-4">
|
||||
<div class="flex items-center">
|
||||
<p class="text-xl font-bold">Containers</p>
|
||||
<img id="imageLoading" src="/static/images/loading.gif" style="display: none;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table id="datatable-example" class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Launch
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Owner
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Image
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Tag
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Actions
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="web in ContainerList track by $index"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td ng-bind="web.name" class="px-6 py-4"></td>
|
||||
<td class="px-6 py-4"><a href="/docker/V2/view/{$ web.name $}"><img width="30px" height="30"
|
||||
class=""
|
||||
src="{% static 'baseTemplate/assets/image-resources/webPanel.png' %}"></a>
|
||||
</td>
|
||||
<td ng-bind="web.admin" class="px-6 py-4"></td>
|
||||
<td ng-bind="web.image" class="px-6 py-4"></td>
|
||||
<td ng-bind="web.tag" class="px-6 py-4"></td>
|
||||
<td class="px-6 py-4">
|
||||
<button ng-click="delContainer(web.name)">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button onclick="return false;"
|
||||
ng-click="showLog(web.name)"
|
||||
href="#" data-modal-target="showLog" data-modal-toggle="showLog">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div id="showLog" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">{% trans "Container logs" %}</p>
|
||||
<button type="button" data-modal-toggle="showLog"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="showLog">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<textarea name="logs" class="border w-full" id="" cols="30" rows="10">{$ logs $}</textarea>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button ng-click="showLog('', true)" type="button"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Refresh" %}</button>
|
||||
<button type="button"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-modal-toggle="showLog"
|
||||
data-modal-hide="showLog">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="listFail" class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div>
|
||||
<nav>
|
||||
<ul class="flex justify-end">
|
||||
{% for items in pagination %}
|
||||
<li class="flex justify-end bg-gray-200 w-8 px-3 py-1"
|
||||
ng-click="getFurtherContainersFromDB({{ forloop.counter }})" id="webPages"><a
|
||||
href="">{{ forloop.counter }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% if showUnlistedContainer %}
|
||||
<h3 class="title-hero">
|
||||
{% trans "Unlisted Containers" %} <i class="fa fa-question-circle"
|
||||
title="{% trans "Containers listed below were either not created through panel or were not saved to database properly" %}"></i>
|
||||
</h3>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table id="datatable-example" class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Status
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Actions
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
{% for container in unlistedContainers %}
|
||||
<tr>
|
||||
<td class="px-6 py-4">{{ container.name }}</td>
|
||||
<td class="px-6 py-4">{{ container.status }}</td>
|
||||
<td class="px-6 py-4">
|
||||
<button class="btn btn-primary"
|
||||
ng-click="delContainer('{{ container.name }}', true)"><i
|
||||
class="fa fa-trash"></i></button>
|
||||
<button class="btn btn-primary" ng-click="showLog('{{ container.name }}')"><i
|
||||
class="fa fa-file"></i></button>
|
||||
<button class="btn btn-primary" ng-click="assignContainer('{{ container.name }}')">
|
||||
<i
|
||||
class="fa fa-user"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<button onclick="return false;"
|
||||
ng-click="showLog(web.name)"
|
||||
href="#" data-modal-target="showLog" data-modal-toggle="showLog">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div id="showLog" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">{% trans "Container logs" %}</p>
|
||||
<button type="button" data-modal-toggle="showLog"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="showLog">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<textarea name="logs" class="border w-full" id="" cols="30" rows="10">{$ logs $}</textarea>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button ng-click="showLog('', true)" type="button"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Refresh" %}</button>
|
||||
<button type="button"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-modal-toggle="showLog"
|
||||
data-modal-hide="showLog">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="manageImagesV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p id="domainNamePage" class="text-4xl font-bold">Manage Images</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white"
|
||||
href="{% url "containerImageV2" %}">{% trans "Create Container" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can manage docker images.</p>
|
||||
</div>
|
||||
<div class="border px-8 py-2">
|
||||
<div class="flex justify-between items-center py-4">
|
||||
<div class="flex items-center">
|
||||
<p class="text-xl font-bold">Images</p>
|
||||
<img id="imageLoading" src="/static/images/loading.gif" style="display: none;">
|
||||
</div>
|
||||
<div>
|
||||
<button ng-click="rmImage(0)" class="bg-orange-500 px-3 py-1 rounded-lg font-semibold text-white">
|
||||
Prune
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Search Image</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" ng-change="searchImages()" ng-model="searchString"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table id="searchResult" class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Name (search)
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Tags
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Action
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="image in images track by $index"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="flex items-center px-6 py-4">
|
||||
<span ng-bind="image.name"></span>
|
||||
<span class="ml-1" ng-show="image.is_official == true"><svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor"
|
||||
class="w-4 h-4">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<select ng-focus="loadTags($event)" ng-click="selectTag()" ng-model="imageTag[image.name2]"
|
||||
ng-options="tag for tag in tagList[image.name2]" ng-attr-id="{$ image.name2 $}"
|
||||
data-pageloaded='0' class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
</select>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<a ng-click="pullImage(image.name, imageTag[image.name2])"
|
||||
class="bg-orange-500 px-3 py-1 rounded-lg font-semibold text-white cursor-pointer">{% trans "Pull" %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table id="imageList" class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Name (Locally Available)
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Tags
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Action
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
{% for name, image in images.items %}
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
{{ image.name }}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<select class="w-80 bg-gray-100 rounded px-2 py-1" id="{{ forloop.counter }}">
|
||||
{% for tag in image.tags %}
|
||||
<option>{{ tag }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<button onclick="return false;"
|
||||
ng-click="getHistory({{ forloop.counter }})"
|
||||
class="nav-link point-events"
|
||||
href="#" data-modal-target="history" data-modal-toggle="history">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"
|
||||
class="w-6 h-6">
|
||||
<path fill-rule="evenodd"
|
||||
d="M12 5.25c1.213 0 2.415.046 3.605.135a3.256 3.256 0 0 1 3.01 3.01c.044.583.077 1.17.1 1.759L17.03 8.47a.75.75 0 1 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l3-3a.75.75 0 0 0-1.06-1.06l-1.752 1.751c-.023-.65-.06-1.296-.108-1.939a4.756 4.756 0 0 0-4.392-4.392 49.422 49.422 0 0 0-7.436 0A4.756 4.756 0 0 0 3.89 8.282c-.017.224-.033.447-.046.672a.75.75 0 1 0 1.497.092c.013-.217.028-.434.044-.651a3.256 3.256 0 0 1 3.01-3.01c1.19-.09 2.392-.135 3.605-.135Zm-6.97 6.22a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.752-1.751c.023.65.06 1.296.108 1.939a4.756 4.756 0 0 0 4.392 4.392 49.413 49.413 0 0 0 7.436 0 4.756 4.756 0 0 0 4.392-4.392c.017-.223.032-.447.046-.672a.75.75 0 0 0-1.497-.092c-.013.217-.028.434-.044.651a3.256 3.256 0 0 1-3.01 3.01 47.953 47.953 0 0 1-7.21 0 3.256 3.256 0 0 1-3.01-3.01 47.759 47.759 0 0 1-.1-1.759L6.97 15.53a.75.75 0 0 0 1.06-1.06l-3-3Z"
|
||||
clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div id="history" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">{% trans "Image history" %}</p>
|
||||
<button type="button" data-modal-toggle="history"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="history">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table id="datatable-example"
|
||||
class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
ID
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
CreatedBy
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Created
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Comment
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Size
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="history in historyList track by $index"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td style="word-break: break-all;" ng-bind="history.Id"
|
||||
class="flex items-center px-6 py-4"></td>
|
||||
<td style="word-break: break-all;"
|
||||
ng-bind="history.CreatedBy" class="px-6 py-4"></td>
|
||||
<td ng-bind="history.Created" class="px-6 py-4"></td>
|
||||
<td ng-bind="history.Comment" class="px-6 py-4"></td>
|
||||
<td ng-bind="history.Size" class="px-6 py-4"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button type="button"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-modal-toggle="history"
|
||||
data-modal-hide="history">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button ng-click="rmImage({{ forloop.counter }})">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>
|
||||
</svg>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="runContainerV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Run Container</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Modify parameters for your new container</p>
|
||||
</div>
|
||||
<div class="border px-8 py-2 mt-3">
|
||||
<div class="flex justify-between items-center py-4">
|
||||
<div class="flex items-center">
|
||||
<p class="text-xl font-bold">Container Details</p>
|
||||
<img ng-hide="containerCreationLoading"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Name</p>
|
||||
</div>
|
||||
<div ng-init="name='{{ name }}' ">
|
||||
<input name="name" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Image</p>
|
||||
</div>
|
||||
<div ng-init="image='{{ image }}' ">
|
||||
<input name="image" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="image" required
|
||||
disabled="disabled">
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Tag</p>
|
||||
</div>
|
||||
<div ng-init="tag='{{ tag }}' ">
|
||||
<input name="tag" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="tag" required
|
||||
disabled="disabled">
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Select Owner</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-model="dockerOwner" class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
{% for items in ownerList %}
|
||||
<option>{{ items }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex items-center py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Memory limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input name="memory" type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="memory"
|
||||
required>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<p>MB</p>
|
||||
</div>
|
||||
</div>
|
||||
{% for port, protocol in portConfig.items %}
|
||||
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Port</p>
|
||||
</div>
|
||||
<div ng-init="iport[{{ port }}]={{ port }} ">
|
||||
<input name="iport[{{ port }}]" type="text" class="w-24 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="iport[{{ port }}]" required disabled="disabled">
|
||||
</div>
|
||||
<div class="ml-2" ng-init="portType['{{ port }}']='{{ protocol }}'">
|
||||
<input name="portType['{{ port }}']" type="text" class="w-20 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="portType['{{ port }}']" required disabled="disabled">
|
||||
</div>
|
||||
<div class="flex items-center ml-2">
|
||||
<p class="font-semibold w-8">to</p>
|
||||
</div>
|
||||
<div>
|
||||
<input name="eport['{{ port }}']" type="number" class="w-24 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="eport['{{ port }}']" required>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<span ng-init="envList = {}"></span>
|
||||
{% for env, value in envList.items %}
|
||||
<span ng-init="envList[{{ forloop.counter0 }}] = {'name':'{{ env }}' , 'value':'{{ value }}'} "></span>
|
||||
{% endfor %}
|
||||
<div class="border">
|
||||
<div ng-hide="installationDetailsForm" class="flex justify-center mt-2">
|
||||
<p class="font-semibold">
|
||||
ENV
|
||||
</p>
|
||||
</div>
|
||||
<div ng-repeat="env in envList track by $index" ng-hide="installationDetailsForm"
|
||||
class="flex justify-center py-2 px-6">
|
||||
<div ng-show="$first">
|
||||
<p class="font-semibold"></p>
|
||||
</div>
|
||||
{# <p class="font-semibold w-60"></p>#}
|
||||
<div>
|
||||
<input name="$index" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="envList[$index].name" required>
|
||||
</div>
|
||||
<div class="ml-1">
|
||||
<input name="$index" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="envList[$index].value" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center mt-2 mb-2" ng-hide="installationDetailsForm">
|
||||
<button type="button"
|
||||
class="bg-orange-500 px-3 py-1 rounded-lg font-semibold text-white cursor-pointer"
|
||||
ng-click="addEnvField()">Add more
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mt-2">
|
||||
<div ng-hide="installationDetailsForm" class="flex justify-center mt-2">
|
||||
<p class="font-semibold">
|
||||
Map Volumes
|
||||
</p>
|
||||
</div>
|
||||
<div ng-repeat="volume in volList track by $index" ng-hide="installationDetailsForm"
|
||||
class="flex items-center py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-28"></p>
|
||||
</div>
|
||||
{# <p class="font-semibold w-60"></p>#}
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="volList[$index].dest"
|
||||
placeholder="Destination" required>
|
||||
</div>
|
||||
<div class="ml-1">
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="volList[$index].src"
|
||||
placeholder="Source" required>
|
||||
</div>
|
||||
<div class="ml-1" ng-show="$last">
|
||||
<div>
|
||||
<button type="button" ng-click="removeVolField()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center mt-2 mb-2" ng-hide="installationDetailsForm">
|
||||
<button type="button"
|
||||
class="bg-orange-500 px-3 py-1 rounded-lg font-semibold text-white cursor-pointer"
|
||||
ng-click="addVolField()">Add Field
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex justify-center mt-3">
|
||||
<button ng-click="createContainer()"
|
||||
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
|
||||
Create Container
|
||||
</button>
|
||||
</div>
|
||||
<div ng-hide="installationProgress" class="mt-2">
|
||||
<div class="flex justify-center font-bold text-xl">
|
||||
<h2>{$ currentStatus $}</h2>
|
||||
</div>
|
||||
<div class="w-full bg-gray-100 rounded-full mt-3">
|
||||
<div id="installProgress"
|
||||
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
|
||||
style="width:0%">
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="errorMessageBox"
|
||||
class="flex mt-2 justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="success" class="flex mt-2 justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Container succesfully created." %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex mt-2 justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationProgress" class="flex justify-center mt-3">
|
||||
<button ng-disabled="goBackDisable"
|
||||
ng-click="goBack()"
|
||||
class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
|
||||
Go Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,438 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="viewContainerV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<div ng-init="cName='{{ name }}'" class="flex items-center">
|
||||
<p class="text-4xl font-bold">Manage Container</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Currently managing: {{ name }}</p>
|
||||
</div>
|
||||
<div class="border px-8 py-2 mt-3">
|
||||
<div class="flex items-center">
|
||||
<p class="text-xl font-bold">Container Information</p>
|
||||
<img id="infoLoading" src="/static/images/loading.gif" style="display: none;">
|
||||
</div>
|
||||
<div class="flex flex-col md:flex-col lg:flex-row justify-center gap-3">
|
||||
<div class="border w-full">
|
||||
<div class="mt-2">
|
||||
<div class="px-2 py-2">
|
||||
<p class="font-semibold">Memory Usage</p>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="w-full bg-gray-200 dark:bg-gray-700">
|
||||
<div class="bg-blue-600 text-xs font-medium text-black text-center p-1 leading-none"
|
||||
style="width: {{ memoryUsage }}%"> {{ memoryUsage | floatformat:"2" }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-2 py-2">
|
||||
<p class="font-semibold">CPU Usage</p>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="w-full bg-gray-200 dark:bg-gray-700">
|
||||
<div class="bg-blue-600 text-xs font-medium text-black text-center p-1 leading-none"
|
||||
style="width: {{ cpuUsage }}%"> {{ cpuUsage }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border w-full">
|
||||
<div class="p-3">
|
||||
{% trans "Container ID" %}: {{ cid }}
|
||||
<br>
|
||||
{% trans "Image" %}: {{ image }}
|
||||
<span ng-show="'{{ image }}' == 'unknown:unknown'"
|
||||
title="Actions involving container recreation cannot be executed">
|
||||
<i class="fa fa-warning btn-icon"></i>
|
||||
</span>
|
||||
<br>
|
||||
{% if ports %}
|
||||
{% trans "Ports" %}: <br>
|
||||
{% for iport, eport in ports.items %}
|
||||
{{ iport }} {% trans "to" %} {{ eport }}<br>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<div class="flex justify-center">
|
||||
<button onclick="return false;"
|
||||
ng-click="showLog(web.name)"
|
||||
href="#" data-modal-target="showLog" data-modal-toggle="showLog">
|
||||
<div class="flex items-center gap-1 text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
|
||||
</svg>
|
||||
<p>Settings</p>
|
||||
</div>
|
||||
</button>
|
||||
<div id="showLog" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">{% trans "Container Settings" %}</p>
|
||||
<img id="containerSettingLoading" src="/static/images/loading.gif"
|
||||
style="display: none;">
|
||||
<button type="button" data-modal-toggle="showLog"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="showLog">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<form name="containerSettingsForm" action="/">
|
||||
<div ng-hide="installationDetailsForm"
|
||||
class="flex items-center py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-32">Memory limit</p>
|
||||
</div>
|
||||
<div ng-init="memory={{ memoryLimit }}">
|
||||
<input name="memory" type="number"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="memory"
|
||||
required>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<p>MB</p>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm"
|
||||
class="flex items-center py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-32">Start on reboot</p>
|
||||
</div>
|
||||
<div ng-init="startOnReboot={{ startOnReboot }}">
|
||||
<input ng-model="startOnReboot" type="checkbox" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm"
|
||||
class="flex items-center py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-32">Confirmation</p>
|
||||
</div>
|
||||
<div>
|
||||
<input ng-model="envConfirmation" type="checkbox">
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<p>Editing ENV or Volume will recreate container.</p>
|
||||
</div>
|
||||
</div>
|
||||
<span ng-init="envList = {}"></span>
|
||||
{% for env, value in envList.items %}
|
||||
|
||||
<span ng-init="envList[{{ forloop.counter0 }}] = {'name':'{{ env }}' , 'value':'{{ value }}'} "></span>
|
||||
|
||||
{% endfor %}
|
||||
<div>
|
||||
<div ng-hide="installationDetailsForm"
|
||||
class="flex justify-center mt-2">
|
||||
<p class="font-semibold">
|
||||
ENV
|
||||
</p>
|
||||
</div>
|
||||
<div ng-repeat="env in envList track by $index"
|
||||
ng-hide="installationDetailsForm"
|
||||
class="flex justify-center py-2 px-6">
|
||||
<div ng-show="$first">
|
||||
<p class="font-semibold"></p>
|
||||
</div>
|
||||
{# <p class="font-semibold w-60"></p>#}
|
||||
<div>
|
||||
<input name="$index" ng-disabled="!envConfirmation"
|
||||
type="text"
|
||||
class="w-40 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="envList[$index].name"
|
||||
required>
|
||||
</div>
|
||||
<div class="ml-1">
|
||||
<input name="$index" ng-disabled="!envConfirmation"
|
||||
type="text"
|
||||
class="w-40 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="envList[$index].value"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center mt-2 mb-2">
|
||||
<button type="button" ng-disabled="!envConfirmation"
|
||||
class="bg-orange-500 px-3 py-1 rounded-lg font-semibold text-white cursor-pointer"
|
||||
ng-click="addEnvField()">Add more
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<span ng-init="volList = {}"></span>
|
||||
<span ng-init="volListNumber=1"></span>
|
||||
{% for key, value in volList.items %}
|
||||
<span ng-init="volList[{{ forloop.counter0 }}] = {'dest':'{{ value.bind }}' , 'src':'{{ key }}'}"></span>
|
||||
<span ng-init="volListNumber={{ forloop.counter0 }} + 1"></span>
|
||||
{% endfor %}
|
||||
<div>
|
||||
<div ng-hide="installationDetailsForm"
|
||||
class="flex justify-center mt-2">
|
||||
<p class="font-semibold">
|
||||
Map Volumes
|
||||
</p>
|
||||
</div>
|
||||
<div ng-repeat="volume in volList track by $index"
|
||||
ng-hide="installationDetailsForm"
|
||||
class="flex items-center py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-28"></p>
|
||||
</div>
|
||||
{# <p class="font-semibold w-60"></p>#}
|
||||
<div>
|
||||
<input type="text" ng-disabled="!envConfirmation"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="volList[$index].dest"
|
||||
placeholder="Destination" required>
|
||||
</div>
|
||||
<div class="ml-1">
|
||||
<input type="text" ng-disabled="!envConfirmation"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="volList[$index].src" placeholder="Source"
|
||||
required>
|
||||
</div>
|
||||
<div class="ml-1" ng-show="$last">
|
||||
<div>
|
||||
<button type="button" ng-disabled="!envConfirmation"
|
||||
ng-click="removeVolField()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center mt-2 mb-2"
|
||||
ng-hide="installationDetailsForm">
|
||||
<button type="button" ng-disabled="!envConfirmation"
|
||||
class="bg-orange-500 px-3 py-1 rounded-lg font-semibold text-white cursor-pointer"
|
||||
ng-click="addVolField()">Add Field
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button ng-click="saveSettings()" type="button"
|
||||
ng-disabled="savingSettings"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Save" %}</button>
|
||||
<button type="button" ng-disabled="savingSettings"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-modal-toggle="showLog"
|
||||
data-modal-hide="showLog">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
ng-click="recreate()">
|
||||
Recreate
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border px-8 py-2 mt-3">
|
||||
<div class="flex items-center mb-2">
|
||||
<p class="text-xl font-bold">Actions</p>
|
||||
</div>
|
||||
<div class="flex flex-col md:flex-col lg:flex-row justify-center gap-3">
|
||||
<div class="border w-full p-3">
|
||||
<div class="flex justify-between">
|
||||
<div class="flex items-center">
|
||||
<p ng-init="status='{{ status }}'">Main Actions</p>
|
||||
<img id="actionLoading" src="/static/images/loading.gif"
|
||||
style="display: none;width: 20px;">
|
||||
</div>
|
||||
<div>
|
||||
<button ng-click='refreshStatus()'>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="font-bold">Status:</p>
|
||||
<span class="ml-1" ng-bind="status"></span>
|
||||
</div>
|
||||
<div class="flex justify-center mt-2">
|
||||
<div ng-disabled="status=='running'" ng-click="cAction('start')"
|
||||
class="flex cursor-pointer items-center text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-2.5 py-1 text-center me-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"/>
|
||||
</svg>
|
||||
<p>Start</p>
|
||||
</div>
|
||||
<div ng-disabled="status!='running'" ng-click="cAction('restart')"
|
||||
class="flex cursor-pointer items-center text-white bg-blue-600 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:focus:ring-blue-800 font-medium rounded-lg text-sm inline-flex items-center px-2.5 py-1 text-center me-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"/>
|
||||
</svg>
|
||||
<p>Restart</p>
|
||||
</div>
|
||||
<div ng-disabled="status!='running'" ng-click="cAction('stop')"
|
||||
class="flex cursor-pointer items-center text-white bg-orange-600 hover:bg-orange-800 focus:ring-4 focus:outline-none focus:ring-orange-300 dark:focus:ring-orange-800 font-medium rounded-lg text-sm inline-flex items-center px-2.5 py-1 text-center me-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"/>
|
||||
</svg>
|
||||
<p>Stop</p>
|
||||
</div>
|
||||
<div ng-click="cRemove()"
|
||||
class="flex cursor-pointer items-center text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-2.5 py-1 text-center me-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
<p>Remove</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border w-full p-3">
|
||||
<div class="flex justify-between">
|
||||
<div class="flex items-center">
|
||||
<p ng-init="rPolicy='{{ restartPolicy }}'">Other Actions</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="font-bold">Restart on system reboot:</p>
|
||||
<span class="ml-1" ng-bind="rPolicy"></span>
|
||||
</div>
|
||||
<div class="flex justify-center mt-2">
|
||||
<button>
|
||||
<a href="/docker/exportContainer/?name={{ name }}"
|
||||
class="flex cursor-pointer items-center text-white bg-orange-600 hover:bg-orange-800 focus:ring-4 focus:outline-none focus:ring-orange-300 dark:focus:ring-orange-800 font-medium rounded-lg text-sm inline-flex items-center px-2.5 py-1 text-center me-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"/>
|
||||
</svg>
|
||||
<p>
|
||||
Export File
|
||||
</p>
|
||||
</a>
|
||||
</button>
|
||||
<button onclick="return false;"
|
||||
ng-disabled="loadingTop" ng-click="showTop()"
|
||||
href="#" data-modal-target="viewprocess" data-modal-toggle="viewprocess">
|
||||
<div class="flex cursor-pointer items-center text-white bg-orange-600 hover:bg-orange-800 focus:ring-4 focus:outline-none focus:ring-orange-300 dark:focus:ring-orange-800 font-medium rounded-lg text-sm inline-flex items-center px-2.5 py-1 text-center me-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
|
||||
</svg>
|
||||
<p class="ml-1">
|
||||
View Process
|
||||
</p>
|
||||
</div>
|
||||
</button>
|
||||
<div id="viewprocess" tabindex="-1"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl max-h-full">
|
||||
<div class="relative bg-white shadow dark:bg-gray-700">
|
||||
<div class="flex items-center bg-blue-400 px-4 py-4">
|
||||
<p class="font-bold">{% trans "Container Processes" %}</p>
|
||||
<button type="button" data-modal-toggle="viewprocess"
|
||||
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="viewprocess">
|
||||
<svg class="w-3 h-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table id="datatable-example"
|
||||
class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th ng-repeat="item in topHead track by $index" class="px-6 py-3">
|
||||
{$ item $}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="process in topProcesses track by $index"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td ng-repeat="item in process track by $index" class="px-6 py-4">
|
||||
{$ item $}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-1 justify-end py-2">
|
||||
<button ng-click="showTop()" type="button"
|
||||
ng-disabled="savingSettings"
|
||||
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">{% trans "Refresh" %}</button>
|
||||
<button type="button" ng-disabled="savingSettings"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
|
||||
data-modal-toggle="viewprocess"
|
||||
data-modal-hide="viewprocess">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border px-8 py-2 mt-3">
|
||||
<div ng-init="loadLogs('{{ name }}')" class="flex justify-between items-center">
|
||||
<p class="text-xl font-bold">Logs</p>
|
||||
<span style="cursor:pointer;" class="pull-right" ng-click="loadLogs('{{ name }}')"></span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-6 h-6 cursor-pointer">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<textarea name="logs" class="border w-full" id="" cols="30" rows="10">{$ logs $}</textarea><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -3,11 +3,13 @@ from . import views
|
|||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.loadDockerHome, name='dockerHome'),
|
||||
# url(r'^images', views.loadImages, name='loadImages'),
|
||||
# url(r'^images', views.loadImages, name='loadImages'),
|
||||
url(r'^getTags', views.getTags, name='getTags'),
|
||||
url(r'^runContainer', views.runContainer, name='runContainer'),
|
||||
url(r'^V2/runContainerV2', views.runContainerV2, name='runContainerV2'),
|
||||
url(r'^submitContainerCreation', views.submitContainerCreation, name='submitContainerCreation'),
|
||||
url(r'^listContainers', views.listContainers, name='listContainers'),
|
||||
url(r'^V2/listContainersV2', views.listContainersV2, name='listContainersV2'),
|
||||
url(r'^getContainerList', views.getContainerList, name='getContainerList'),
|
||||
url(r'^getContainerLogs', views.getContainerLogs, name='getContainerLogs'),
|
||||
url(r'^installImage', views.installImage, name='installImage'),
|
||||
|
|
@ -20,10 +22,13 @@ urlpatterns = [
|
|||
url(r'^assignContainer', views.assignContainer, name='assignContainer'),
|
||||
url(r'^searchImage', views.searchImage, name='searchImage'),
|
||||
url(r'^manageImages', views.manageImages, name='manageImages'),
|
||||
url(r'^V2/manageImagesV2', views.manageImagesV2, name='manageImagesV2'),
|
||||
url(r'^getImageHistory', views.getImageHistory, name='getImageHistory'),
|
||||
url(r'^removeImage', views.removeImage, name='removeImage'),
|
||||
url(r'^recreateContainer', views.recreateContainer, name='recreateContainer'),
|
||||
url(r'^installDocker', views.installDocker, name='installDocker'),
|
||||
url(r'^images', views.images, name='containerImage'),
|
||||
url(r'^V2/imagesV2', views.imagesV2, name='containerImageV2'),
|
||||
url(r'^view/(?P<name>(.*))$', views.viewContainer, name='viewContainer'),
|
||||
]
|
||||
url(r'^V2/view/(?P<name>(.*))$', views.viewContainerV2, name='viewContainerV2'),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
from django.shortcuts import redirect, HttpResponse
|
||||
|
|
@ -10,14 +10,14 @@ from .decorators import preDockerRun
|
|||
from plogical.acl import ACLManager
|
||||
import json
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
||||
# This function checks if user has admin permissions
|
||||
|
||||
def dockerPermission(request, userID, context):
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
||||
if currentACL['admin'] != 1:
|
||||
if request.method == "POST":
|
||||
return ACLManager.loadErrorJson()
|
||||
|
|
@ -25,7 +25,8 @@ def dockerPermission(request, userID, context):
|
|||
return ACLManager.loadError()
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def loadDockerHome(request):
|
||||
userID = request.session['userID']
|
||||
|
|
@ -34,6 +35,7 @@ def loadDockerHome(request):
|
|||
proc = httpProc(request, template, {"type": admin.type}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def installDocker(request):
|
||||
try:
|
||||
|
||||
|
|
@ -57,7 +59,8 @@ def installDocker(request):
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def installImage(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -75,7 +78,8 @@ def installImage(request):
|
|||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def viewContainer(request, name):
|
||||
try:
|
||||
|
|
@ -97,10 +101,35 @@ def viewContainer(request, name):
|
|||
return coreResult
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def getTags(request):
|
||||
def viewContainerV2(request, name):
|
||||
try:
|
||||
if not request.GET._mutable:
|
||||
request.GET._mutable = True
|
||||
request.GET['name'] = name
|
||||
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
if currentACL['admin'] == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
cm = ContainerManager(name)
|
||||
coreResult = cm.loadContainerHomeV2(request, userID)
|
||||
|
||||
return coreResult
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def getTags(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -117,9 +146,10 @@ def getTags(request):
|
|||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def delContainer(request):
|
||||
def delContainer(request):
|
||||
try:
|
||||
|
||||
userID = request.session['userID']
|
||||
|
|
@ -137,9 +167,10 @@ def delContainer(request):
|
|||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
def recreateContainer(request):
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def recreateContainer(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -155,9 +186,10 @@ def recreateContainer(request):
|
|||
return coreResult
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def runContainer(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -167,13 +199,31 @@ def runContainer(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
return cm.createContainer(request, userID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def runContainerV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
if currentACL['admin'] == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
cm = ContainerManager()
|
||||
return cm.createContainerV2(request, userID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def listContainers(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -182,7 +232,18 @@ def listContainers(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def listContainersV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
cm = ContainerManager()
|
||||
return cm.listContainersV2(request, userID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def getContainerLogs(request):
|
||||
try:
|
||||
|
||||
|
|
@ -199,9 +260,10 @@ def getContainerLogs(request):
|
|||
return coreResult
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def submitContainerCreation(request):
|
||||
try:
|
||||
|
||||
|
|
@ -221,7 +283,8 @@ def submitContainerCreation(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def getContainerList(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -231,13 +294,14 @@ def getContainerList(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
return cm.getContainerList(userID, json.loads(request.body))
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def doContainerAction(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -247,15 +311,16 @@ def doContainerAction(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.doContainerAction(userID, json.loads(request.body))
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def getContainerStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -265,15 +330,16 @@ def getContainerStatus(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.getContainerStatus(userID, json.loads(request.body))
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def exportContainer(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -283,15 +349,16 @@ def exportContainer(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.exportContainer(request, userID)
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def saveContainerSettings(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -301,15 +368,16 @@ def saveContainerSettings(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.saveContainerSettings(userID, json.loads(request.body))
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def getContainerTop(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -319,15 +387,16 @@ def getContainerTop(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.getContainerTop(userID, json.loads(request.body))
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
@preDockerRun
|
||||
def assignContainer(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -337,15 +406,16 @@ def assignContainer(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.assignContainer(userID, json.loads(request.body))
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def searchImage(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -355,27 +425,42 @@ def searchImage(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.searchImage(userID, json.loads(request.body))
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def images(request):
|
||||
try:
|
||||
|
||||
userID = request.session['userID']
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.images(request, userID)
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def imagesV2(request):
|
||||
try:
|
||||
|
||||
userID = request.session['userID']
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.imagesV2(request, userID)
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def manageImages(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -384,8 +469,20 @@ def manageImages(request):
|
|||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def manageImagesV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.manageImagesV2(request, userID)
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def getImageHistory(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -395,15 +492,16 @@ def getImageHistory(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.getImageHistory(userID, json.loads(request.body))
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
@preDockerRun
|
||||
|
||||
|
||||
@preDockerRun
|
||||
def removeImage(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -413,10 +511,10 @@ def removeImage(request):
|
|||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
|
||||
cm = ContainerManager()
|
||||
coreResult = cm.removeImage(userID, json.loads(request.body))
|
||||
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
return redirect(loadLoginPage)
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ from django.conf.urls import url
|
|||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^upload$',views.upload, name='upload'),
|
||||
url(r'^changePermissions$',views.changePermissions, name='changePermissions'),
|
||||
url(r'^controller$',views.controller, name='controller'),
|
||||
url(r'^downloadFile$',views.downloadFile, name='downloadFile'),
|
||||
url(r'^RootDownloadFile$',views.RootDownloadFile, name='RootDownloadFile'),
|
||||
url(r'^upload$', views.upload, name='upload'),
|
||||
url(r'^changePermissions$', views.changePermissions, name='changePermissions'),
|
||||
url(r'^controller$', views.controller, name='controller'),
|
||||
url(r'^downloadFile$', views.downloadFile, name='downloadFile'),
|
||||
url(r'^RootDownloadFile$', views.RootDownloadFile, name='RootDownloadFile'),
|
||||
url(r'^editFile$', views.editFile, name='editFile'),
|
||||
url('^Filemanager', views.FileManagerRoot, name='Filemanager'),
|
||||
url('^V2/FilemanagerV2', views.FileManagerRootV2, name='FilemanagerV2'),
|
||||
url(r'^(?P<domain>(.*))$', views.loadFileManagerHome, name='loadFileManagerHome'),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ def loadFileManagerHome(request, domain):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def loadFileManagerHomeV2(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -267,7 +268,55 @@ def FileManagerRoot(request):
|
|||
return proc.render()
|
||||
|
||||
|
||||
def FileManagerRootV2(request):
|
||||
### Load Custom CSS
|
||||
try:
|
||||
from baseTemplate.models import CyberPanelCosmetic
|
||||
cosmetic = CyberPanelCosmetic.objects.get(pk=1)
|
||||
except:
|
||||
from baseTemplate.models import CyberPanelCosmetic
|
||||
cosmetic = CyberPanelCosmetic()
|
||||
cosmetic.save()
|
||||
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
f = open(ipFile)
|
||||
ipData = f.read()
|
||||
ipAddressLocal = ipData.split('\n', 1)[0]
|
||||
|
||||
try:
|
||||
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
|
||||
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
|
||||
data = {
|
||||
"name": "Filemanager",
|
||||
"IP": ipAddressLocal
|
||||
}
|
||||
|
||||
import requests
|
||||
response = requests.post(url, data=json.dumps(data))
|
||||
Status = response.json()['status']
|
||||
|
||||
if (Status == 1):
|
||||
template = 'baseTemplate/FileManagerV2.html'
|
||||
else:
|
||||
return redirect("https://cyberpanel.net/cyberpanel-addons")
|
||||
else:
|
||||
template = 'baseTemplate/FileManagerV2.html'
|
||||
except BaseException as msg:
|
||||
template = 'baseTemplate/FileManagerV2.html'
|
||||
|
||||
if currentACL['admin'] == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)
|
||||
|
||||
from plogical.httpProc import httpProc
|
||||
proc = httpProc(request, template)
|
||||
return proc.render()
|
||||
|
||||
|
||||
def downloadFile(request):
|
||||
|
|
|
|||
|
|
@ -24,21 +24,21 @@ from plogical.csf import CSF
|
|||
from plogical.processUtilities import ProcessUtilities
|
||||
from serverStatus.serverStatusUtil import ServerStatusUtil
|
||||
|
||||
class FirewallManager:
|
||||
|
||||
class FirewallManager:
|
||||
imunifyPath = '/usr/bin/imunify360-agent'
|
||||
CLPath = '/etc/sysconfig/cloudlinux'
|
||||
imunifyAVPath = '/etc/sysconfig/imunify360/integration.conf'
|
||||
|
||||
def __init__(self, request = None):
|
||||
def __init__(self, request=None):
|
||||
self.request = request
|
||||
|
||||
def securityHome(self, request = None, userID = None):
|
||||
def securityHome(self, request=None, userID=None):
|
||||
proc = httpProc(request, 'firewall/index.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def firewallHome(self, request = None, userID = None):
|
||||
def firewallHome(self, request=None, userID=None):
|
||||
csfPath = '/etc/csf'
|
||||
|
||||
if os.path.exists(csfPath):
|
||||
|
|
@ -48,7 +48,17 @@ class FirewallManager:
|
|||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def getCurrentRules(self, userID = None):
|
||||
def firewallHomeV2(self, request=None, userID=None):
|
||||
csfPath = '/etc/csf'
|
||||
|
||||
if os.path.exists(csfPath):
|
||||
return redirect('/configservercsf/')
|
||||
else:
|
||||
proc = httpProc(request, 'firewall/firewallV2.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def getCurrentRules(self, userID=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -64,12 +74,12 @@ class FirewallManager:
|
|||
|
||||
for items in rules:
|
||||
dic = {
|
||||
'id': items.id,
|
||||
'name': items.name,
|
||||
'proto': items.proto,
|
||||
'port': items.port,
|
||||
'ipAddress': items.ipAddress,
|
||||
}
|
||||
'id': items.id,
|
||||
'name': items.name,
|
||||
'proto': items.proto,
|
||||
'port': items.port,
|
||||
'ipAddress': items.ipAddress,
|
||||
}
|
||||
|
||||
if checker == 0:
|
||||
json_data = json_data + json.dumps(dic)
|
||||
|
|
@ -86,7 +96,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def addRule(self, userID = None, data = None):
|
||||
def addRule(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -95,7 +105,6 @@ class FirewallManager:
|
|||
else:
|
||||
return ACLManager.loadErrorJson('add_status', 0)
|
||||
|
||||
|
||||
ruleName = data['ruleName']
|
||||
ruleProtocol = data['ruleProtocol']
|
||||
rulePort = data['rulePort']
|
||||
|
|
@ -115,7 +124,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def deleteRule(self, userID = None, data = None):
|
||||
def deleteRule(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -125,7 +134,6 @@ class FirewallManager:
|
|||
else:
|
||||
return ACLManager.loadErrorJson('delete_status', 0)
|
||||
|
||||
|
||||
ruleID = data['id']
|
||||
ruleProtocol = data['proto']
|
||||
rulePort = data['port']
|
||||
|
|
@ -145,7 +153,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def reloadFirewall(self, userID = None, data = None):
|
||||
def reloadFirewall(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -173,7 +181,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def startFirewall(self, userID = None, data = None):
|
||||
def startFirewall(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -201,7 +209,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def stopFirewall(self, userID = None, data = None):
|
||||
def stopFirewall(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -229,7 +237,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def firewallStatus(self, userID = None, data = None):
|
||||
def firewallStatus(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -256,12 +264,17 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def secureSSH(self, request = None, userID = None):
|
||||
def secureSSH(self, request=None, userID=None):
|
||||
proc = httpProc(request, 'firewall/secureSSH.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def getSSHConfigs(self, userID = None, data = None):
|
||||
def secureSSHV2(self, request=None, userID=None):
|
||||
proc = httpProc(request, 'firewall/secureSSHV2.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def getSSHConfigs(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -320,8 +333,6 @@ class FirewallManager:
|
|||
key = "ssh-rsa " + keydata[1][:50]
|
||||
userName = ''
|
||||
|
||||
|
||||
|
||||
dic = {'userName': userName,
|
||||
'key': key,
|
||||
}
|
||||
|
|
@ -342,7 +353,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def saveSSHConfigs(self, userID = None, data = None):
|
||||
def saveSSHConfigs(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -361,7 +372,8 @@ class FirewallManager:
|
|||
rootLogin = "0"
|
||||
|
||||
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/firewallUtilities.py"
|
||||
execPath = execPath + " saveSSHConfigs --type " + str(type) + " --sshPort " + sshPort + " --rootLogin " + rootLogin
|
||||
execPath = execPath + " saveSSHConfigs --type " + str(
|
||||
type) + " --sshPort " + sshPort + " --rootLogin " + rootLogin
|
||||
|
||||
output = ProcessUtilities.outputExecutioner(execPath)
|
||||
|
||||
|
|
@ -400,11 +412,11 @@ class FirewallManager:
|
|||
return HttpResponse(final_json)
|
||||
|
||||
except BaseException as msg:
|
||||
final_dic = {'status': 0 ,'saveStatus': 0, 'error_message': str(msg)}
|
||||
final_dic = {'status': 0, 'saveStatus': 0, 'error_message': str(msg)}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def deleteSSHKey(self, userID = None, data = None):
|
||||
def deleteSSHKey(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -434,7 +446,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def addSSHKey(self, userID = None, data = None):
|
||||
def addSSHKey(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -470,7 +482,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def loadModSecurityHome(self, request = None, userID = None):
|
||||
def loadModSecurityHome(self, request=None, userID=None):
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
OLS = 1
|
||||
confPath = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
|
||||
|
|
@ -492,7 +504,29 @@ class FirewallManager:
|
|||
{'modSecInstalled': modSecInstalled, 'OLS': OLS}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def installModSec(self, userID = None, data = None):
|
||||
def loadModSecurityHomeV2(self, request=None, userID=None):
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
OLS = 1
|
||||
confPath = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
|
||||
|
||||
command = "sudo cat " + confPath
|
||||
httpdConfig = ProcessUtilities.outputExecutioner(command).splitlines()
|
||||
|
||||
modSecInstalled = 0
|
||||
|
||||
for items in httpdConfig:
|
||||
if items.find('module mod_security') > -1:
|
||||
modSecInstalled = 1
|
||||
break
|
||||
else:
|
||||
OLS = 0
|
||||
modSecInstalled = 1
|
||||
|
||||
proc = httpProc(request, 'firewall/modSecurityV2.html',
|
||||
{'modSecInstalled': modSecInstalled, 'OLS': OLS}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def installModSec(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -516,7 +550,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def installStatusModSec(self, userID = None, data = None):
|
||||
def installStatusModSec(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
command = "sudo cat " + modSec.installLogPath
|
||||
|
|
@ -570,7 +604,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def fetchModSecSettings(self, userID = None, data = None):
|
||||
def fetchModSecSettings(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -711,7 +745,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def saveModSecConfigurations(self, userID = None, data = None):
|
||||
def saveModSecConfigurations(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -752,7 +786,6 @@ class FirewallManager:
|
|||
|
||||
## writing data temporary to file
|
||||
|
||||
|
||||
tempConfigPath = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
|
||||
confPath = open(tempConfigPath, "w")
|
||||
|
|
@ -808,7 +841,6 @@ class FirewallManager:
|
|||
|
||||
## writing data temporary to file
|
||||
|
||||
|
||||
tempConfigPath = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
|
||||
confPath = open(tempConfigPath, "w")
|
||||
|
|
@ -844,7 +876,7 @@ class FirewallManager:
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
def modSecRules(self, request = None, userID = None):
|
||||
def modSecRules(self, request=None, userID=None):
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
confPath = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
|
||||
|
||||
|
|
@ -864,7 +896,27 @@ class FirewallManager:
|
|||
{'modSecInstalled': modSecInstalled}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def fetchModSecRules(self, userID = None, data = None):
|
||||
def modSecRulesV2(self, request=None, userID=None):
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
confPath = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
|
||||
|
||||
command = "sudo cat " + confPath
|
||||
httpdConfig = ProcessUtilities.outputExecutioner(command).split('\n')
|
||||
|
||||
modSecInstalled = 0
|
||||
|
||||
for items in httpdConfig:
|
||||
if items.find('module mod_security') > -1:
|
||||
modSecInstalled = 1
|
||||
break
|
||||
else:
|
||||
modSecInstalled = 1
|
||||
|
||||
proc = httpProc(request, 'firewall/modSecurityRulesV2.html',
|
||||
{'modSecInstalled': modSecInstalled}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def fetchModSecRules(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -921,7 +973,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def saveModSecRules(self, userID = None, data = None):
|
||||
def saveModSecRules(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -958,7 +1010,7 @@ class FirewallManager:
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
def modSecRulesPacks(self, request = None, userID = None):
|
||||
def modSecRulesPacks(self, request=None, userID=None):
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
|
||||
confPath = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
|
||||
|
|
@ -979,7 +1031,28 @@ class FirewallManager:
|
|||
{'modSecInstalled': modSecInstalled}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def getOWASPAndComodoStatus(self, userID = None, data = None):
|
||||
def modSecRulesPacksV2(self, request=None, userID=None):
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
|
||||
confPath = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
|
||||
|
||||
command = "sudo cat " + confPath
|
||||
httpdConfig = ProcessUtilities.outputExecutioner(command).split('\n')
|
||||
|
||||
modSecInstalled = 0
|
||||
|
||||
for items in httpdConfig:
|
||||
if items.find('module mod_security') > -1:
|
||||
modSecInstalled = 1
|
||||
break
|
||||
else:
|
||||
modSecInstalled = 1
|
||||
|
||||
proc = httpProc(request, 'firewall/modSecurityRulesPacksV2.html',
|
||||
{'modSecInstalled': modSecInstalled}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def getOWASPAndComodoStatus(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -1069,7 +1142,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def installModSecRulesPack(self, userID = None, data = None):
|
||||
def installModSecRulesPack(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
|
@ -1119,7 +1192,7 @@ class FirewallManager:
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
def getRulesFiles(self, userID = None, data = None):
|
||||
def getRulesFiles(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -1255,7 +1328,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def enableDisableRuleFile(self, userID = None, data = None):
|
||||
def enableDisableRuleFile(self, userID=None, data=None):
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
|
|
@ -1307,6 +1380,20 @@ class FirewallManager:
|
|||
{'csfInstalled': csfInstalled}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def csfV2(self):
|
||||
csfInstalled = 1
|
||||
try:
|
||||
command = 'csf -h'
|
||||
output = ProcessUtilities.outputExecutioner(command)
|
||||
if output.find("command not found") > -1:
|
||||
csfInstalled = 0
|
||||
except subprocess.CalledProcessError:
|
||||
csfInstalled = 0
|
||||
|
||||
proc = httpProc(self.request, 'firewall/csfV2.html',
|
||||
{'csfInstalled': csfInstalled}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def installCSF(self):
|
||||
try:
|
||||
userID = self.request.session['userID']
|
||||
|
|
@ -1339,39 +1426,39 @@ class FirewallManager:
|
|||
|
||||
installStatus = ProcessUtilities.outputExecutioner("sudo cat " + CSF.installLogPath)
|
||||
|
||||
if installStatus.find("[200]")>-1:
|
||||
if installStatus.find("[200]") > -1:
|
||||
|
||||
command = 'sudo rm -f ' + CSF.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
final_json = json.dumps({
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
'abort':1,
|
||||
'installed': 1,
|
||||
})
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
'abort': 1,
|
||||
'installed': 1,
|
||||
})
|
||||
return HttpResponse(final_json)
|
||||
elif installStatus.find("[404]") > -1:
|
||||
command = 'sudo rm -f ' + CSF.installLogPath
|
||||
ProcessUtilities.executioner(command)
|
||||
final_json = json.dumps({
|
||||
'abort':1,
|
||||
'installed':0,
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
})
|
||||
'abort': 1,
|
||||
'installed': 0,
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
})
|
||||
return HttpResponse(final_json)
|
||||
|
||||
else:
|
||||
final_json = json.dumps({
|
||||
'abort':0,
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
})
|
||||
'abort': 0,
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
})
|
||||
return HttpResponse(final_json)
|
||||
|
||||
except BaseException as msg:
|
||||
final_dic = {'abort':1, 'installed':0, 'error_message': str(msg)}
|
||||
final_dic = {'abort': 1, 'installed': 0, 'error_message': str(msg)}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
|
|
@ -1413,9 +1500,8 @@ class FirewallManager:
|
|||
|
||||
currentSettings = CSF.fetchCSFSettings()
|
||||
|
||||
|
||||
data_ret = {"fetchStatus": 1, 'testingMode' : currentSettings['TESTING'],
|
||||
'tcpIN' : currentSettings['tcpIN'],
|
||||
data_ret = {"fetchStatus": 1, 'testingMode': currentSettings['TESTING'],
|
||||
'tcpIN': currentSettings['tcpIN'],
|
||||
'tcpOUT': currentSettings['tcpOUT'],
|
||||
'udpIN': currentSettings['udpIN'],
|
||||
'udpOUT': currentSettings['udpOUT'],
|
||||
|
|
@ -1462,7 +1548,7 @@ class FirewallManager:
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def modifyPorts(self, data = None):
|
||||
def modifyPorts(self, data=None):
|
||||
try:
|
||||
|
||||
userID = self.request.session['userID']
|
||||
|
|
@ -1567,6 +1653,37 @@ class FirewallManager:
|
|||
data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def imunifyV2(self):
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
f = open(ipFile)
|
||||
ipData = f.read()
|
||||
ipAddress = ipData.split('\n', 1)[0]
|
||||
|
||||
fullAddress = '%s:%s' % (ipAddress, ProcessUtilities.fetchCurrentPort())
|
||||
|
||||
data = {}
|
||||
data['ipAddress'] = fullAddress
|
||||
|
||||
data['CL'] = 1
|
||||
|
||||
if os.path.exists(FirewallManager.imunifyPath):
|
||||
data['imunify'] = 1
|
||||
else:
|
||||
data['imunify'] = 0
|
||||
|
||||
if data['CL'] == 0:
|
||||
proc = httpProc(self.request, 'firewall/notAvailableV2.html',
|
||||
data, 'admin')
|
||||
return proc.render()
|
||||
elif data['imunify'] == 0:
|
||||
proc = httpProc(self.request, 'firewall/notAvailableV2.html',
|
||||
data, 'admin')
|
||||
return proc.render()
|
||||
else:
|
||||
proc = httpProc(self.request, 'firewall/imunifyV2.html',
|
||||
data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def submitinstallImunify(self):
|
||||
try:
|
||||
userID = self.request.session['userID']
|
||||
|
|
@ -1618,6 +1735,31 @@ class FirewallManager:
|
|||
data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def imunifyAVV2(self):
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
f = open(ipFile)
|
||||
ipData = f.read()
|
||||
ipAddress = ipData.split('\n', 1)[0]
|
||||
|
||||
fullAddress = '%s:%s' % (ipAddress, ProcessUtilities.fetchCurrentPort())
|
||||
|
||||
data = {}
|
||||
data['ipAddress'] = fullAddress
|
||||
|
||||
if os.path.exists(FirewallManager.imunifyAVPath):
|
||||
data['imunify'] = 1
|
||||
else:
|
||||
data['imunify'] = 0
|
||||
|
||||
if data['imunify'] == 0:
|
||||
proc = httpProc(self.request, 'firewall/notAvailableAVV2.html',
|
||||
data, 'admin')
|
||||
return proc.render()
|
||||
else:
|
||||
proc = httpProc(self.request, 'firewall/imunifyAVV2.html',
|
||||
data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def submitinstallImunifyAV(self):
|
||||
try:
|
||||
userID = self.request.session['userID']
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,253 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="csfV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">CSF (ConfigServer Security and Firewall)!</p>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can configure CSF (ConfigServer
|
||||
Security and Firewall) settings.</p>
|
||||
</div>
|
||||
{% if csfInstalled == 0 %}
|
||||
<div class="border px-8 py-2">
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">CSF</p>
|
||||
<img ng-hide="csfLoading" src="/static/images/loading.gif">
|
||||
</div>
|
||||
<div class="flex justify-center mt-3">
|
||||
<p>CSF is not installed</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex justify-center mt-2 mb-4">
|
||||
<button ng-click="installCSF()"
|
||||
class="bg-orange-500 text-white font-semibold px-4 py-1 text-xl">
|
||||
<div class="flex">
|
||||
<p>Install Now</p>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div ng-hide="modSecNotifyBox" class="form-group">
|
||||
<div class="col-sm-6">
|
||||
<div ng-hide="failedToStartInallation"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Failed to start installation, Error message: " %} {$ errorMessage
|
||||
$}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
||||
</div>
|
||||
<div ng-hide="installationFailed"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Installation failed." %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="modSecSuccessfullyInstalled"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "CSF successfully installed, refreshing page in 3 seconds.." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="modeSecInstallBox">
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div class="flex justify-center items-center py-2">
|
||||
<img src="{% static 'firewall/icons/firewall.png' %}">
|
||||
<p class="px-2">In winter we must protect each other..</p>
|
||||
<img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
||||
</div>
|
||||
<div>
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div>
|
||||
<ul class="flex justify-end bg-gray-100 py-2 mt-4 text-xl font-semibold text-gray-600 px-4 gap-8">
|
||||
{# <li>#}
|
||||
{# <div class="flex items-center">#}
|
||||
{# <p class="text-xl font-bold">CSF</p>#}
|
||||
{# <img ng-hide="csfLoading" src="/static/images/loading.gif">#}
|
||||
{# </div>#}
|
||||
{# </li>#}
|
||||
<li class="hover:text-orange-600 active"><a href="#" onclick="showTab('tab1')" aria-selected="true">General</a>
|
||||
</li>
|
||||
<li class="hover:text-orange-600"><a href="#" ng-click="GetCurrentPlugins()"
|
||||
onclick="showTab('tab2')">CSF</a></li>
|
||||
<li class="hover:text-orange-600"><a href="#" ng-click="GetCurrentThemes()"
|
||||
onclick="showTab('tab3')">LDF</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="tab1" class="tab-content">
|
||||
<div id="general">
|
||||
<form id="createPackages">
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Remove CSF</p>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<div class="flex justify-center">
|
||||
<button ng-click="removeCSF()"
|
||||
class="bg-orange-500 text-white font-semibold px-4 py-1">
|
||||
<div class="flex">
|
||||
<p>Completely Remove CSF</p>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Firewall</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" id="firewallStatus" value="" class="sr-only peer">
|
||||
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Testing Mode</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" id="testingMode" value="" class="sr-only peer">
|
||||
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">TCP IN Ports</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="tcpOUT"
|
||||
required>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<button type="button" ng-click="modifyPorts('TCP_OUT')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25M9 16.5v.75m3-3v3M15 12v5.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">TCP Out Ports</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="tcpOUT">
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<button type="button" ng-click="modifyPorts('TCP_OUT')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25M9 16.5v.75m3-3v3M15 12v5.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">UDP In Ports</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="udpIN">
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<button type="button" ng-click="modifyPorts('UDP_IN')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25M9 16.5v.75m3-3v3M15 12v5.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">UDP Out Ports</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="udpOUT">
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<button type="button" ng-click="modifyPorts('UDP_OUT')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25M9 16.5v.75m3-3v3M15 12v5.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab2" class="tab-content" style="display: none;">
|
||||
<div id="csf">
|
||||
<form id="createPackages">
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Allow IP</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="allowIP">
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<button type="button" ng-click="modifyIPs('allowIP')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25M9 16.5v.75m3-3v3M15 12v5.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Block IP Address</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="blockIP">
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<button type="button" ng-click="modifyIPs('blockIP')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25M9 16.5v.75m3-3v3M15 12v5.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab3" class="tab-content" style="display: none;">
|
||||
<div id="lfd">
|
||||
<p class="font-semibold w-60">Comming Soon..</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="firewallControllerV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">Add/Delete Firewall Rules</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can add/delete firewall rules. (By
|
||||
default all ports are blocked, except mentioned below)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Add/Delete Rules</p>
|
||||
<img ng-hide="rulesLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="flex justify-center gap-2 py-4">
|
||||
<a class="bg-orange-500 text-white font-semibold px-2 py-1" href="">Status <span class="font-bold">{$ status
|
||||
$}</span></a>
|
||||
<a ng-click="startFirewall()" href="#" class="bg-green-500 text-white font-semibold px-2 py-1" title="">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
|
||||
<path fill-rule="evenodd"
|
||||
d="M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z"
|
||||
clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</a>
|
||||
<a ng-click="stopFirewall()" href="#" class="bg-red-500 text-white font-semibold px-2 py-1" title="">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
|
||||
<path fill-rule="evenodd"
|
||||
d="M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z"
|
||||
clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</a>
|
||||
<a ng-click="reloadFireWall()" href="#" class="bg-blue-500 text-white font-semibold px-2 py-1" title="">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
|
||||
<path fill-rule="evenodd"
|
||||
d="M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z"
|
||||
clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div ng-hide="actionFailed"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Action failed. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="actionSuccess"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Action successful." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div ng-hide="rulesDetails" class="flex mt-4 py-2 px-6 gap-2">
|
||||
<div>
|
||||
<input placeholder="Rule Name" type="text" class="bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="ruleName"
|
||||
required>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-model="ruleProtocol" class="bg-gray-100 rounded px-2 py-1">
|
||||
<option>tcp</option>
|
||||
<option>udp</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<input placeholder="IP -> 0.0.0.0/0 for All IPs" type="text" class="bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="ruleIP" required>
|
||||
</div>
|
||||
<div>
|
||||
<input placeholder="Port" type="text" class="bg-gray-100 rounded px-2 py-1" ng-model="rulePort"
|
||||
required>
|
||||
</div>
|
||||
<div>
|
||||
<button ng-click="addRule()" class="bg-orange-500 text-white font-semibold px-2 py-1">
|
||||
ADD
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div ng-hide="rulesDetails" class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
ID
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Protocol
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
IP Address
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Port
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Delete
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="rule in rules track by $index"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td ng-bind="rule.id" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-bind="rule.name" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-bind="rule.proto" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-bind="rule.ipAddress" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-bind="rule.port" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-click="deleteRule(rule.id,rule.proto,rule.port,rule.ipAddress)"
|
||||
class="px-6 py-4">
|
||||
<button class="bg-red-500 ml-2 px-2 py-1 rounded text-white font-bold">X</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="installImunifyAVV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">ImunifyAV -</p>
|
||||
<a target="_blank"
|
||||
href="https://go.cyberpanel.net/imunify"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "Imunify Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Access ImunifyAV</p>
|
||||
</div>
|
||||
<div class="py-4">
|
||||
<p class="text-xl font-bold">ImunifyAV</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">ImunifyAV is now integrated via their new API. You can
|
||||
manage Imunify by clicking below. You can use your server root credentials to access Imunify.</p>
|
||||
<div class="flex justify-center py-2">
|
||||
<a target="_blank" href="/imunifyav">
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1">
|
||||
Access Now
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">ImunifyAV Not working?</p>
|
||||
<img ng-hide="installDockerStatus"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">If for some reason ImunifyAV is not working, you can
|
||||
re-install it using the form below.</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="alert alert-info">
|
||||
<div class="bg-black alert-icon">
|
||||
<i class="glyph-icon icon-comment"></i>
|
||||
</div>
|
||||
<div class="alert-content">
|
||||
<h4 class="alert-title">We will run following commands again:</h4>
|
||||
<br>
|
||||
<p><code>wget https://repo.imunify360.cloudlinux.com/defence360/imav-deploy.sh</code></p>
|
||||
<br>
|
||||
<p><code>bash imav-deploy.sh</code></p>
|
||||
<br>
|
||||
|
||||
<p>If you can still not access ImunifyAV after re-installation, just run
|
||||
the above commands on your server terminal.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="mt-2" ng-hide="installBoxGen">
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div class="form-group">
|
||||
<div class="mt-2">
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div ng-hide="dockerInstallBTN" ng-hide="installationDetailsForm" class="flex justify-center py-2">
|
||||
<button ng-click="submitinstallImunify()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1">
|
||||
Install Now
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="installImunifyV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Imunify -</p>
|
||||
<a target="_blank"
|
||||
href="https://go.cyberpanel.net/imunify"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "Imunify Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Access Imunify</p>
|
||||
</div>
|
||||
<div class="py-4">
|
||||
<p class="text-xl font-bold">Imunify</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Imunify is now integrated via their new API. You can
|
||||
manage Imunify by clicking below. You can use your server root credentials to access Imunify. Login
|
||||
details for Imunify360 is your server root and its password.</p>
|
||||
<div class="flex justify-center py-2">
|
||||
<a target="_blank" href="/imunifyV2">
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1">
|
||||
Access Now
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Imunify360 Not working?</p>
|
||||
<img ng-hide="installDockerStatus" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">If for some reason Imunify360 is not working, you can
|
||||
re-install it using the form below.</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="alert alert-info">
|
||||
<div class="bg-black alert-icon">
|
||||
<i class="glyph-icon icon-comment"></i>
|
||||
</div>
|
||||
<div class="alert-content">
|
||||
<h4 class="alert-title">We will run following commands again:</h4>
|
||||
<br>
|
||||
<p><code>wget https://repo.imunify360.cloudlinux.com/defence360/i360deploy.sh -O
|
||||
i360deploy.sh</code></p>
|
||||
<br>
|
||||
<p><code>bash i360deploy.sh --key YOUR_KEY --yes</code></p>
|
||||
<br>
|
||||
|
||||
<p>If you can still not access Imunify360 after re-installation, just run
|
||||
the above commands on your server terminal, make sure to replace <code>YOUR_KEY</code>
|
||||
with your
|
||||
Imunify360 Key.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="mt-2" ng-hide="installBoxGen">
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div class="form-group">
|
||||
<div class="mt-2">
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div ng-hide="dockerInstallBTN" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Imunify Key</p>
|
||||
</div>
|
||||
<div>
|
||||
<input name="key" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="key"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="dockerInstallBTN" ng-hide="installationDetailsForm" class="flex justify-center py-2">
|
||||
<button ng-click="submitinstallImunify()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1">
|
||||
Re-Install Now
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="modSecRulesPackV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">ModSecurity Rules Packages! -</p>
|
||||
<a target="_blank" href="http://go.cyberpanel.net/modsec-docs"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "ModSec Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Install/Un-install ModSecurity rules packages.</p>
|
||||
</div>
|
||||
<div class="border px-8 py-2">
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">ModSecurity Rules Packages!</p>
|
||||
<img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
||||
</div>
|
||||
<div>
|
||||
{% if modSecInstalled == 0 %}
|
||||
<div class="flex justify-center mt-3">
|
||||
<p>ModSecurity is not installed</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'modSecurity' %}">
|
||||
<div class="flex justify-center mt-2 mb-4">
|
||||
<button ng-click="saveChanges()"
|
||||
class="bg-orange-500 text-white font-semibold px-4 py-1 text-xl">
|
||||
<div class="flex">
|
||||
<p>Install Now</p>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table id="datatable-example" class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Package
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Status
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="px-6 py-4">OWASP ModSecurity Core Rules</td>
|
||||
<td class="px-6 py-4">
|
||||
<div>
|
||||
<label class="relative inline-flex items-center cursor-pointer mt-1">
|
||||
<input id="owaspInstalled" type="checkbox" value=""
|
||||
class="sr-only peer">
|
||||
<div class="w-11 h-6 bg-gray-200 rounded-full peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-600">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<button type="button" ng-disabled="owaspDisable" ng-click="fetchRulesFile('owasp')"
|
||||
class="bg-orange-500 text-white font-semibold px-2 py-1">{% trans "Configure" %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div ng-hide="installationQuote"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Operation successful." %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
||||
</div>
|
||||
<div ng-hide="installationFailed"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Operation failed, Error message: " %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="installationSuccess"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Operation successful." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="ruleFiles" class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
ID
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Supplier
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Filename
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Status
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="record in records track by $index"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td ng-bind="record.id" class="px-6 py-4"></td>
|
||||
<td ng-bind="record.packName" class="px-6 py-4"></td>
|
||||
<td ng-bind="record.fileName" class="px-6 py-4"></td>
|
||||
<td class="px-6 py-4">
|
||||
<input ng-click="removeRuleFile(record.fileName,record.packName,record.status)"
|
||||
ng-checked="record.status" type="checkbox">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="modSecRulesV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">ModSecurity Rules! -</p>
|
||||
<a target="_blank" href="http://go.cyberpanel.net/modsec-docs"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "ModSec Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can add/delete ModSecurity rules.</p>
|
||||
</div>
|
||||
<div class="border px-8 py-2">
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">ModSecurity Rules</p>
|
||||
<img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
||||
</div>
|
||||
<div>
|
||||
{% if modSecInstalled == 1 %}
|
||||
<div>
|
||||
<textarea ng-model="currentModSecRules" rows="15" class="w-full border"></textarea>
|
||||
</div>
|
||||
<div class="flex justify-center mt-2">
|
||||
<button ng-click="saveModSecRules()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Save Rules!
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div ng-hide="rulesSaved"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "ModSecurity Rules Saved" %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
||||
</div>
|
||||
<div ng-hide="couldNotSave"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not save rules, Error message: " %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="flex justify-center mt-3">
|
||||
<p>ModSecurity is not installed</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'modSecurity' %}">
|
||||
<div class="flex justify-center mt-2 mb-4">
|
||||
<button ng-click="saveChanges()"
|
||||
class="bg-orange-500 text-white font-semibold px-4 py-1 text-xl">
|
||||
<div class="flex">
|
||||
<p>Install Now</p>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,381 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% if OLS %}
|
||||
<div ng-controller="modSecV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">ModSecurity Configurations! -</p>
|
||||
<a target="_blank"
|
||||
href="http://go.cyberpanel.net/modsec-docs"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "ModSec Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can configure ModSecurity
|
||||
settings.</p>
|
||||
</div>
|
||||
<div class="border px-8 py-2">
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">ModSecurity</p>
|
||||
<img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
||||
</div>
|
||||
<div>
|
||||
{% if modSecInstalled == 0 %}
|
||||
<div class="flex justify-center mt-3">
|
||||
<p>ModSecurity is not installed</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'modSecurity' %}">
|
||||
<div class="flex justify-center mt-2 mb-4">
|
||||
<button ng-click="installModSec()"
|
||||
class="bg-orange-500 text-white font-semibold px-4 py-1 text-xl">
|
||||
<div class="flex">
|
||||
<p>Install Now</p>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div ng-hide="modSecNotifyBox" class="form-group">
|
||||
<div class="col-sm-6">
|
||||
<div ng-hide="failedToStartInallation"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Failed to start installation, Error message: " %} {$
|
||||
errorMessage
|
||||
$}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
||||
</div>
|
||||
<div ng-hide="installationFailed" class="alert alert-danger">
|
||||
<p>{% trans "Installation failed." %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="modSecSuccessfullyInstalled"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "ModSecurity successfully installed, refreshing page in 3 seconds.." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="modeSecInstallBox">
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div class="flex justify-center">
|
||||
<h3><img
|
||||
src="{% static 'firewall/icons/firewall.png' %}"> {% trans "Winter is coming, but so is ModSecurity." %}
|
||||
<img ng-hide="modsecLoading" src="/static/images/loading.gif"></h3>
|
||||
</div>
|
||||
<div>
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<form action="/" id="createPackages">
|
||||
<div ng-hide="phpDetailsBox" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">ModSecurity Status</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="relative inline-flex items-center cursor-pointer mt-1">
|
||||
<input id="modsecurity_status" type="checkbox" value=""
|
||||
class="sr-only peer">
|
||||
<div class="w-11 h-6 bg-gray-200 rounded-full peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-600">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecAuditEngine</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="relative inline-flex items-center cursor-pointer mt-1">
|
||||
<input id="SecAuditEngine" type="checkbox" value=""
|
||||
class="sr-only peer">
|
||||
<div class="w-11 h-6 bg-gray-200 rounded-full peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-600">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecRuleEngine</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="relative inline-flex items-center cursor-pointer mt-1">
|
||||
<input id="SecRuleEngine" type="checkbox" value=""
|
||||
class="sr-only peer">
|
||||
<div class="w-11 h-6 bg-gray-200 rounded-full peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-600">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecDebugLogLevel</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="selector" style="width: 79px;">
|
||||
{# <span style="width: 57px; -moz-user-select: none;">{$ SecDebugLogLevel$}</span>#}
|
||||
<select ng-model="SecDebugLogLevel" class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
<option>0</option>
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
<option>6</option>
|
||||
<option>7</option>
|
||||
<option>8</option>
|
||||
<option>9</option>
|
||||
</select><i class="glyph-icon icon-caret-down"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecAuditLogParts</p>
|
||||
</div>
|
||||
<div>
|
||||
<input placeholder="ABIJDEFHZ" type="text"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="SecAuditLogParts" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecAuditLogRelevantStatus</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="SecAuditLogRelevantStatus"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecAuditLogType</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="SecAuditLogType"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center mt-6">
|
||||
<button ng-click="saveModSecConfigurations()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Save Changes
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div class="col-sm-4">
|
||||
<div ng-hide="failedToSave"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Failed to save ModSecurity configurations. Error message: " %}
|
||||
{$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="successfullySaved"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "ModSecurity configurations successfully saved." %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<div ng-controller="modSecV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">ModSecurity Configurations! -</p>
|
||||
<a target="_blank"
|
||||
href="http://go.cyberpanel.net/modsec-docs"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "ModSec Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can configure ModSecurity
|
||||
settings.</p>
|
||||
</div>
|
||||
<div class="border px-8 py-2">
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">ModSecurity</p>
|
||||
<img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
||||
</div>
|
||||
<div>
|
||||
{% if modSecInstalled == 0 %}
|
||||
<div class="flex justify-center mt-3">
|
||||
<p>ModSecurity is not installed</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'modSecurity' %}">
|
||||
<div class="flex justify-center mt-2 mb-4">
|
||||
<button ng-click="installModSec()"
|
||||
class="bg-orange-500 text-white font-semibold px-4 py-1 text-xl">
|
||||
<div class="flex">
|
||||
<p>Install Now</p>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div ng-hide="modSecNotifyBox" class="form-group">
|
||||
<div class="col-sm-6">
|
||||
<div ng-hide="failedToStartInallation"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Failed to start installation, Error message: " %} {$
|
||||
errorMessage
|
||||
$}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
||||
</div>
|
||||
<div ng-hide="installationFailed" class="alert alert-danger">
|
||||
<p>{% trans "Installation failed." %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="modSecSuccessfullyInstalled"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "ModSecurity successfully installed, refreshing page in 3 seconds.." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="modeSecInstallBox">
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div class="flex justify-center">
|
||||
<h3><img
|
||||
src="{% static 'firewall/icons/firewall.png' %}"> {% trans "Winter is coming, but so is ModSecurity." %}
|
||||
<img ng-hide="modsecLoading" src="/static/images/loading.gif"></h3>
|
||||
</div>
|
||||
<div>
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<form action="/" id="createPackages">
|
||||
<div ng-hide="phpDetailsBox" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecAuditEngine</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="relative inline-flex items-center cursor-pointer mt-1">
|
||||
<input id="SecAuditEngine" type="checkbox" value=""
|
||||
class="sr-only peer">
|
||||
<div class="w-11 h-6 bg-gray-200 rounded-full peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-600">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecRuleEngine</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="relative inline-flex items-center cursor-pointer mt-1">
|
||||
<input id="SecRuleEngine" type="checkbox" value=""
|
||||
class="sr-only peer">
|
||||
<div class="w-11 h-6 bg-gray-200 rounded-full peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-600">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecDebugLogLevel</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="selector" style="width: 79px;">
|
||||
{# <span style="width: 57px; -moz-user-select: none;">{$ SecDebugLogLevel$}</span>#}
|
||||
<select ng-model="SecDebugLogLevel" class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
<option>0</option>
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
<option>6</option>
|
||||
<option>7</option>
|
||||
<option>8</option>
|
||||
<option>9</option>
|
||||
</select><i class="glyph-icon icon-caret-down"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecAuditLogParts</p>
|
||||
</div>
|
||||
<div>
|
||||
<input placeholder="ABIJDEFHZ" type="text"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="SecAuditLogParts" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecAuditLogRelevantStatus</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="SecAuditLogRelevantStatus"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SecAuditLogType</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="SecAuditLogType"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center mt-6">
|
||||
<button ng-click="saveModSecConfigurations()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Save Changes
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div class="col-sm-4">
|
||||
<div ng-hide="failedToSave"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Failed to save ModSecurity configurations. Error message: " %}
|
||||
{$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="successfullySaved"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "ModSecurity configurations successfully saved." %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="installImunifyV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Not available -</p>
|
||||
<a target="_blank"
|
||||
href="https://go.cyberpanel.net/imunify"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "Imunify Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">ImunifyAV is not installed</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-5">
|
||||
<div class="border py-3 px-5">
|
||||
<div>
|
||||
<div class="flex items-center py-2">
|
||||
<p class="text-xl font-bold">Activate Now</p>
|
||||
<img ng-hide="installDockerStatus"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">"Imunify is not installed, click to install
|
||||
now.</p>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<div class="mt-2" ng-hide="installBoxGen">
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div class="form-group">
|
||||
<div class="mt-2">
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div ng-hide="dockerInstallBTN" ng-hide="installationDetailsForm"
|
||||
class="flex justify-center py-2">
|
||||
<button ng-click="submitinstallImunify()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1">
|
||||
Install Now
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="installImunifyV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Not available -</p>
|
||||
<a target="_blank"
|
||||
href="https://go.cyberpanel.net/imunify"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "Imunify Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Either Imunify is not installed or you are not on
|
||||
CloudLinux OS.</p>
|
||||
</div>
|
||||
{% if not CL %}
|
||||
<div class="py-4">
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">CloudLinux is not installed on your server.
|
||||
<a target="_blank"
|
||||
href="https://go.cyberpanel.net/CLConvert">Click
|
||||
Here</a>for conversion details.</p>
|
||||
{% else %}
|
||||
</div>
|
||||
<div class="px-5">
|
||||
<div class="border py-3 px-5">
|
||||
<div>
|
||||
<div class="flex items-center py-2">
|
||||
<p class="text-xl font-bold">Activate Now</p>
|
||||
<img ng-hide="installDockerStatus"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">"Imunify is not installed, click to install
|
||||
now.</p>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<div class="mt-2" ng-hide="installBoxGen">
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div class="form-group">
|
||||
<div class="mt-2">
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<form action="/" id="" class="form-horizontal bordered-row">
|
||||
<div ng-hide="dockerInstallBTN" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Imunify Key</p>
|
||||
</div>
|
||||
<div>
|
||||
<input name="key" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
ng-model="key"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="dockerInstallBTN" ng-hide="installationDetailsForm"
|
||||
class="flex justify-center py-2">
|
||||
<button ng-click="submitinstallImunify()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1">
|
||||
Install Now
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="secureSSHCTRLV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Secure SSH -</p>
|
||||
<a target="_blank" href="http://go.cyberpanel.net/ssh-docs"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "SSH Docs" %}</span></a>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Secure or harden SSH Configurations.</p>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Secure SSH</p>
|
||||
<img ng-hide="secureSSHLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<div>
|
||||
<ul class="flex py-2">
|
||||
<li id="dns_tab_button"
|
||||
class="hover:bg-orange-200 border-2 border-black rounded-l-3xl px-2 py-2 w-60 cursor-pointer active"
|
||||
onclick="showTab1('basic')">
|
||||
<a class="flex justify-center">
|
||||
<p class="text-2xl font-bold">Basic</p>
|
||||
</a>
|
||||
</li>
|
||||
<li id="api_tab_button"
|
||||
class="hover:bg-orange-200 border-2 border-black rounded-r-3xl px-2 py-2 w-60 cursor-pointer"
|
||||
onclick="showTab1('ssh_keys')">
|
||||
<a class="flex justify-center">
|
||||
<p class="text-2xl font-bold">SSH Keys</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<div id="basic" class="tab-content1">
|
||||
<div>
|
||||
<div>
|
||||
<div ng-hide="emailDetails" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SSH Port</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="sshPort"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Permit Root Login</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" id="rootLogin" value="" class="sr-only peer">
|
||||
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60"></p>
|
||||
</div>
|
||||
<div class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Before disabling root login, make sure you have another account with sudo priviliges on server." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center mt-6">
|
||||
<button ng-click="saveChanges()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Save Changes
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div>
|
||||
<div ng-hide="couldNotSave"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Error message: " %}{$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="detailsSaved"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "SSH Configurations Saved." %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ssh_keys" class="tab-content1" style="display: none;">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Username
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Key
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Delete
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<hr>
|
||||
<tbody ng-repeat="record in records track by $index"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td ng-bind="record.userName" class="px-8 py-4 font-bold">
|
||||
root
|
||||
</td>
|
||||
<td ng-bind="record.key" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-click="deleteKey(record.key)" class="px-6 py-4">
|
||||
<button class="bg-red-500 ml-2 px-2 py-1 rounded text-white font-bold">X</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div ng-hide="keyBox" class="mt-2">
|
||||
<textarea placeholder="Paste your public key here..." ng-model="keyData"
|
||||
rows="6" class="w-full border">{{ logs }}</textarea>
|
||||
</div>
|
||||
<div ng-hide="showKeyBox" class="flex justify-center mt-2">
|
||||
<button ng-click="addKey()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Add Key
|
||||
</button>
|
||||
</div>
|
||||
<div ng-hide="saveKeyBtn" class="flex justify-center mt-2">
|
||||
<button ng-click="saveKey()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4">
|
||||
<div ng-hide="keyDeleted"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "SSH Key Deleted" %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -4,11 +4,11 @@ from . import views
|
|||
urlpatterns = [
|
||||
url(r'^securityHome', views.securityHome, name='securityHome'),
|
||||
url(r'^$', views.firewallHome, name='firewallHome'),
|
||||
url(r'^V2/V2$', views.firewallHomeV2, name='firewallHomeV2'),
|
||||
url(r'^getCurrentRules', views.getCurrentRules, name='getCurrentRules'),
|
||||
url(r'^addRule', views.addRule, name='addRule'),
|
||||
url(r'^deleteRule', views.deleteRule, name='deleteRule'),
|
||||
|
||||
|
||||
url(r'^reloadFirewall', views.reloadFirewall, name='reloadFirewall'),
|
||||
url(r'^stopFirewall', views.stopFirewall, name='stopFirewall'),
|
||||
url(r'^startFirewall', views.startFirewall, name='startFirewall'),
|
||||
|
|
@ -17,23 +17,26 @@ urlpatterns = [
|
|||
## secure SSH
|
||||
|
||||
url(r'^secureSSH', views.secureSSH, name='secureSSH'),
|
||||
url(r'^V2/secureSSHV2', views.secureSSHV2, name='secureSSHV2'),
|
||||
url(r'^getSSHConfigs', views.getSSHConfigs, name='getSSHConfigs'),
|
||||
url(r'^saveSSHConfigs', views.saveSSHConfigs, name='saveSSHConfigs'),
|
||||
url(r'^deleteSSHKey', views.deleteSSHKey, name='deleteSSHKey'),
|
||||
url(r'^addSSHKey', views.addSSHKey, name='addSSHKey'),
|
||||
|
||||
|
||||
## ModSecurity
|
||||
|
||||
url(r'^modSecurity$', views.loadModSecurityHome, name='modSecurity'),
|
||||
url(r'^V2/modSecurityV2$', views.loadModSecurityHomeV2, name='modSecurityV2'),
|
||||
url(r'^installModSec$', views.installModSec, name='installModSec'),
|
||||
url(r'^installStatusModSec$', views.installStatusModSec, name='installStatusModSec'),
|
||||
url(r'^fetchModSecSettings$', views.fetchModSecSettings, name='fetchModSecSettings'),
|
||||
url(r'^saveModSecConfigurations$', views.saveModSecConfigurations, name='saveModSecConfigurations'),
|
||||
url(r'^modSecRules$', views.modSecRules, name='modSecRules'),
|
||||
url(r'^V2/modSecRulesV2$', views.modSecRulesV2, name='modSecRulesV2'),
|
||||
url(r'^fetchModSecRules$', views.fetchModSecRules, name='fetchModSecRules'),
|
||||
url(r'^saveModSecRules$', views.saveModSecRules, name='saveModSecRules'),
|
||||
url(r'^modSecRulesPacks$', views.modSecRulesPacks, name='modSecRulesPacks'),
|
||||
url(r'^V2/modSecRulesPacksV2$', views.modSecRulesPacksV2, name='modSecRulesPacksV2'),
|
||||
url(r'^getOWASPAndComodoStatus$', views.getOWASPAndComodoStatus, name='getOWASPAndComodoStatus'),
|
||||
url(r'^installModSecRulesPack$', views.installModSecRulesPack, name='installModSecRulesPack'),
|
||||
url(r'^getRulesFiles$', views.getRulesFiles, name='getRulesFiles'),
|
||||
|
|
@ -42,6 +45,7 @@ urlpatterns = [
|
|||
## CSF
|
||||
|
||||
url(r'^csf$', views.csf, name='csf'),
|
||||
url(r'^V2/csfV2$', views.csfV2, name='csfV2'),
|
||||
url(r'^installCSF$', views.installCSF, name='installCSF'),
|
||||
url(r'^installStatusCSF$', views.installStatusCSF, name='installStatusCSF'),
|
||||
url(r'^removeCSF$', views.removeCSF, name='removeCSF'),
|
||||
|
|
@ -54,14 +58,13 @@ urlpatterns = [
|
|||
## Imunify
|
||||
|
||||
url(r'^imunify$', views.imunify, name='imunify'),
|
||||
url(r'^V2/imunifyV2$', views.imunifyV2, name='imunifyV2'),
|
||||
url(r'^submitinstallImunify$', views.submitinstallImunify, name='submitinstallImunify'),
|
||||
|
||||
## ImunifyAV
|
||||
|
||||
url(r'^imunifyAV$', views.imunifyAV, name='imunifyAV'),
|
||||
url(r'^V2/imunifyAVV2$', views.imunifyAVV2, name='imunifyAVV2'),
|
||||
url(r'^submitinstallImunifyAV$', views.submitinstallImunifyAV, name='submitinstallImunifyAV'),
|
||||
|
||||
|
||||
|
||||
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import json
|
|||
from loginSystem.views import loadLoginPage
|
||||
from .firewallManager import FirewallManager
|
||||
from .pluginManager import pluginManager
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
||||
|
||||
|
|
@ -14,6 +16,7 @@ def securityHome(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def firewallHome(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -32,6 +35,26 @@ def firewallHome(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def firewallHomeV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preFirewallHome(request)
|
||||
if result != 200:
|
||||
return result
|
||||
fm = FirewallManager()
|
||||
coreResult = fm.firewallHomeV2(request, userID)
|
||||
|
||||
result = pluginManager.postFirewallHome(request, coreResult)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getCurrentRules(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -40,6 +63,7 @@ def getCurrentRules(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def addRule(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -59,6 +83,7 @@ def addRule(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def deleteRule(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -78,6 +103,7 @@ def deleteRule(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def reloadFirewall(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -97,6 +123,7 @@ def reloadFirewall(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def startFirewall(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -116,6 +143,7 @@ def startFirewall(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def stopFirewall(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -124,7 +152,6 @@ def stopFirewall(request):
|
|||
if result != 200:
|
||||
return result
|
||||
|
||||
|
||||
fm = FirewallManager()
|
||||
coreResult = fm.stopFirewall(userID)
|
||||
|
||||
|
|
@ -136,6 +163,7 @@ def stopFirewall(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def firewallStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -155,6 +183,7 @@ def firewallStatus(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def secureSSH(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -174,6 +203,27 @@ def secureSSH(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def secureSSHV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preSecureSSH(request)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
fm = FirewallManager()
|
||||
coreResult = fm.secureSSHV2(request, userID)
|
||||
|
||||
result = pluginManager.postSecureSSH(request, coreResult)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getSSHConfigs(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -182,6 +232,7 @@ def getSSHConfigs(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveSSHConfigs(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -201,6 +252,7 @@ def saveSSHConfigs(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def deleteSSHKey(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -219,6 +271,7 @@ def deleteSSHKey(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def addSSHKey(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -238,6 +291,7 @@ def addSSHKey(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def loadModSecurityHome(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -257,6 +311,27 @@ def loadModSecurityHome(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def loadModSecurityHomeV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preLoadModSecurityHome(request)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
fm = FirewallManager()
|
||||
coreResult = fm.loadModSecurityHomeV2(request, userID)
|
||||
|
||||
result = pluginManager.postLoadModSecurityHome(request, coreResult)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installModSec(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -265,6 +340,7 @@ def installModSec(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installStatusModSec(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -273,6 +349,7 @@ def installStatusModSec(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchModSecSettings(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -281,6 +358,7 @@ def fetchModSecSettings(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveModSecConfigurations(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -300,6 +378,7 @@ def saveModSecConfigurations(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def modSecRules(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -319,6 +398,27 @@ def modSecRules(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def modSecRulesV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preModSecRules(request)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
fm = FirewallManager()
|
||||
coreResult = fm.modSecRulesV2(request, userID)
|
||||
|
||||
result = pluginManager.postModSecRules(request, coreResult)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchModSecRules(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -327,6 +427,7 @@ def fetchModSecRules(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveModSecRules(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -346,6 +447,7 @@ def saveModSecRules(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def modSecRulesPacks(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -365,6 +467,27 @@ def modSecRulesPacks(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def modSecRulesPacksV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preModSecRulesPacks(request)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
fm = FirewallManager()
|
||||
coreResult = fm.modSecRulesPacksV2(request, userID)
|
||||
|
||||
result = pluginManager.postModSecRulesPacks(request, coreResult)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getOWASPAndComodoStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -384,6 +507,7 @@ def getOWASPAndComodoStatus(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installModSecRulesPack(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -403,6 +527,7 @@ def installModSecRulesPack(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getRulesFiles(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -422,6 +547,7 @@ def getRulesFiles(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def enableDisableRuleFile(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -441,6 +567,7 @@ def enableDisableRuleFile(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def csf(request):
|
||||
try:
|
||||
|
||||
|
|
@ -459,6 +586,26 @@ def csf(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def csfV2(request):
|
||||
try:
|
||||
|
||||
result = pluginManager.preCSF(request)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
fm = FirewallManager(request)
|
||||
coreResult = fm.csfV2()
|
||||
|
||||
result = pluginManager.postCSF(request, coreResult)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
return coreResult
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installCSF(request):
|
||||
try:
|
||||
fm = FirewallManager(request)
|
||||
|
|
@ -466,6 +613,7 @@ def installCSF(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installStatusCSF(request):
|
||||
try:
|
||||
fm = FirewallManager(request)
|
||||
|
|
@ -473,6 +621,7 @@ def installStatusCSF(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def removeCSF(request):
|
||||
try:
|
||||
fm = FirewallManager(request)
|
||||
|
|
@ -480,6 +629,7 @@ def removeCSF(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchCSFSettings(request):
|
||||
try:
|
||||
fm = FirewallManager(request)
|
||||
|
|
@ -487,6 +637,7 @@ def fetchCSFSettings(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def changeStatus(request):
|
||||
try:
|
||||
|
||||
|
|
@ -505,6 +656,7 @@ def changeStatus(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def modifyPorts(request):
|
||||
try:
|
||||
|
||||
|
|
@ -523,6 +675,7 @@ def modifyPorts(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def modifyIPs(request):
|
||||
try:
|
||||
|
||||
|
|
@ -541,6 +694,7 @@ def modifyIPs(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
## Imunify
|
||||
|
||||
def imunify(request):
|
||||
|
|
@ -552,6 +706,17 @@ def imunify(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def imunifyV2(request):
|
||||
try:
|
||||
|
||||
fm = FirewallManager(request)
|
||||
return fm.imunifyV2()
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitinstallImunify(request):
|
||||
try:
|
||||
|
||||
|
|
@ -561,6 +726,7 @@ def submitinstallImunify(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
## ImunifyAV
|
||||
|
||||
def imunifyAV(request):
|
||||
|
|
@ -572,6 +738,17 @@ def imunifyAV(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def imunifyAVV2(request):
|
||||
try:
|
||||
|
||||
fm = FirewallManager(request)
|
||||
return fm.imunifyAVV2()
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitinstallImunifyAV(request):
|
||||
try:
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a class="bg-orange-500 px-3 py-3 rounded-lg text-xl font-semibold text-white"
|
||||
<a class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white"
|
||||
href="{% url "createEmailAccountV2" %}">{% trans "Create Email" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,654 @@
|
|||
function GLobalAjaxCall(http, url, data, successCallBack, failureCallBack) {
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
http.post(url, data, config).then(successCallBack, failureCallBack);
|
||||
}
|
||||
|
||||
function GlobalRespSuccess(response) {
|
||||
globalScope.cyberPanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
new PNotify({
|
||||
title: 'Success',
|
||||
text: 'Successfully executed.',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
function GlobalRespFailed(response) {
|
||||
globalScope.cyberPanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
newapp.controller('installExtensionsV2', function ($scope, $http, $timeout) {
|
||||
|
||||
|
||||
var size = 0;
|
||||
var extName = '';
|
||||
|
||||
$scope.availableExtensions = true;
|
||||
$scope.loadingExtensions = true;
|
||||
$scope.canNotFetch = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.phpSelectionDisabled = false;
|
||||
$scope.request = true;
|
||||
$scope.canNotPerform = true;
|
||||
$scope.goback = true;
|
||||
|
||||
$scope.fetchPHPDetails = function () {
|
||||
$scope.loadingExtensions = false;
|
||||
$scope.phpSelectionDisabled = false;
|
||||
populateCurrentRecords();
|
||||
$scope.request = true;
|
||||
};
|
||||
|
||||
$scope.installExt = function (extensionName) {
|
||||
|
||||
extName = extensionName;
|
||||
|
||||
$scope.phpSelectionDisabled = true;
|
||||
$scope.requestData = "";
|
||||
|
||||
$scope.loadingExtensions = false;
|
||||
$scope.availableExtensions = true;
|
||||
$scope.request = false;
|
||||
$scope.goback = true;
|
||||
|
||||
url = "/managephp/submitExtensionRequest";
|
||||
|
||||
var data = {
|
||||
extensionName: extensionName,
|
||||
type: "install"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.extensionRequestStatus === 1) {
|
||||
|
||||
getRequestStatus();
|
||||
$scope.canNotPerform = true;
|
||||
|
||||
|
||||
} else {
|
||||
$scope.canNotPerform = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.canNotFetch = true;
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.canNotPerform = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
$scope.uninstallExt = function (extensionName) {
|
||||
|
||||
extName = extensionName;
|
||||
|
||||
$scope.phpSelectionDisabled = true;
|
||||
$scope.requestData = "";
|
||||
$scope.goback = true;
|
||||
|
||||
$scope.loadingExtensions = false;
|
||||
$scope.availableExtensions = true;
|
||||
$scope.request = false;
|
||||
|
||||
url = "/managephp/submitExtensionRequest";
|
||||
|
||||
var data = {
|
||||
extensionName: extensionName,
|
||||
type: "uninstall"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.extensionRequestStatus == 1) {
|
||||
|
||||
getRequestStatus();
|
||||
$scope.canNotPerform = true;
|
||||
|
||||
|
||||
} else {
|
||||
$scope.canNotPerform = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.canNotFetch = true;
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.canNotPerform = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
function populateCurrentRecords() {
|
||||
|
||||
var phpSelection = $scope.phpSelection;
|
||||
|
||||
var queryString = window.location.search;
|
||||
var searchParams = new URLSearchParams(queryString);
|
||||
|
||||
var param3Value = searchParams.get('apache');
|
||||
if (param3Value === null) {
|
||||
url = "/managephp/getExtensionsInformation";
|
||||
console.log('Nothing found')
|
||||
} else {
|
||||
url = "/managephp/getExtensionsInformation?apache=apache";
|
||||
}
|
||||
|
||||
var data = {
|
||||
phpSelection: phpSelection,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.fetchStatus === 1) {
|
||||
|
||||
$scope.records = JSON.parse(response.data.data);
|
||||
|
||||
$scope.availableExtensions = false;
|
||||
$scope.loadingExtensions = true;
|
||||
|
||||
$scope.canNotFetch = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.canNotFetch = false;
|
||||
$scope.couldNotConnect = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.canNotFetch = true;
|
||||
$scope.couldNotConnect = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getRequestStatus() {
|
||||
|
||||
|
||||
url = "/managephp/getRequestStatus";
|
||||
|
||||
var data = {
|
||||
size: size,
|
||||
extensionName: extName,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.extensionRequestStatus === 1) {
|
||||
|
||||
if (response.data.finished === 1) {
|
||||
|
||||
$scope.loadingExtensions = true;
|
||||
$scope.phpSelectionDisabled = false;
|
||||
$scope.requestData = response.data.requestStatus;
|
||||
$scope.goback = false;
|
||||
$timeout.cancel();
|
||||
|
||||
} else {
|
||||
size = Number(response.data.size);
|
||||
$scope.requestData = response.data.requestStatus;
|
||||
$timeout(getRequestStatus, 1000);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.canNotFetch = true;
|
||||
$scope.couldNotConnect = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
newapp.controller('editPHPConfigV2', function ($scope, $http, $timeout) {
|
||||
|
||||
$scope.loadingPHP = true;
|
||||
$scope.cyberPanelLoading = true;
|
||||
$scope.canNotFetch = true;
|
||||
$scope.phpDetailsBox = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.detailsSaved = true;
|
||||
$scope.savebtn = true;
|
||||
$scope.configDataView = true;
|
||||
$scope.canNotFetchAdvanced = true;
|
||||
$scope.detailsSavedAdvanced = true;
|
||||
$scope.savebtnAdvance = true;
|
||||
|
||||
var allow_url_fopen = false;
|
||||
var display_errors = false;
|
||||
var file_uploads = false;
|
||||
var allow_url_include = false;
|
||||
|
||||
|
||||
$('#allow_url_fopen').change(function () {
|
||||
allow_url_fopen = $(this).prop('checked');
|
||||
});
|
||||
|
||||
$('#display_errors').change(function () {
|
||||
display_errors = $(this).prop('checked');
|
||||
});
|
||||
|
||||
|
||||
$('#file_uploads').change(function () {
|
||||
file_uploads = $(this).prop('checked');
|
||||
});
|
||||
|
||||
$('#allow_url_include').change(function () {
|
||||
allow_url_include = $(this).prop('checked');
|
||||
});
|
||||
|
||||
|
||||
$scope.fetchPHPDetails = function () {
|
||||
var phpSelection = $scope.phpSelection;
|
||||
if (!phpSelection) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loadingPHP = false;
|
||||
$scope.canNotFetch = true;
|
||||
$scope.detailsSaved = true;
|
||||
|
||||
|
||||
// $('#allow_url_fopen').bootstrapToggle('off');
|
||||
// $('#display_errors').bootstrapToggle('off');
|
||||
// $('#file_uploads').bootstrapToggle('off');
|
||||
// $('#allow_url_include').bootstrapToggle('off');
|
||||
$('#allow_url_fopen').prop('checked', false);
|
||||
$('#display_errors').prop('checked', false);
|
||||
$('#file_uploads').prop('checked', false);
|
||||
$('#allow_url_include').prop('checked', false);
|
||||
|
||||
|
||||
var queryString = window.location.search;
|
||||
var searchParams = new URLSearchParams(queryString);
|
||||
|
||||
var param3Value = searchParams.get('apache');
|
||||
if (param3Value === null) {
|
||||
url = "/managephp/getCurrentPHPConfig";
|
||||
console.log('Nothing found')
|
||||
} else {
|
||||
url = "/managephp/getCurrentPHPConfig?apache=apache";
|
||||
}
|
||||
|
||||
var data = {
|
||||
phpSelection: phpSelection,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.fetchStatus == 1) {
|
||||
|
||||
$scope.savebtn = false;
|
||||
|
||||
|
||||
// if (response.data.allow_url_fopen === "1") {
|
||||
// $('#allow_url_fopen').bootstrapToggle('on');
|
||||
// }
|
||||
// if (response.data.display_errors === "1") {
|
||||
// $('#display_errors').bootstrapToggle('on');
|
||||
// }
|
||||
// if (response.data.file_uploads === "1") {
|
||||
// $('#file_uploads').bootstrapToggle('on');
|
||||
// }
|
||||
// if (response.data.allow_url_include === "1") {
|
||||
// $('#allow_url_include').bootstrapToggle('on');
|
||||
// }
|
||||
if (response.data.allow_url_fopen === "1") {
|
||||
$('#allow_url_fopen').prop('checked', true);
|
||||
}
|
||||
if (response.data.display_errors === "1") {
|
||||
$('#display_errors').prop('checked', true);
|
||||
}
|
||||
if (response.data.file_uploads === "1") {
|
||||
$('#file_uploads').prop('checked', true);
|
||||
}
|
||||
if (response.data.allow_url_include === "1") {
|
||||
$('#allow_url_include').prop('checked', true);
|
||||
}
|
||||
|
||||
|
||||
$scope.loadingPHP = true;
|
||||
|
||||
$scope.memory_limit = response.data.memory_limit;
|
||||
$scope.max_execution_time = response.data.max_execution_time;
|
||||
$scope.upload_max_filesize = response.data.upload_max_filesize;
|
||||
$scope.max_input_time = response.data.max_input_time;
|
||||
$scope.post_max_size = response.data.post_max_size;
|
||||
|
||||
$scope.phpDetailsBox = false;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.canNotFetch = false;
|
||||
$scope.loadingPHP = true;
|
||||
$scope.phpDetailsBox = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
|
||||
$scope.couldNotConnect = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.saveChanges = function () {
|
||||
|
||||
$scope.loadingPHP = false;
|
||||
|
||||
var phpSelection = $scope.phpSelection;
|
||||
|
||||
var queryString = window.location.search;
|
||||
var searchParams = new URLSearchParams(queryString);
|
||||
|
||||
var param3Value = searchParams.get('apache');
|
||||
if (param3Value === null) {
|
||||
url = "/managephp/savePHPConfigBasic";
|
||||
console.log('Nothing found')
|
||||
} else {
|
||||
url = "/managephp/savePHPConfigBasic?apache=apache";
|
||||
}
|
||||
|
||||
var data = {
|
||||
phpSelection: phpSelection,
|
||||
allow_url_fopen: allow_url_fopen,
|
||||
display_errors: display_errors,
|
||||
file_uploads: file_uploads,
|
||||
allow_url_include: allow_url_include,
|
||||
memory_limit: $scope.memory_limit,
|
||||
max_execution_time: $scope.max_execution_time,
|
||||
upload_max_filesize: $scope.upload_max_filesize,
|
||||
max_input_time: $scope.max_input_time,
|
||||
post_max_size: $scope.post_max_size,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.saveStatus === 1) {
|
||||
|
||||
$scope.detailsSaved = false;
|
||||
$scope.loadingPHP = true;
|
||||
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.canNotFetch = false;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.loadingPHP = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.canNotFetch = true;
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.loadingPHP = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
$scope.fetchAdvancePHPDetails = function () {
|
||||
var phpSelection = $scope.phpSelection;
|
||||
if (!phpSelection) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loadingPHP = false;
|
||||
$scope.savebtnAdvance = true;
|
||||
|
||||
var queryString = window.location.search;
|
||||
var searchParams = new URLSearchParams(queryString);
|
||||
|
||||
var param3Value = searchParams.get('apache');
|
||||
if (param3Value === null) {
|
||||
url = "/managephp/getCurrentAdvancedPHPConfig";
|
||||
console.log('Nothing found')
|
||||
} else {
|
||||
url = "/managephp/getCurrentAdvancedPHPConfig?apache=apache";
|
||||
}
|
||||
|
||||
var data = {
|
||||
phpSelection: phpSelection,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.fetchStatus == 1) {
|
||||
|
||||
$scope.configDataView = false;
|
||||
$scope.configData = response.data.configData;
|
||||
$scope.loadingPHP = true;
|
||||
|
||||
$scope.canNotFetchAdvanced = true;
|
||||
$scope.detailsSavedAdvanced = true;
|
||||
$scope.savebtnAdvance = false;
|
||||
|
||||
|
||||
} else {
|
||||
$scope.canNotFetchAdvanced = false;
|
||||
$scope.detailsSavedAdvanced = true;
|
||||
$scope.loadingPHP = true;
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.configDataView = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.loadingPHP = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.saveChangesAdvance = function () {
|
||||
|
||||
$scope.loadingPHP = false;
|
||||
|
||||
var phpSelection = $scope.phpSelection;
|
||||
|
||||
var queryString = window.location.search;
|
||||
var searchParams = new URLSearchParams(queryString);
|
||||
|
||||
var param3Value = searchParams.get('apache');
|
||||
if (param3Value === null) {
|
||||
url = "/managephp/savePHPConfigAdvance";
|
||||
console.log('Nothing found')
|
||||
} else {
|
||||
url = "/managephp/savePHPConfigAdvance?apache=apache";
|
||||
}
|
||||
|
||||
|
||||
var data = {
|
||||
phpSelection: phpSelection,
|
||||
configData: $scope.configData,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.saveStatus == 1) {
|
||||
|
||||
$scope.detailsSavedAdvanced = false;
|
||||
$scope.loadingPHP = true;
|
||||
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.canNotFetchAdvanced = false;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.loadingPHP = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.canNotFetchAdvanced = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.loadingPHP = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
$scope.restartPHP = function () {
|
||||
|
||||
globalScope = $scope;
|
||||
$scope.cyberPanelLoading = false;
|
||||
url = "/managephp/restartPHP";
|
||||
var data = {};
|
||||
GLobalAjaxCall($http, url, data, GlobalRespSuccess, GlobalRespFailed);
|
||||
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="editPHPConfigV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Edit PHP Configurations</p>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Edit PHP Configurations on this page.</p>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Edit PHP Configurations</p>
|
||||
<div>
|
||||
- {% if apache %}
|
||||
<a href="{% url 'editPHPConfigs' %}?apache=apache">Edit Apache Configurations</a>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="flex py-2">
|
||||
<li id="dns_tab_button"
|
||||
class="hover:bg-orange-200 border-2 border-black rounded-l-3xl px-2 py-2 w-60 cursor-pointer active"
|
||||
onclick="showTab1('basic')">
|
||||
<a class="flex justify-center">
|
||||
<p class="text-2xl font-bold">Basic</p>
|
||||
</a>
|
||||
</li>
|
||||
<li id="api_tab_button"
|
||||
class="hover:bg-orange-200 border-2 border-black rounded-r-3xl px-2 py-2 w-60 cursor-pointer"
|
||||
onclick="showTab1('api_tab')">
|
||||
<a class="flex justify-center">
|
||||
<p class="text-2xl font-bold">Advanced</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<div id="basic" class="tab-content1">
|
||||
<div>
|
||||
<div>
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Select PHP</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-change="fetchPHPDetails()" ng-model="phpSelection"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
{% for php in phps %}
|
||||
<option>{{ php }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<img ng-hide="loadingPHP" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">display_errors</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" id="display_errors" value="" class="sr-only peer">
|
||||
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">file_uploads</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" id="file_uploads" value="" class="sr-only peer">
|
||||
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">allow_url_fopen</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" id="allow_url_fopen" value="" class="sr-only peer">
|
||||
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">allow_url_include</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" id="allow_url_include" value="" class="sr-only peer">
|
||||
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">memory_limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input ng-model="memory_limit" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">max_execution_time</p>
|
||||
</div>
|
||||
<div>
|
||||
<input ng-model="max_execution_time" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">upload_max_filesize</p>
|
||||
</div>
|
||||
<div>
|
||||
<input ng-model="upload_max_filesize" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">post_max_size</p>
|
||||
</div>
|
||||
<div>
|
||||
<input ng-model="post_max_size" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="phpDetailsBox" class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">max_input_time</p>
|
||||
</div>
|
||||
<div>
|
||||
<input ng-model="max_input_time" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="savebtn" class="flex justify-center mt-6 gap-1">
|
||||
<button ng-click="saveChanges()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Save Changes
|
||||
</button>
|
||||
<button ng-click="restartPHP()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Restart PHP
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<div ng-hide="canNotFetch"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Error message: " %}{$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="detailsSaved" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "PHP Configs Saved." %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="api_tab" class="tab-content1" style="display: none;">
|
||||
<div class="flex mt-4 py-2 px-6 items-center">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Select PHP</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-change="fetchAdvancePHPDetails()" ng-model="phpSelection"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
{% for php in phps %}
|
||||
<option>{{ php }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<img ng-hide="loadingPHP" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="configDataView">
|
||||
<div>
|
||||
<textarea ng-model="configData" rows="30" class="border w-full"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="savebtnAdvance" class="flex justify-center mt-6 gap-1">
|
||||
<button ng-click="saveChangesAdvance()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Save Changes
|
||||
</button>
|
||||
<button ng-click="restartPHP()"
|
||||
class="flex items-center bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
<p>Restart PHP</p>
|
||||
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<div ng-hide="canNotFetchAdvanced"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="detailsSavedAdvanced"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "PHP Configs Saved." %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="installExtensionsV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Install PHP Extensions -</p>
|
||||
<div style="height: 23px;line-height: 21px;"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3">
|
||||
{% if apache %}
|
||||
<a href="{% url 'installExtensions' %}?apache=apache">Manage Apache Extensions</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Install/uninstall php extensions on this page.
|
||||
</p>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Select PHP Version</p>
|
||||
<img ng-hide="loadingExtensions"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<form action="/" id="modifyPackageForm">
|
||||
<div class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Select PHP</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-disabled="phpSelectionDisabled" ng-change="fetchPHPDetails()"
|
||||
ng-model="phpSelection" class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
{% for php in phps %}
|
||||
<option>{{ php }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2" ng-hide="availableExtensions">
|
||||
<div class="relative flex items-center w-full h-12 rounded-lg bg-gray-100 overflow-hidden">
|
||||
<div class="grid place-items-center h-full w-12 text-gray-300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
|
||||
</svg>
|
||||
</div>
|
||||
<input type="text" ng-model="extSearch" placeholder="{% trans 'Search Extensions..' %}"
|
||||
class="h-full w-full bg-gray-100 outline-none text-sm text-gray-700 pr-2">
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="availableExtensions" class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
|
||||
<th scope="col" class="px-6 py-3">
|
||||
ID
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
PHP
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Extension Name
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Description
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Status
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Install
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Uninstall
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="record in records | filter:extSearch"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td ng-bind="record.id" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-bind="record.phpVers" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-bind="record.extensionName" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-bind="record.description" class="px-6 py-4">
|
||||
</td>
|
||||
<td ng-bind="record.status" class="px-6 py-4">
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<button ng-disabled="record.status=='Installed'" type="button"
|
||||
ng-click="installExt(record.extensionName)"
|
||||
class="btn ra-100 btn-blue-alt">{% trans "Install" %}</button>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<button ng-disabled="record.status=='Not-Installed'" type="button"
|
||||
ng-click="uninstallExt(record.extensionName)"
|
||||
class="btn ra-100 btn-blue-alt">{% trans "Uninstall" %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div ng-hide="request" class="mt-2">
|
||||
<div>
|
||||
<button ng-disabled="goback" style="margin-bottom: 1%" type="button"
|
||||
ng-click="fetchPHPDetails()"
|
||||
class="bg-orange-500 text-white font-bold px-2 py-1">{% trans "Go Back" %}</button>
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!----- Log box ----------------->
|
||||
<div>
|
||||
<div ng-hide="canNotFetch"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Cannot fetch details. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="canNotPerform"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Cannot perform operation. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotConnect"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect. Please refresh this page." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -4,15 +4,16 @@ from . import views
|
|||
urlpatterns = [
|
||||
url(r'^$', views.loadPHPHome, name='loadPHPHome'),
|
||||
url(r'^installExtensions', views.installExtensions, name='installExtensions'),
|
||||
url(r'^V2/installExtensionsV2', views.installExtensionsV2, name='installExtensionsV2'),
|
||||
url(r'^getExtensionsInformation', views.getExtensionsInformation, name='getExtensionsInformation'),
|
||||
url(r'^submitExtensionRequest', views.submitExtensionRequest, name='submitExtensionRequest'),
|
||||
url(r'^getRequestStatus', views.getRequestStatus, name='getRequestStatus'),
|
||||
url(r'^editPHPConfigs', views.editPHPConfigs, name='editPHPConfigs'),
|
||||
url(r'^V2/editPHPConfigsV2', views.editPHPConfigsV2, name='editPHPConfigsV2'),
|
||||
url(r'^getCurrentPHPConfig', views.getCurrentPHPConfig, name='getCurrentPHPConfig'),
|
||||
url(r'^savePHPConfigBasic', views.savePHPConfigBasic, name='savePHPConfigBasic'),
|
||||
url(r'^getCurrentAdvancedPHPConfig', views.getCurrentAdvancedPHPConfig, name='getCurrentAdvancedPHPConfig'),
|
||||
url(r'^savePHPConfigAdvance', views.savePHPConfigAdvance, name='savePHPConfigAdvance'),
|
||||
url(r'^restartPHP', views.restartPHP, name='restartPHP'),
|
||||
|
||||
|
||||
]
|
||||
]
|
||||
|
|
|
|||
1276
managePHP/views.py
1276
managePHP/views.py
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,915 @@
|
|||
newapp.controller('serverMailV2', function ($scope, $http) {
|
||||
|
||||
$scope.cyberPanelLoading = true;
|
||||
$scope.installationDetailsForm = true;
|
||||
|
||||
$scope.mailerSettings = function () {
|
||||
if ($scope.mailer === 'SMTP') {
|
||||
$scope.installationDetailsForm = false;
|
||||
} else {
|
||||
$scope.installationDetailsForm = true;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.saveSMTPSettings = function () {
|
||||
$scope.cyberPanelLoading = false;
|
||||
|
||||
var url = "/serverlogs/saveSMTPSettings";
|
||||
|
||||
var data = {
|
||||
mailer: $scope.mailer,
|
||||
smtpHost: $scope.smtpHost,
|
||||
smtpPort: $scope.smtpPort,
|
||||
smtpUserName: $scope.smtpUserName,
|
||||
smtpPassword: $scope.smtpPassword
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
new PNotify({
|
||||
title: 'Success',
|
||||
text: 'Successfully saved.',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page.',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
newapp.controller('readAccessLogsV2', function ($scope, $http) {
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "access"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus == 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$scope.fetchLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "access"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus == 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.clearLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/clearLogFile";
|
||||
|
||||
var data = {
|
||||
fileName: "/usr/local/lsws/logs/access.log"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.cleanStatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = "";
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
newapp.controller('readErrorLogsV2', function ($scope, $http) {
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "error"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$scope.fetchLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "error"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus == 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.clearLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/clearLogFile";
|
||||
|
||||
var data = {
|
||||
fileName: "/usr/local/lsws/logs/error.log"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.cleanStatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = "";
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
newapp.controller('readEmailLogsV2', function ($scope, $http) {
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "email"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$scope.fetchLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "email"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus == 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.clearLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/clearLogFile";
|
||||
|
||||
var data = {
|
||||
fileName: "/var/log/maillog"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.cleanStatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = "";
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
newapp.controller('readFTPLogsV2', function ($scope, $http) {
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "ftp"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$scope.fetchLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "ftp"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus == 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.clearLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/clearLogFile";
|
||||
|
||||
var data = {
|
||||
fileName: "/var/log/messages"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.cleanStatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = "";
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
newapp.controller('modSecAuditLogsV2', function ($scope, $http) {
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "modSec"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$scope.fetchLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/getLogsFromFile";
|
||||
|
||||
var data = {
|
||||
type: "modSec"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus == 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
$scope.clearLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverlogs/clearLogFile";
|
||||
|
||||
var data = {
|
||||
fileName: "/usr/local/lsws/logs/auditmodsec.log"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.cleanStatus === 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = "";
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="readAccessLogsV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">Access Logs</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Access Logs for main web server.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Last 50 Lines</p>
|
||||
<img ng-hide="logFileLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="border mt-4 py-2 px-6">
|
||||
<textarea ng-model="logsData" class="w-full" rows="30">{{ logs }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex gap-2 justify-center mt-6 mb-2">
|
||||
<button ng-click="fetchLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Refresh
|
||||
</button>
|
||||
<button ng-click="clearLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Clear Logs
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="logsFeteched"
|
||||
class="flex justify-center w-full mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Last 50 Lines Fetched" %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotFetchLogs"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not fetch logs. Use the command line to view the log file." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="readEmailLogsV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">Email Logs</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Email Logs for main web server.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Last 50 Lines</p>
|
||||
<img ng-hide="logFileLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="border mt-4 py-2 px-6">
|
||||
<textarea ng-model="logsData" class="w-full" rows="30">{{ logs }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex gap-2 justify-center mt-6 mb-2">
|
||||
<button ng-click="fetchLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Refresh
|
||||
</button>
|
||||
<button ng-click="clearLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Clear Logs
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="logsFeteched"
|
||||
class="flex justify-center w-full mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Last 50 Lines Fetched" %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotFetchLogs"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not fetch logs. Use the command line to view the log file." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="readErrorLogsV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">Error Logs</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Error Logs for main web server.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Last 50 Lines</p>
|
||||
<img ng-hide="logFileLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="border mt-4 py-2 px-6">
|
||||
<textarea ng-model="logsData" class="w-full" rows="30">{{ logs }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex gap-2 justify-center mt-6 mb-2">
|
||||
<button ng-click="fetchLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Refresh
|
||||
</button>
|
||||
<button ng-click="clearLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Clear Logs
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="logsFeteched"
|
||||
class="flex justify-center w-full mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Last 50 Lines Fetched" %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotFetchLogs"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not fetch logs. Use the command line to view the log file." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="readFTPLogsV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">FTP Logs</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">FTP Logs for main web server.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Last 50 Lines</p>
|
||||
<img ng-hide="logFileLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="border mt-4 py-2 px-6">
|
||||
<textarea ng-model="logsData" class="w-full" rows="30">{{ logs }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex gap-2 justify-center mt-6 mb-2">
|
||||
<button ng-click="fetchLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Refresh
|
||||
</button>
|
||||
<button ng-click="clearLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Clear Logs
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="logsFeteched"
|
||||
class="flex justify-center w-full mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Last 50 Lines Fetched" %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotFetchLogs"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not fetch logs. Use the command line to view the log file." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="modSecAuditLogsV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">ModSecurity Audit Logs</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">ModSecurity Audit Logs</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Last 50 Lines</p>
|
||||
<img ng-hide="logFileLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="border mt-4 py-2 px-6">
|
||||
<textarea ng-model="logsData" class="w-full" rows="30">{{ logs }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex gap-2 justify-center mt-6 mb-2">
|
||||
<button ng-click="fetchLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Refresh
|
||||
</button>
|
||||
<button ng-click="clearLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Clear Logs
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="logsFeteched"
|
||||
class="flex justify-center w-full mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Last 50 Lines Fetched" %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotFetchLogs"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not fetch logs. Use the command line to view the log file." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="serverMailV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Manage Server Mail -</p>
|
||||
<a target="_blank"
|
||||
href="https://go.cyberpanel.net/serverMail"
|
||||
style="height: 23px;line-height: 21px;"
|
||||
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
|
||||
title=""><span>{% trans "Mail Docs" %}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Manage SMTP Hosts</p>
|
||||
<img ng-hide="cyberPanelLoading"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Mailer</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-change="mailerSettings()" ng-model="mailer" class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
<option>Default</option>
|
||||
<option>SMTP</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">SMTP Host</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="smtpHost" required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Port</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="smtpPort" required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Username</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="smtpUserName" required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Password</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="password" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="smtpPassword" required>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex justify-center mt-6 mb-2">
|
||||
<button ng-click="saveSMTPSettings()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -3,13 +3,19 @@ from . import views
|
|||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.logsHome, name='logsHome'),
|
||||
url(r'^accessLogs', views.accessLogs, name='accessLogs'),
|
||||
url(r'^errorLogs', views.errorLogs, name='errorLogs'),
|
||||
url(r'^V2/accessLogs', views.accessLogs, name='accessLogs'),
|
||||
url(r'^accessLogsV2', views.accessLogsV2, name='accessLogsV2'),
|
||||
url(r'^V2/errorLogs', views.errorLogs, name='errorLogs'),
|
||||
url(r'^errorLogsV2', views.errorLogsV2, name='errorLogsV2'),
|
||||
url(r'^emaillogs', views.emailLogs, name='emaillogs'),
|
||||
url(r'^V2/emaillogsV2', views.emailLogsV2, name='emaillogsV2'),
|
||||
url(r'^ftplogs', views.ftplogs, name='ftplogs'),
|
||||
url(r'^V2/ftplogsV2', views.ftplogsV2, name='ftplogsV2'),
|
||||
url(r'^modSecAuditLogs', views.modSecAuditLogs, name='modSecAuditLogs'),
|
||||
url(r'^getLogsFromFile',views.getLogsFromFile, name="getLogsFromFile"),
|
||||
url(r'^clearLogFile',views.clearLogFile, name="clearLogFile"),
|
||||
url(r'^V2/modSecAuditLogsV2', views.modSecAuditLogsV2, name='modSecAuditLogsV2'),
|
||||
url(r'^getLogsFromFile', views.getLogsFromFile, name="getLogsFromFile"),
|
||||
url(r'^clearLogFile', views.clearLogFile, name="clearLogFile"),
|
||||
url(r'^serverMail$', views.serverMail, name="serverMail"),
|
||||
url(r'^serverMailV2$', views.serverMailV2, name="serverMailV2"),
|
||||
url(r'^saveSMTPSettings$', views.saveSMTPSettings, name="saveSMTPSettings"),
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ from plogical.virtualHostUtilities import virtualHostUtilities
|
|||
from plogical.acl import ACLManager
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
import os
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def logsHome(request):
|
||||
|
|
@ -16,31 +18,67 @@ def logsHome(request):
|
|||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def accessLogs(request):
|
||||
proc = httpProc(request, 'serverLogs/accessLogs.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def accessLogsV2(request):
|
||||
proc = httpProc(request, 'serverLogs/accessLogsV2.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def errorLogs(request):
|
||||
proc = httpProc(request, 'serverLogs/errorLogs.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def errorLogsV2(request):
|
||||
proc = httpProc(request, 'serverLogs/errorLogsV2.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def ftplogs(request):
|
||||
proc = httpProc(request, 'serverLogs/ftplogs.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def ftplogsV2(request):
|
||||
proc = httpProc(request, 'serverLogs/ftplogsV2.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def emailLogs(request):
|
||||
proc = httpProc(request, 'serverLogs/emailLogs.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def emailLogsV2(request):
|
||||
proc = httpProc(request, 'serverLogs/emailLogsV2.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def modSecAuditLogs(request):
|
||||
proc = httpProc(request, 'serverLogs/modSecAuditLog.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def modSecAuditLogsV2(request):
|
||||
proc = httpProc(request, 'serverLogs/modSecAuditLogV2.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def getLogsFromFile(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -85,11 +123,13 @@ def getLogsFromFile(request):
|
|||
return HttpResponse(final_json)
|
||||
|
||||
except KeyError as msg:
|
||||
status = {"status": 0, "logstatus":0,"error":"Could not fetch data from log file, please see CyberCP main log file through command line."}
|
||||
status = {"status": 0, "logstatus": 0,
|
||||
"error": "Could not fetch data from log file, please see CyberCP main log file through command line."}
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[getLogsFromFile]")
|
||||
final_json = json.dumps(status)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
|
||||
def clearLogFile(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -132,6 +172,7 @@ def clearLogFile(request):
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
def serverMail(request):
|
||||
smtpPath = '/home/cyberpanel/smtpDetails'
|
||||
data = {}
|
||||
|
|
@ -147,6 +188,23 @@ def serverMail(request):
|
|||
data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def serverMailV2(request):
|
||||
smtpPath = '/home/cyberpanel/smtpDetails'
|
||||
data = {}
|
||||
|
||||
if os.path.exists(smtpPath):
|
||||
mailSettings = json.loads(open(smtpPath, 'r').read())
|
||||
data['smtpHost'] = mailSettings['smtpHost']
|
||||
data['smtpPort'] = mailSettings['smtpPort']
|
||||
data['smtpUserName'] = mailSettings['smtpUserName']
|
||||
data['smtpPassword'] = mailSettings['smtpPassword']
|
||||
|
||||
proc = httpProc(request, 'serverLogs/serverMailV2.html',
|
||||
data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def saveSMTPSettings(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -202,7 +260,6 @@ def saveSMTPSettings(request):
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
status = {"status": 1}
|
||||
final_json = json.dumps(status)
|
||||
return HttpResponse(final_json)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,650 @@
|
|||
newapp.controller('readCyberCPLogFileV2', function ($scope, $http) {
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverstatus/getFurtherDataFromLogFile";
|
||||
|
||||
var data = {};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus == 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$scope.fetchLogs = function () {
|
||||
|
||||
|
||||
$scope.logFileLoading = false;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
|
||||
var url = "/serverstatus/getFurtherDataFromLogFile";
|
||||
|
||||
var data = {};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.logstatus == 1) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = false;
|
||||
$scope.couldNotFetchLogs = true;
|
||||
|
||||
$scope.logsData = response.data.logsdata;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
$scope.couldNotFetchLogs = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
newapp.controller('litespeedStatusV2', function ($scope, $http) {
|
||||
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.actionResult = true;
|
||||
$scope.actionResultBad = true;
|
||||
$scope.serverStatusCouldNotConnect = true;
|
||||
|
||||
|
||||
$scope.restartLitespeed = function () {
|
||||
|
||||
|
||||
$scope.disableReboot = true;
|
||||
$scope.disableStop = true;
|
||||
$scope.restartorStopLoading = false;
|
||||
|
||||
|
||||
var url = "/serverstatus/startorstopLitespeed";
|
||||
|
||||
var data = {
|
||||
reboot: 1,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.disableReboot = false;
|
||||
$scope.disableStop = false;
|
||||
|
||||
if (response.data.reboot == 1) {
|
||||
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.actionResult = false;
|
||||
$scope.actionResultBad = true;
|
||||
$scope.serverStatusCouldNotConnect = true;
|
||||
|
||||
} else {
|
||||
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.actionResult = true;
|
||||
$scope.actionResultBad = false;
|
||||
$scope.serverStatusCouldNotConnect = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.actionResult = true;
|
||||
$scope.actionResultBad = true;
|
||||
$scope.serverStatusCouldNotConnect = false;
|
||||
$scope.disableReboot = false;
|
||||
$scope.disableStop = false;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
$scope.stopLitespeed = function () {
|
||||
|
||||
|
||||
$scope.disableReboot = true;
|
||||
$scope.disableStop = true;
|
||||
$scope.restartorStopLoading = false;
|
||||
|
||||
|
||||
var url = "/serverstatus/startorstopLitespeed";
|
||||
|
||||
var data = {
|
||||
reboot: 0,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.disableReboot = false;
|
||||
$scope.disableStop = false;
|
||||
|
||||
if (response.data.shutdown == 1) {
|
||||
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.actionResult = false;
|
||||
$scope.actionResultBad = true;
|
||||
$scope.serverStatusCouldNotConnect = true;
|
||||
|
||||
} else {
|
||||
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.actionResult = true;
|
||||
$scope.actionResultBad = false;
|
||||
$scope.serverStatusCouldNotConnect = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.restartorStopLoading = true;
|
||||
$scope.actionResult = true;
|
||||
$scope.actionResultBad = true;
|
||||
$scope.serverStatusCouldNotConnect = false;
|
||||
$scope.disableReboot = false;
|
||||
$scope.disableStop = false;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
/// License Manager
|
||||
|
||||
$scope.cpLoading = true;
|
||||
$scope.fetchedData = true;
|
||||
$scope.changeSerialBox = true;
|
||||
|
||||
$scope.hideLicenseStatus = function () {
|
||||
$scope.fetchedData = true;
|
||||
};
|
||||
|
||||
$scope.licenseStatus = function () {
|
||||
|
||||
$scope.cpLoading = false;
|
||||
$scope.changeSerialBox = true;
|
||||
|
||||
var url = "/serverstatus/licenseStatus";
|
||||
|
||||
var data = {};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.cpLoading = true;
|
||||
$scope.fetchedData = false;
|
||||
new PNotify({
|
||||
title: 'Success!',
|
||||
text: 'Status successfully fetched',
|
||||
type: 'success'
|
||||
});
|
||||
$scope.lsSerial = response.data.lsSerial;
|
||||
$scope.lsexpiration = response.data.lsexpiration;
|
||||
} else {
|
||||
$scope.cpLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.erroMessage,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cpLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page.',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
$scope.showSerialBox = function () {
|
||||
$scope.fetchedData = true;
|
||||
$scope.changeSerialBox = false;
|
||||
};
|
||||
$scope.changeLicense = function () {
|
||||
|
||||
$scope.cpLoading = false;
|
||||
|
||||
var url = "/serverstatus/changeLicense";
|
||||
|
||||
var data = {newKey: $scope.newKey};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.cpLoading = true;
|
||||
new PNotify({
|
||||
title: 'Success!',
|
||||
text: 'License successfully Updated',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
$scope.cpLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.erroMessage,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cpLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page.',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
$scope.refreshLicense = function () {
|
||||
|
||||
$scope.cpLoading = false;
|
||||
|
||||
var url = "/serverstatus/refreshLicense";
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
data = {};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.cpLoading = true;
|
||||
new PNotify({
|
||||
title: 'Success!',
|
||||
text: 'License successfully refreshed',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
$scope.cpLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.erroMessage,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cpLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page.',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
newapp.controller('lswsSwitchV2', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
|
||||
$scope.cyberPanelLoading = true;
|
||||
$scope.installBoxGen = true;
|
||||
|
||||
$scope.confrimtril = function () {
|
||||
$('#confrimtril').show();
|
||||
}
|
||||
|
||||
$scope.switchTOLSWS = function () {
|
||||
|
||||
$scope.cyberPanelLoading = false;
|
||||
$scope.installBoxGen = true;
|
||||
|
||||
url = "/serverstatus/switchTOLSWS";
|
||||
|
||||
var data = {
|
||||
licenseKey: $scope.licenseKey
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
$scope.installBoxGen = false;
|
||||
getRequestStatus();
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function getRequestStatus() {
|
||||
$scope.cyberPanelLoading = false;
|
||||
|
||||
url = "/serverstatus/switchTOLSWSStatus";
|
||||
|
||||
var data = {};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
if (response.data.abort === 0) {
|
||||
$scope.requestData = response.data.requestStatus;
|
||||
$timeout(getRequestStatus, 1000);
|
||||
} else {
|
||||
// Notifications
|
||||
$scope.cyberPanelLoading = true;
|
||||
$timeout.cancel();
|
||||
$scope.requestData = response.data.requestStatus;
|
||||
if (response.data.installed === 1) {
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
newapp.controller('topProcessesV2', function ($scope, $http, $timeout) {
|
||||
|
||||
$scope.cyberPanelLoading = true;
|
||||
|
||||
$scope.topProcessesStatus = function () {
|
||||
|
||||
$scope.cyberPanelLoading = false;
|
||||
|
||||
url = "/serverstatus/topProcessesStatus";
|
||||
|
||||
var data = {};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
$scope.processes = JSON.parse(response.data.data);
|
||||
|
||||
//CPU Details
|
||||
$scope.cores = response.data.cores;
|
||||
$scope.modelName = response.data.modelName;
|
||||
$scope.cpuMHZ = response.data.cpuMHZ;
|
||||
$scope.cacheSize = response.data.cacheSize;
|
||||
|
||||
//CPU Load
|
||||
$scope.cpuNow = response.data.cpuNow;
|
||||
$scope.cpuOne = response.data.cpuOne;
|
||||
$scope.cpuFive = response.data.cpuFive;
|
||||
$scope.cpuFifteen = response.data.cpuFifteen;
|
||||
|
||||
//CPU Time spent
|
||||
$scope.ioWait = response.data.ioWait;
|
||||
$scope.idleTime = response.data.idleTime;
|
||||
$scope.hwInterrupts = response.data.hwInterrupts;
|
||||
$scope.Softirqs = response.data.Softirqs;
|
||||
|
||||
//Memory
|
||||
$scope.totalMemory = response.data.totalMemory;
|
||||
$scope.freeMemory = response.data.freeMemory;
|
||||
$scope.usedMemory = response.data.usedMemory;
|
||||
$scope.buffCache = response.data.buffCache;
|
||||
|
||||
//Swap
|
||||
$scope.swapTotalMemory = response.data.swapTotalMemory;
|
||||
$scope.swapFreeMemory = response.data.swapFreeMemory;
|
||||
$scope.swapUsedMemory = response.data.swapUsedMemory;
|
||||
$scope.swapBuffCache = response.data.swapBuffCache;
|
||||
|
||||
//Processes
|
||||
$scope.totalProcesses = response.data.totalProcesses;
|
||||
$scope.runningProcesses = response.data.runningProcesses;
|
||||
$scope.sleepingProcesses = response.data.sleepingProcesses;
|
||||
$scope.stoppedProcesses = response.data.stoppedProcesses;
|
||||
$scope.zombieProcesses = response.data.zombieProcesses;
|
||||
|
||||
$timeout($scope.topProcessesStatus, 3000);
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
$scope.topProcessesStatus();
|
||||
|
||||
$scope.killProcess = function (pid) {
|
||||
|
||||
$scope.cyberPanelLoading = false;
|
||||
|
||||
url = "/serverstatus/killProcess";
|
||||
|
||||
var data = {
|
||||
pid: pid
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
new PNotify({
|
||||
title: 'Success',
|
||||
text: 'Process successfully killed.',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
|
@ -4,21 +4,22 @@
|
|||
{% block content %}
|
||||
|
||||
|
||||
{% load static %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||
{% load static %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||
|
||||
<div class="container">
|
||||
<div id="page-title">
|
||||
<h2>{% trans "CyberPanel Main Log File" %}</h2>
|
||||
<p>{% trans "This log file corresponds to errors generated by CyberPanel for your domain errors log you can look into /home/domain/logs." %}</p>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div id="page-title">
|
||||
<h2>{% trans "CyberPanel Main Log File" %}</h2>
|
||||
<p>{% trans "This log file corresponds to errors generated by CyberPanel for your domain errors log you can look into /home/domain/logs." %}</p>
|
||||
</div>
|
||||
|
||||
<div ng-controller="readCyberCPLogFile" class="row">
|
||||
<div class="panel">
|
||||
<div ng-controller="readCyberCPLogFileV2" class="row">
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
<h3 class="content-box-header">
|
||||
{% trans "Last 50 Lines" %} <img ng-hide="logFileLoading" src="{% static 'images/loading.gif' %}">
|
||||
{% trans "Last 50 Lines" %} <img ng-hide="logFileLoading"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</h3>
|
||||
<div class="col-md-12">
|
||||
|
||||
|
|
@ -30,40 +31,36 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-click="fetchLogs()" class="btn btn-primary btn-lg">{% trans "Refresh" %}</button>
|
||||
<button type="button" ng-click="fetchLogs()"
|
||||
class="btn btn-primary btn-lg">{% trans "Refresh" %}</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-hide="logsFeteched" class="alert alert-success">
|
||||
<p>{% trans "Last 50 Lines Fetched" %}</p>
|
||||
</div>
|
||||
<p>{% trans "Last 50 Lines Fetched" %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-hide="couldNotFetchLogs" class="alert alert-danger">
|
||||
<p>{% trans "Could not fetch logs. Use the command line to view the log file." %}</p>
|
||||
</div>
|
||||
|
||||
<div ng-hide="couldNotFetchLogs" class="alert alert-danger">
|
||||
<p>{% trans "Could not fetch logs. Use the command line to view the log file." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="readCyberCPLogFileV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">CyberPanel Main Log File</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">This log file corresponds to errors generated by
|
||||
CyberPanel for your domain errors log you can look into /home/domain/logs.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Last 50 Lines</p>
|
||||
<img ng-hide="logFileLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="border mt-4 py-2 px-6">
|
||||
<textarea ng-model="logsData" class="w-full" rows="30">{{ logs }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex gap-2 justify-center mt-6 mb-2">
|
||||
<button ng-click="fetchLogs()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Refresh
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="logsFeteched"
|
||||
class="flex justify-center w-full mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Last 50 Lines Fetched" %}</p>
|
||||
</div>
|
||||
<div ng-hide="couldNotFetchLogs"
|
||||
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not fetch logs. Use the command line to view the log file." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,356 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% if OLS %}
|
||||
<div ng-controller="litespeedStatusV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">LiteSpeed Status:</p>
|
||||
<img src="{% static 'images/lsON.png' %}"
|
||||
style="margin-bottom: 5px;">
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can get information regarding your
|
||||
LiteSpeed processes.</p>
|
||||
</div>
|
||||
{% if processList %}
|
||||
<div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">LiteSpeed Processes</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
#
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Process ID
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Name
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
{% for items in processList %}
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
{{ forloop.counter }}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{{ items }}
|
||||
</td>
|
||||
{% if forloop.counter == 1 %}
|
||||
<td class="px-6 py-4">
|
||||
Main Process
|
||||
</td>
|
||||
{% elif forloop.counter == 2 %}
|
||||
<td class="px-6 py-4">
|
||||
lscgid Process
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="px-6 py-4">
|
||||
Worker Process
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mx-10">
|
||||
<button ng-click="restartLitespeed()" ng-disabled="disableReboot"
|
||||
class="btn btn-alt btn-hover btn-blue-alt mx-5 my-10">
|
||||
<span>{% trans "Reboot Litespeed" %}</span>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</button>
|
||||
|
||||
<button ng-click="stopLitespeed()" ng-disable="disableStop"
|
||||
class="btn btn-alt btn-hover btn-danger mx-5 my-10">
|
||||
<span>{% trans "Stop LiteSpeed" %}</span>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<img ng-hide="restartorStopLoading" src="{% static 'images/loading.gif' %}">
|
||||
|
||||
<div ng-hide="actionResult" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Action successful." %}</p>
|
||||
</div>
|
||||
<div ng-hide="actionResultBad"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Error Occurred. See CyberPanel main log file." %}</p>
|
||||
</div>
|
||||
<div ng-hide="serverStatusCouldNotConnect"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Could not connect to server." %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div ng-controller="lswsSwitchV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Switch to LiteSpeed Enterprise Web Server</p>
|
||||
<img ng-hide="cyberPanelLoading"
|
||||
src="/static/images/loading.gif">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">LiteSpeed Serial No. (License Key)</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="licenseKey"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-click="switchTOLSWS()"
|
||||
class="btn btn-primary btn-lg">{% trans "Switch" %}</button>
|
||||
<button type="button" ng-click="confrimtril()"
|
||||
class="btn btn-primary btn-lg">{% trans "Get 15 Days Trial" %}</button>
|
||||
</div>
|
||||
|
||||
<div id="confrimtril" style="display: none" class="form-group ">
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-click="switchTOLSWS()"
|
||||
class="btn btn-primary btn-lg">{% trans "Are you sure?" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<p>{% trans "Note: If you select 15 days trial there is no need to enter the serial key, CyberPanel will auto fetch 15 days trial key for you. Make sure this server have not used trial already." %}</p>
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<p style="color:red; font-weight: bold ;">{% trans "WARNING: You cannot revert back to OpenLiteSpeed if you choose not to purchase a LiteSpeed Enterprise license after the 15 day trial period. We recommend you test the Enterprise trial on a separate server." %}</p>
|
||||
</div>
|
||||
<div style="margin-top: 2%" ng-hide="installBoxGen">
|
||||
<form action="/" id="">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<img style="width:70px"
|
||||
src="{% static 'images/litespeed-logo.png' %}">
|
||||
<p class="text-4xl font-bold">With great wisdom comes great responsibility.</p>
|
||||
<img ng-hide="cyberPanelLoading" src="/static/images/loading.gif">
|
||||
</div>
|
||||
<div style="margin-top: 2%;">
|
||||
<textarea ng-model="requestData" rows="15"
|
||||
class="border w-full">{{ requestData }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div ng-controller="litespeedStatusV2" class="p-8">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">LiteSpeed Status:</p>
|
||||
<img src="{% static 'images/lsON.png' %}">
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can get information regarding your
|
||||
LiteSpeed processes.</p>
|
||||
</div>
|
||||
<div>
|
||||
{% if message != 0 %}
|
||||
{% if message == 2 %}
|
||||
<div style="margin-top: 2%" class="alert alert-danger">
|
||||
<div class="alert-content">
|
||||
<h4 class="alert-title">Warning</h4>
|
||||
<p>It looks like your license does not include CyberPanel bundle. <a
|
||||
href="https://cyberpanel.net/cyberpanel-enterprise/">Click here</a> to see the
|
||||
packages and upgrade to CyberPanel bundle.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div style="margin-top: 2%" class="alert alert-danger">
|
||||
<div class="alert-content">
|
||||
<h4 class="alert-title">Warning</h4>
|
||||
<p>It looks like your license has expired. Kindly renew your license.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<hr>
|
||||
{% if processList %}
|
||||
|
||||
<div class="example-box-wrapper">
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
<div class="col-md-12">
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
|
||||
<h3 class="content-box-header bg-black">
|
||||
{% trans "LiteSpeed Processes" %}
|
||||
</h3>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{% trans "Process ID" %}</th>
|
||||
<th>{% trans "Name" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for items in processList %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
|
||||
<td> {{ items }}</td>
|
||||
|
||||
{% if forloop.counter == 1 %}
|
||||
<td>{% trans "Main Process" %}</td>
|
||||
|
||||
{% elif forloop.counter == 2 %}
|
||||
<td>{% trans "lscgid Process" %}</td>
|
||||
|
||||
{% else %}
|
||||
<td>{% trans "Worker Process" %}</td>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<button ng-click="restartLitespeed()" ng-disabled="disableReboot"
|
||||
class="btn btn-alt btn-hover btn-blue-alt mx-5 my-10">
|
||||
<span>{% trans "Reboot Litespeed" %}</span>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</button>
|
||||
|
||||
<button ng-click="stopLitespeed()" ng-disable="disableStop"
|
||||
class="btn btn-alt btn-hover btn-danger mx-5 my-10">
|
||||
<span>{% trans "Stop LiteSpeed" %}</span>
|
||||
<i class="glyph-icon icon-arrow-right"></i>
|
||||
</button>
|
||||
|
||||
<img ng-hide="restartorStopLoading" src="{% static 'images/loading.gif' %}">
|
||||
|
||||
|
||||
<div ng-hide="actionResult" class="alert alert-success">
|
||||
<p>{% trans "Action successful." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-hide="actionResultBad" class="alert alert-danger">
|
||||
<p>{% trans "Error Occurred. See CyberPanel main log file." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-hide="serverStatusCouldNotConnect" class="alert alert-danger">
|
||||
<p>{% trans "Could not connect to server." %}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
<div class="example-box-wrapper">
|
||||
<div class="panel panel-body">
|
||||
<h3 class="content-box-header">
|
||||
{% trans "License Manager" %} <img ng-hide="cpLoading" src="/static/images/loading.gif">
|
||||
</h3>
|
||||
|
||||
<div class="content-box-wrapper">
|
||||
<div class="row mt-5 mx-10">
|
||||
|
||||
<div class="col-md-4 panel-body">
|
||||
<a ng-click="licenseStatus(1)" href="" title="{% trans 'License Status' %}">
|
||||
<img src="{% static 'images/license-status.png' %}" width="65" class="mr-10 ">
|
||||
</a>
|
||||
|
||||
<a ng-click="licenseStatus(1)" href="" title="{% trans 'License Status' %}">
|
||||
<span class="h4">{% trans 'License Status' %}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 panel-body">
|
||||
<a ng-click="showSerialBox()" href="" title="{% trans 'Change License' %}">
|
||||
<img src="{% static 'images/change-license.png' %}" width="65" class="mr-10">
|
||||
</a>
|
||||
|
||||
<a ng-click="showSerialBox()" href="" title="{% trans 'Change License' %}">
|
||||
<span class="h4">{% trans 'Change License' %}</span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 panel-body">
|
||||
<a ng-click="refreshLicense()" href="" title="{% trans 'Refresh License' %}">
|
||||
<img src="{% static 'images/change-license.png' %}" width="65" class="mr-10">
|
||||
</a>
|
||||
|
||||
<a ng-click="refreshLicense()" href="" title="{% trans 'Refresh License' %}">
|
||||
<span class="h4">{% trans 'Refresh License' %}</span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div ng-hide="fetchedData">
|
||||
<div class="alert alert-success">
|
||||
<div class="bg-green alert-icon">
|
||||
<i class="glyph-icon icon-check"></i>
|
||||
</div>
|
||||
<div class="alert-content">
|
||||
<h4 class="alert-title">{$ lsSerial $}</h4>
|
||||
<p>{$ lsexpiration $}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!---------- HTML For Changing Serial No --------------->
|
||||
|
||||
<div ng-hide="changeSerialBox" class="col-md-12">
|
||||
<form action="/" class="form-horizontal bordered-row">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "New key" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" ng-model="newKey" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-click="changeLicense()"
|
||||
class="btn btn-primary btn-lg">{% trans "Change Key" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!---------- HTML For Changing Serial No --------------->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,336 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
|
||||
<div ng-controller="topProcessesV2" class="p-8">
|
||||
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<p class="text-4xl font-bold">Top Processes</p>
|
||||
<img height="20px" ng-hide="cyberPanelLoading"
|
||||
src="/static/images/loading.gif">
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">List of top processes on your server. (Refresh every
|
||||
3 seconds)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col md:flex-col lg:flex-row justify-between gap-4">
|
||||
<div class="w-full">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Cores
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Model Name
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
CPU Mhz
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Cache Size
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
{$ cores $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ modelName $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ cpuMHZ $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ cacheSize $}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Processes
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Running
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Sleeping
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Stopped
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Zombie
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
{$ totalProcesses $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ runningProcesses $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ sleepingProcesses $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ stoppedProcesses $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ zombieProcesses $}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col md:flex-col lg:flex-row justify-between gap-4">
|
||||
<div class="w-full">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
CPU Load
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
1 Min
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
5 Min
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
15 Min
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
{$ cpuNow $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ cpuOne $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ cpuFive $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ cpuFifteen $}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
I/O Wait
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Idle Time
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
HW Interrupts
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Softirqs
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
{$ ioWait $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ idleTime $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ hwInterrupts $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ Softirqs $}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col md:flex-col lg:flex-row justify-between gap-4">
|
||||
<div class="w-full">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Memory
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Free
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Used
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
buff/cache
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
{$ totalMemory $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ freeMemory $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ usedMemory $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ buffCache $}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
SWAP
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Free
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Used
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
buff/cache
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
{$ swapTotalMemory $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ swapFreeMemory $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ swapUsedMemory $}
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
{$ swapBuffCache $}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Top Processes</p>
|
||||
</div>
|
||||
<div class="relative flex items-center w-full h-12 rounded-lg bg-gray-100 overflow-hidden">
|
||||
<div class="grid place-items-center h-full w-12 text-gray-300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
|
||||
</svg>
|
||||
</div>
|
||||
<input placeholder="Search..." ng-model="search" name="dom" type="text"
|
||||
class="h-full w-full bg-gray-100 outline-none text-sm text-gray-700 pr-2" ng-model="domainNameCreate"
|
||||
required>
|
||||
</div>
|
||||
<div>
|
||||
<div class="relative py-5 overflow-x-auto">
|
||||
<table class="w-full text-sm text-left rtl:text-right">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
PID
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
User
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
VIRT
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
RES
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
State
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
%CPU
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
%MEM
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Time
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Command
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Actions
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="process in processes | filter:search"
|
||||
class="border shadow-lg py-3 px-6 rounded-b-lg">
|
||||
<tr>
|
||||
<td ng-bind="process.PID" class="px-6 py-4"></td>
|
||||
<td ng-bind="process.User" class="px-6 py-4"></td>
|
||||
<td ng-bind="process.VIRT" class="px-6 py-4"></td>
|
||||
<td ng-bind="process.RES" class="px-6 py-4"></td>
|
||||
<td ng-bind="process.S" class="px-6 py-4"></td>
|
||||
<td ng-bind="process.CPU" class="px-6 py-4"></td>
|
||||
<td ng-bind="process.MEM" class="px-6 py-4"></td>
|
||||
<td ng-bind="process.Time" class="px-6 py-4"></td>
|
||||
<td ng-bind="process.Command" class="px-6 py-4"></td>
|
||||
<td class="px-6 py-4">
|
||||
<button ng-click="killProcess(process.PID)"
|
||||
class="bg-red-500 hover:bg-red-700 text-white font-bold py-1 px-2 rounded">KILL
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -4,9 +4,11 @@ from . import views
|
|||
urlpatterns = [
|
||||
url(r'^$', views.serverStatusHome, name='serverStatusHome'),
|
||||
url(r'^litespeedStatus$', views.litespeedStatus, name='litespeedStatus'),
|
||||
url(r'^V2/litespeedStatusV2$', views.litespeedStatusV2, name='litespeedStatusV2'),
|
||||
url(r'^startorstopLitespeed$', views.stopOrRestartLitespeed, name='startorstopLitespeed'),
|
||||
url(r'^cyberCPMainLogFile$', views.cyberCPMainLogFile, name='cyberCPMainLogFile'),
|
||||
url(r'^getFurtherDataFromLogFile$',views.getFurtherDataFromLogFile,name='getFurtherDataFromLogFile'),
|
||||
url(r'^V2/cyberCPMainLogFileV2$', views.cyberCPMainLogFileV2, name='cyberCPMainLogFileV2'),
|
||||
url(r'^getFurtherDataFromLogFile$', views.getFurtherDataFromLogFile, name='getFurtherDataFromLogFile'),
|
||||
|
||||
url(r'^servicesStatus$', views.servicesStatus, name='servicesStatus'),
|
||||
url(r'^servicesAction$', views.servicesAction, name='servicesAction'),
|
||||
|
|
@ -17,6 +19,7 @@ urlpatterns = [
|
|||
url(r'^changeLicense$', views.changeLicense, name='changeLicense'),
|
||||
url(r'^refreshLicense$', views.refreshLicense, name='refreshLicense'),
|
||||
url(r'^topProcesses$', views.topProcesses, name='topProcesses'),
|
||||
url(r'^V2/topProcessesV2$', views.topProcessesV2, name='topProcessesV2'),
|
||||
url(r'^topProcessesStatus$', views.topProcessesStatus, name='topProcessesStatus'),
|
||||
url(r'^killProcess$', views.killProcess, name='killProcess'),
|
||||
url(r'^packageManager$', views.packageManager, name='packageManager'),
|
||||
|
|
@ -27,4 +30,4 @@ urlpatterns = [
|
|||
url(r'^CyberPanelPort$', views.CyberPanelPort, name='CyberPanelPort'),
|
||||
url(r'^submitPortChange$', views.submitPortChange, name='submitPortChange'),
|
||||
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -28,11 +28,13 @@ EXPIRE = 3
|
|||
VERSION = '2.3'
|
||||
BUILD = 4
|
||||
|
||||
|
||||
def serverStatusHome(request):
|
||||
proc = httpProc(request, 'serverStatus/index.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def litespeedStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -91,6 +93,66 @@ def litespeedStatus(request):
|
|||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[litespeedStatus]")
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def litespeedStatusV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
processList = ProcessUtilities.getLitespeedProcessNumber()
|
||||
|
||||
OLS = 0
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
OLS = 1
|
||||
|
||||
message = 0
|
||||
|
||||
if request.META['QUERY_STRING'] == 'bundle':
|
||||
message = ''
|
||||
message = BUNDLE
|
||||
elif request.META['QUERY_STRING'] == 'expire':
|
||||
message = 'It looks like your license has expired. Kindly renew your license.'
|
||||
message = EXPIRE
|
||||
else:
|
||||
message = NOTHING
|
||||
try:
|
||||
|
||||
versionInformation = ProcessUtilities.outputExecutioner(["/usr/local/lsws/bin/lshttpd", "-v"]).split("\n")
|
||||
lsversion = versionInformation[0]
|
||||
modules = versionInformation[1]
|
||||
|
||||
counter = 0
|
||||
loadedModules = []
|
||||
|
||||
for items in versionInformation:
|
||||
if counter == 0 or counter == 1:
|
||||
counter = counter + 1
|
||||
continue
|
||||
else:
|
||||
loadedModules.append(items)
|
||||
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[litespeedStatus]")
|
||||
proc = httpProc(request, 'serverStatus/litespeedStatus.html',
|
||||
{"processList": processList,
|
||||
"liteSpeedVersionStatus": "For some reaons not able to load version details, see CyberCP main log file.",
|
||||
'OLS': OLS, 'message': message}, 'admin')
|
||||
return proc.render()
|
||||
if (processList != 0):
|
||||
dataForHtml = {"processList": processList, "lsversion": lsversion, "modules": modules,
|
||||
"loadedModules": loadedModules, 'OLS': OLS, 'message': message}
|
||||
proc = httpProc(request, 'serverStatus/litespeedStatusV2.html', dataForHtml, 'admin')
|
||||
return proc.render()
|
||||
else:
|
||||
dataForHtml = {"lsversion": lsversion, "modules": modules,
|
||||
"loadedModules": loadedModules, 'OLS': OLS, 'message': message}
|
||||
proc = httpProc(request, 'serverStatus/litespeedStatusV2.html', dataForHtml, 'admin')
|
||||
return proc.render()
|
||||
|
||||
except KeyError as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[litespeedStatus]")
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def stopOrRestartLitespeed(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -124,10 +186,17 @@ def stopOrRestartLitespeed(request):
|
|||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[stopOrRestartLitespeed]")
|
||||
return HttpResponse("Not Logged in as admin")
|
||||
|
||||
|
||||
def cyberCPMainLogFile(request):
|
||||
proc = httpProc(request, 'serverStatus/cybercpmainlogfile.html', None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def cyberCPMainLogFileV2(request):
|
||||
proc = httpProc(request, 'serverStatus/cybercpmainlogfileV2.html', None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def getFurtherDataFromLogFile(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -151,6 +220,7 @@ def getFurtherDataFromLogFile(request):
|
|||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[getFurtherDataFromLogFile]")
|
||||
return HttpResponse("Not Logged in as admin")
|
||||
|
||||
|
||||
def services(request):
|
||||
data = {}
|
||||
|
||||
|
|
@ -168,6 +238,7 @@ def services(request):
|
|||
proc = httpProc(request, 'serverStatus/services.html', data, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def servicesStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -276,6 +347,7 @@ def servicesStatus(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def servicesAction(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -328,6 +400,7 @@ def servicesAction(request):
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
|
||||
def switchTOLSWS(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -361,6 +434,7 @@ def switchTOLSWS(request):
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
def switchTOLSWSStatus(request):
|
||||
try:
|
||||
|
||||
|
|
@ -387,10 +461,11 @@ def switchTOLSWSStatus(request):
|
|||
except BaseException as msg:
|
||||
command = "sudo rm -f " + serverStatusUtil.ServerStatusUtil.lswsInstallStatusPath
|
||||
ProcessUtilities.popenExecutioner(command)
|
||||
data_ret = {'status': 0,'abort': 1, 'requestStatus': str(msg), 'installed': 0}
|
||||
data_ret = {'status': 0, 'abort': 1, 'requestStatus': str(msg), 'installed': 0}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
def licenseStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -407,7 +482,8 @@ def licenseStatus(request):
|
|||
serial = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
if serial.find('No such file or directory') > -1:
|
||||
final_dic = {'status': 1, "erroMessage": 0, 'lsSerial': 'Trial License in use.', 'lsexpiration': 'Trial license expires 15 days after activation.'}
|
||||
final_dic = {'status': 1, "erroMessage": 0, 'lsSerial': 'Trial License in use.',
|
||||
'lsexpiration': 'Trial license expires 15 days after activation.'}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
|
|
@ -427,6 +503,7 @@ def licenseStatus(request):
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
|
||||
def refreshLicense(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -439,7 +516,6 @@ def refreshLicense(request):
|
|||
else:
|
||||
return ACLManager.loadErrorJson('status', 0)
|
||||
|
||||
|
||||
command = 'sudo /usr/local/lsws/bin/lshttpd -V'
|
||||
ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
|
|
@ -512,6 +588,12 @@ def topProcesses(request):
|
|||
proc = httpProc(request, "serverStatus/topProcesses.html", None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def topProcessesV2(request):
|
||||
proc = httpProc(request, "serverStatus/topProcessesV2.html", None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def topProcessesStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -586,7 +668,6 @@ def topProcessesStatus(request):
|
|||
memoryInf0[1] = list(filter(None, memoryInf0[1].split(' ')))
|
||||
memoryInf0[2] = list(filter(None, memoryInf0[2].split(' ')))
|
||||
|
||||
|
||||
try:
|
||||
data['totalMemory'] = '%sMB' % (memoryInf0[1][1])
|
||||
except:
|
||||
|
|
@ -606,7 +687,6 @@ def topProcessesStatus(request):
|
|||
except:
|
||||
data['buffCache'] = '%sMB' % ('0')
|
||||
|
||||
|
||||
## Swap
|
||||
|
||||
try:
|
||||
|
|
@ -681,8 +761,8 @@ def topProcessesStatus(request):
|
|||
total, used, free = shutil.disk_usage("/")
|
||||
|
||||
data['TotalDisk'] = '%s GB' % (total // (2 ** 30))
|
||||
data['TotalDiskUsed'] = '%s GB' % (used // (2 ** 30))
|
||||
data['TotalDiskFree'] =' %s GB' % (free // (2 ** 30))
|
||||
data['TotalDiskUsed'] = '%s GB' % (used // (2 ** 30))
|
||||
data['TotalDiskFree'] = ' %s GB' % (free // (2 ** 30))
|
||||
|
||||
final_json = json.dumps(data)
|
||||
return HttpResponse(final_json)
|
||||
|
|
@ -692,6 +772,7 @@ def topProcessesStatus(request):
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
def killProcess(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -721,10 +802,12 @@ def killProcess(request):
|
|||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
|
||||
def packageManager(request):
|
||||
proc = httpProc(request, "serverStatus/packageManager.html", None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
|
||||
def fetchPackages(request):
|
||||
try:
|
||||
|
||||
|
|
@ -842,8 +925,7 @@ def fetchPackages(request):
|
|||
|
||||
## make list of packages that need update
|
||||
|
||||
|
||||
#if os.path.exists(ProcessUtilities.debugPath):
|
||||
# if os.path.exists(ProcessUtilities.debugPath):
|
||||
# logging.CyberCPLogFileWriter.writeToFile('All packages: %s' % (str(packages)))
|
||||
|
||||
from s3Backups.s3Backups import S3Backups
|
||||
|
|
@ -857,7 +939,7 @@ def fetchPackages(request):
|
|||
counter = 0
|
||||
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.CyberCPLogFileWriter.writeToFile('Final packages: %s' % (str(finalPackages)))
|
||||
logging.CyberCPLogFileWriter.writeToFile('Final packages: %s' % (str(finalPackages)))
|
||||
|
||||
import re
|
||||
for items in finalPackages:
|
||||
|
|
@ -896,7 +978,9 @@ def fetchPackages(request):
|
|||
else:
|
||||
lock = 0
|
||||
|
||||
dic = {'package': nowSplitted[0].split('/')[0], 'version': '%s %s' % (nowSplitted[1].split(' ')[1], nowSplitted[1].split(' ')[2]), 'upgrade': upgrade, 'lock': lock}
|
||||
dic = {'package': nowSplitted[0].split('/')[0],
|
||||
'version': '%s %s' % (nowSplitted[1].split(' ')[1], nowSplitted[1].split(' ')[2]),
|
||||
'upgrade': upgrade, 'lock': lock}
|
||||
|
||||
counter = counter + 1
|
||||
if checker == 0:
|
||||
|
|
@ -923,7 +1007,6 @@ def fetchPackages(request):
|
|||
else:
|
||||
upgrade = 'Upgrade available'
|
||||
|
||||
|
||||
if details[0].split('.')[0] in locked:
|
||||
lock = 1
|
||||
else:
|
||||
|
|
@ -965,7 +1048,8 @@ def fetchPackages(request):
|
|||
|
||||
json_data = json_data + ']'
|
||||
|
||||
data_ret = {'status': 1, 'packages': json_data, 'pagination': pagination, 'fetchedPackages': counter, 'totalPackages': len(packages)}
|
||||
data_ret = {'status': 1, 'packages': json_data, 'pagination': pagination, 'fetchedPackages': counter,
|
||||
'totalPackages': len(packages)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
|
@ -974,6 +1058,7 @@ def fetchPackages(request):
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
def fetchPackageDetails(request):
|
||||
try:
|
||||
|
||||
|
|
@ -1004,6 +1089,7 @@ def fetchPackageDetails(request):
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
def updatePackage(request):
|
||||
try:
|
||||
|
||||
|
|
@ -1027,7 +1113,7 @@ def updatePackage(request):
|
|||
extraArgs = {}
|
||||
extraArgs['package'] = package
|
||||
|
||||
from plogical.applicationInstaller import ApplicationInstaller
|
||||
from plogical.applicationInstaller import ApplicationInstaller
|
||||
|
||||
background = ApplicationInstaller('updatePackage', extraArgs)
|
||||
background.start()
|
||||
|
|
@ -1043,6 +1129,7 @@ def updatePackage(request):
|
|||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
def lockStatus(request):
|
||||
try:
|
||||
|
||||
|
|
@ -1179,11 +1266,11 @@ def submitPortChange(request):
|
|||
|
||||
ProcessUtilities.executioner('systemctl restart lscpd')
|
||||
|
||||
data_ret = {'status': 1,}
|
||||
data_ret = {'status': 1, }
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
except BaseException as msg:
|
||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
return HttpResponse(json_data)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,350 @@
|
|||
$("#tuningLoading").hide();
|
||||
$("#canNotFetchTuning").hide();
|
||||
$("#notTuned").hide();
|
||||
$("#tuned").hide();
|
||||
$("#phpDetails").hide();
|
||||
$("#tunePHPLoading").hide();
|
||||
|
||||
|
||||
newapp.controller('litespeedTuningV2', function ($scope, $http) {
|
||||
|
||||
|
||||
url = "/tuning/tuneLitespeed";
|
||||
|
||||
var data = {
|
||||
status: "fetch"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.fetch_status == 1) {
|
||||
|
||||
$("#canNotFetchTuning").hide();
|
||||
|
||||
var currentTuningData = JSON.parse(response.data.tuning_data);
|
||||
|
||||
$scope.maxConnections = currentTuningData.maxConnections;
|
||||
$scope.maxSSLConnections = currentTuningData.maxSSLConnections;
|
||||
$scope.connectionTimeOut = currentTuningData.connTimeout;
|
||||
$scope.keepAliveTimeOut = currentTuningData.keepAliveTimeout;
|
||||
$scope.cacheSizeInMemory = currentTuningData.totalInMemCacheSize;
|
||||
|
||||
if (currentTuningData.enableGzipCompress == 1)
|
||||
$scope.gzipStatus = "Enable"
|
||||
else
|
||||
$scope.gzipStatus = "Disabled"
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$errMessage = response.data.error_message;
|
||||
$("#canNotFetchTuning").fadeIn();
|
||||
}
|
||||
|
||||
|
||||
$scope.saveTuningSettings = function () {
|
||||
|
||||
$("#tuningLoading").fadeIn();
|
||||
$('#tuned').hide();
|
||||
|
||||
var maxConn = $scope.maxConnections;
|
||||
var maxSSLConn = $scope.maxSSLConnections;
|
||||
var connTime = $scope.connectionTimeOut;
|
||||
var keepAlive = $scope.keepAliveTimeOut;
|
||||
var inMemCache = $scope.cacheSizeInMemory;
|
||||
var gzipCompression = $scope.gzipCompression;
|
||||
|
||||
url = "/tuning/tuneLitespeed";
|
||||
|
||||
|
||||
var data = {
|
||||
maxConn: maxConn,
|
||||
maxSSLConn: maxSSLConn,
|
||||
keepAlive: keepAlive,
|
||||
connTime: connTime,
|
||||
inMemCache: inMemCache,
|
||||
gzipCompression: gzipCompression,
|
||||
status: "save"
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.tuneStatus == 1) {
|
||||
|
||||
$("#canNotFetchTuning").hide();
|
||||
$("#tuned").fadeIn();
|
||||
$("#notTuned").hide();
|
||||
$("#tuningLoading").hide();
|
||||
} else {
|
||||
$scope.errMessage = response.data.error_message;
|
||||
$("#notTuned").fadeIn();
|
||||
$("#tuned").hide();
|
||||
$("#tuningLoading").hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.errMessage = response.data.error_message;
|
||||
$("#notTuned").fadeIn();
|
||||
$("#tuned").hide();
|
||||
$("#tuningLoading").hide();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
/* Java script code for litespeed tuning ends here */
|
||||
$('#canNotFetch').hide();
|
||||
$('#successfullyFetched').hide();
|
||||
$('#successfullyTuned').hide();
|
||||
$('#canNotTune').hide();
|
||||
|
||||
newapp.controller('tunePHPV2', function ($scope, $http) {
|
||||
|
||||
$scope.hideDetails = true;
|
||||
|
||||
|
||||
$scope.fetchPHPDetails = function () {
|
||||
|
||||
$("#tunePHPLoading").fadeIn();
|
||||
|
||||
|
||||
url = "/tuning/tunePHP";
|
||||
|
||||
|
||||
var data = {
|
||||
status: "fetch",
|
||||
domainSelection: $scope.domainSelection,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.fetch_status == 1) {
|
||||
|
||||
$("#tunePHPLoading").hide();
|
||||
$('#canNotFetch').hide();
|
||||
$('#successfullyTuned').hide();
|
||||
$('#canNotTune').hide();
|
||||
|
||||
|
||||
$('#successfullyFetched').fadeIn();
|
||||
|
||||
var phpData = JSON.parse(response.data.tuning_data);
|
||||
|
||||
$scope.initTimeout = Number(phpData.initTimeout);
|
||||
$scope.maxConns = Number(phpData.maxConns);
|
||||
$scope.memSoftLimit = phpData.memSoftLimit;
|
||||
$scope.memHardLimit = phpData.memHardLimit;
|
||||
$scope.procSoftLimit = Number(phpData.procSoftLimit);
|
||||
$scope.procHardLimit = Number(phpData.procHardLimit);
|
||||
|
||||
|
||||
if (phpData.persistConn == "1")
|
||||
$scope.persistStatus = "Enabled";
|
||||
else
|
||||
$scope.persistStatus = "Disabled";
|
||||
|
||||
$scope.hideDetails = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$errMessage = response.data.error_message;
|
||||
$('#canNotFetch').fadeIn();
|
||||
$('#successfullyFetched').hide();
|
||||
$('#successfullyTuned').hide();
|
||||
$('#canNotTune').hide();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$scope.fetchPHPDetails = function () {
|
||||
|
||||
|
||||
$("#tunePHPLoading").fadeIn();
|
||||
|
||||
|
||||
url = "/tuning/tunePHP";
|
||||
|
||||
|
||||
var data = {
|
||||
status: "fetch",
|
||||
domainSelection: $scope.domainSelection,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.fetch_status == 1) {
|
||||
|
||||
$("#tunePHPLoading").hide();
|
||||
|
||||
$('#canNotFetch').hide();
|
||||
$('#successfullyTuned').hide();
|
||||
$('#canNotTune').hide();
|
||||
|
||||
|
||||
$('#successfullyFetched').fadeIn();
|
||||
|
||||
var phpData = JSON.parse(response.data.tuning_data);
|
||||
|
||||
$scope.initTimeout = Number(phpData.initTimeout);
|
||||
$scope.maxConns = Number(phpData.maxConns);
|
||||
$scope.memSoftLimit = phpData.memSoftLimit;
|
||||
$scope.memHardLimit = phpData.memHardLimit;
|
||||
$scope.procSoftLimit = Number(phpData.procSoftLimit);
|
||||
$scope.procHardLimit = Number(phpData.procHardLimit);
|
||||
|
||||
|
||||
if (phpData.persistConn == "1")
|
||||
$scope.persistStatus = "Enabled";
|
||||
else
|
||||
$scope.persistStatus = "Disabled";
|
||||
|
||||
$scope.hideDetails = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$errMessage = response.data.error_message;
|
||||
$('#canNotFetch').fadeIn();
|
||||
$('#successfullyFetched').hide();
|
||||
$('#successfullyTuned').hide();
|
||||
$('#canNotTune').hide();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$scope.tunePHPFunc = function () {
|
||||
|
||||
|
||||
$("#tunePHPLoading").fadeIn();
|
||||
|
||||
|
||||
var initTimeout = $scope.initTimeout;
|
||||
var maxConns = $scope.maxConns;
|
||||
var memSoftLimit = $scope.memSoftLimit;
|
||||
var memHardLimit = $scope.memHardLimit;
|
||||
var procSoftLimit = $scope.procSoftLimit;
|
||||
var procHardLimit = $scope.procHardLimit;
|
||||
var persistConn = $scope.persistConn;
|
||||
|
||||
|
||||
url = "/tuning/tunePHP";
|
||||
|
||||
|
||||
var data = {
|
||||
status: "save",
|
||||
domainSelection: $scope.domainSelection,
|
||||
initTimeout: initTimeout,
|
||||
maxConns: maxConns,
|
||||
memSoftLimit: memSoftLimit,
|
||||
memHardLimit: memHardLimit,
|
||||
procSoftLimit: procSoftLimit,
|
||||
procHardLimit: procHardLimit,
|
||||
persistConn: persistConn
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.tuneStatus == 1) {
|
||||
|
||||
$scope.phpVersionTuned = $scope.domainSelection;
|
||||
|
||||
$("#tunePHPLoading").hide();
|
||||
$('#canNotFetch').hide();
|
||||
$('#successfullyFetched').hide();
|
||||
$('#canNotTune').hide();
|
||||
$('#successfullyTuned').fadeIn();
|
||||
$scope.hideDetails = false;
|
||||
} else {
|
||||
$("#tunePHPLoading").hide();
|
||||
$('#canNotFetch').hide();
|
||||
$('#successfullyFetched').hide();
|
||||
$('#canNotTune').fadeIn();
|
||||
$('#successfullyTuned').hide();
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.hideDetails = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$errMessage = response.data.error_message;
|
||||
$("#tunePHPLoading").hide();
|
||||
$('#canNotFetch').hide();
|
||||
$('#successfullyFetched').hide();
|
||||
$('#canNotTune').fadeIn();
|
||||
$('#successfullyTuned').hide();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
<div ng-controller="litespeedTuningV2" class="p-8">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">LiteSpeed Tuning</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">You can use this page to tweak your server according to
|
||||
your website requirments.</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Tuning Details</p>
|
||||
<img id="tuningLoading" src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
<div class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Max Connections</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="maxConnections"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Max SSL Connections</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="maxSSLConnections"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Connection Timeout</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="connectionTimeOut"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Keep Alive Timeout</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="keepAliveTimeOut"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Cache Size in memory</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="cacheSizeInMemory"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Enable GZIP Compression</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-model="gzipCompression" class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
<option>Enable</option>
|
||||
<option>Disable</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="w-80 ml-4">
|
||||
{$ gzipStatus $}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center mt-6">
|
||||
<button ng-click="saveTuningSettings()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Tune Web Server
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div id="canNotFetchTuning"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Cannot fetch Current Value, but you can still submit new changes, error reported from server:" %}
|
||||
{$ errMessage $}</p>
|
||||
</div>
|
||||
<div id="notTuned"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Cannot save details, Error Message: " %}{$ errMessage $} </p>
|
||||
</div>
|
||||
<div id="tuned" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Web Server Successfully tuned." %} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,266 @@
|
|||
{% extends "baseTemplate/newBase.html" %}
|
||||
{% load i18n %}
|
||||
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
|
||||
{% block newContent %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% if OLS %}
|
||||
<div ng-controller="tunePHPV2" class="p-8">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">PHP Tuning</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Set how each version of PHP behaves in your server
|
||||
here.</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Select PHP Version</p>
|
||||
<img id="tunePHPLoading"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<form action="/" id="modifyPackageForm">
|
||||
<div>
|
||||
<div class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Select Domain</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-change="fetchPHPDetails()" ng-model="domainSelection"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
{% for items in websiteList %}
|
||||
<option>{{ items }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Initial Request Timeout (secs)</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="initTimeout"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Max Connections</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="maxConns"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Memory Soft Limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="memSoftLimit"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Memory Hard Limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="memHardLimit"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Process Soft Limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="procSoftLimit"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Process Hard Limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="procHardLimit"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Persistent Connection</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-model="persistConn" class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
<option>{% trans "Enable" %}</option>
|
||||
<option>{% trans "Disable" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="w-80 ml-4">
|
||||
{$ persistStatus $}
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex justify-center mt-6">
|
||||
<button ng-click="tunePHPFunc()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Tune PHP
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div id="canNotFetch"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Cannot fetch details. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div id="canNotTune"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Cannot tune. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div id="successfullyFetched"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Details Successfully fetched." %}</p>
|
||||
</div>
|
||||
<div id="successfullyTuned"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "PHP for " %}<strong>{$ phpVersionTuned
|
||||
$}</strong> {% trans "Successfully tuned." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div ng-controller="tunePHPV2" class="p-8">
|
||||
<div>
|
||||
<p class="text-4xl font-bold">PHP Tuning</p>
|
||||
<p class="text-xs text-gray-600 py-2 font-semibold">Set how each version of PHP behaves in your server
|
||||
here.</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center py-4">
|
||||
<p class="text-xl font-bold">Select PHP Version</p>
|
||||
<img id="tunePHPLoading"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</div>
|
||||
<hr>
|
||||
<form action="/" id="modifyPackageForm">
|
||||
<div>
|
||||
<div class="flex mt-4 py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Select PHP</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-change="fetchPHPDetails()" ng-model="domainSelection"
|
||||
class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
<option>lsphp53</option>
|
||||
<option>lsphp54</option>
|
||||
<option>lsphp55</option>
|
||||
<option>lsphp56</option>
|
||||
<option>lsphp71</option>
|
||||
<option>lsphp72</option>
|
||||
<option>lsphp73</option>
|
||||
<option>lsphp74</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Initial Request Timeout (secs)</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="initTimeout"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Max Connections</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="maxConns"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Memory Soft Limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="memSoftLimit"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Memory Hard Limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="memHardLimit"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Process Soft Limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="procSoftLimit"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Process Hard Limit</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="procHardLimit"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex py-2 px-6">
|
||||
<div>
|
||||
<p class="font-semibold w-60">Persistent Connection</p>
|
||||
</div>
|
||||
<div>
|
||||
<select ng-model="persistConn" class="w-80 bg-gray-100 rounded px-2 py-1">
|
||||
<option>{% trans "Enable" %}</option>
|
||||
<option>{% trans "Disable" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="w-80 ml-4">
|
||||
{$ persistStatus $}
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="hideDetails" class="flex justify-center mt-6">
|
||||
<button ng-click="tunePHPFunc()"
|
||||
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
|
||||
Tune PHP
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div id="canNotFetch"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Cannot fetch details. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div id="canNotTune"
|
||||
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
|
||||
<p>{% trans "Cannot tune. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
<div id="successfullyFetched"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "Details Successfully fetched." %}</p>
|
||||
</div>
|
||||
<div id="successfullyTuned"
|
||||
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
|
||||
<p>{% trans "PHP for " %}<strong>{$ phpVersionTuned
|
||||
$}</strong> {% trans "Successfully tuned." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
@ -30,6 +30,11 @@ class tuningManager:
|
|||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def liteSpeedTuningV2(self, request, userID):
|
||||
proc = httpProc(request, 'tuning/liteSpeedTuningV2.html',
|
||||
None, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def phpTuning(self, request, userID):
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
|
|
@ -44,6 +49,20 @@ class tuningManager:
|
|||
{'OLS': OLS}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def phpTuningV2(self, request, userID):
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||
OLS = 1
|
||||
proc = httpProc(request, 'tuning/phpTuning.html',
|
||||
{'websiteList': websitesName, 'OLS': OLS}, 'admin')
|
||||
return proc.render()
|
||||
else:
|
||||
OLS = 0
|
||||
proc = httpProc(request, 'tuning/phpTuningV2.html',
|
||||
{'OLS': OLS}, 'admin')
|
||||
return proc.render()
|
||||
|
||||
def tuneLitespeed(self, userID, data):
|
||||
try:
|
||||
|
||||
|
|
@ -171,4 +190,4 @@ class tuningManager:
|
|||
data_ret = {'fetch_status': 0, 'error_message': str(msg), 'tuneStatus': 0}
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [tunePHP]]")
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
return HttpResponse(json_data)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
from django.conf.urls import url,include
|
||||
from django.conf.urls import url, include
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.loadTuningHome, name='loadTuningHome'),
|
||||
url(r'^litespeedTuning', views.liteSpeedTuning, name='liteSpeedTuning'),
|
||||
url(r'^V2/litespeedTuningV2', views.liteSpeedTuningV2, name='liteSpeedTuningV2'),
|
||||
url(r'^phpTuning', views.phpTuning, name='phpTuning'),
|
||||
|
||||
|
||||
url(r'^V2/phpTuningV2', views.phpTuningV2, name='phpTuningV2'),
|
||||
|
||||
url(r'^tuneLitespeed', views.tuneLitespeed, name='tuneLitespeed'),
|
||||
url(r'^tunePHP', views.tunePHP, name='tunePHP'),
|
||||
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ from django.shortcuts import redirect
|
|||
import json
|
||||
from loginSystem.views import loadLoginPage
|
||||
from .tuning import tuningManager
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
||||
|
||||
|
|
@ -15,6 +17,7 @@ def loadTuningHome(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def liteSpeedTuning(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -23,6 +26,16 @@ def liteSpeedTuning(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def liteSpeedTuningV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
tm = tuningManager()
|
||||
return tm.liteSpeedTuningV2(request, userID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def phpTuning(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -31,6 +44,16 @@ def phpTuning(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def phpTuningV2(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
tm = tuningManager()
|
||||
return tm.phpTuningV2(request, userID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def tuneLitespeed(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
|
@ -39,10 +62,11 @@ def tuneLitespeed(request):
|
|||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def tunePHP(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
tm = tuningManager()
|
||||
return tm.tunePHP(userID, json.loads(request.body))
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
return redirect(loadLoginPage)
|
||||
|
|
|
|||
Loading…
Reference in New Issue