port docker manager to ubuntu

This commit is contained in:
usmannasir
2019-01-09 14:55:10 +05:00
parent fd084580f6
commit f9bfccee60
11 changed files with 1337 additions and 981 deletions

View File

@@ -6,7 +6,58 @@
<style>
/* Loading Spinner */
.spinner{margin:0;width:70px;height:18px;margin:-35px 0 0 -9px;position:absolute;top:50%;left:50%;text-align:center}.spinner > div{width:18px;height:18px;background-color:#333;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner .bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}
.spinner {
margin: 0;
width: 70px;
height: 18px;
margin: -35px 0 0 -9px;
position: absolute;
top: 50%;
left: 50%;
text-align: center
}
.spinner > div {
width: 18px;
height: 18px;
background-color: #333;
border-radius: 100%;
display: inline-block;
-webkit-animation: bouncedelay 1.4s infinite ease-in-out;
animation: bouncedelay 1.4s infinite ease-in-out;
-webkit-animation-fill-mode: both;
animation-fill-mode: both
}
.spinner .bounce1 {
-webkit-animation-delay: -.32s;
animation-delay: -.32s
}
.spinner .bounce2 {
-webkit-animation-delay: -.16s;
animation-delay: -.16s
}
@-webkit-keyframes bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0.0)
}
40% {
-webkit-transform: scale(1.0)
}
}
@keyframes bouncedelay {
0%, 80%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0)
}
40% {
transform: scale(1.0);
-webkit-transform: scale(1.0)
}
}
</style>
@@ -41,12 +92,12 @@
<link rel="stylesheet" type="text/css" href="/static/baseTemplate/assets/themes/admin/layout.css">
<link rel="stylesheet" type="text/css" href="/static/baseTemplate/assets/themes/admin/color-schemes/default.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/custom-js/pnotify.custom.min.css' %}">
<!-- Components theme, component below was above three CSS files. -->
<!-- Admin responsive -->
@@ -74,7 +125,6 @@
<div id="sb-site">
<!------- ng-controller="systemStatusInfo" ------------>
@@ -83,8 +133,6 @@
<div class="pad15A">
<div class="clear"></div>
@@ -134,8 +182,6 @@
</div>
<div id="loading">
<div class="spinner">
<div class="bounce1"></div>
@@ -147,7 +193,8 @@
<div id="page-wrapper">
<div id="page-header" class="bg-gradient-9">
<div id="mobile-navigation">
<button id="nav-toggle" class="collapsed" data-toggle="collapse" data-target="#page-sidebar"><span></span></button>
<button id="nav-toggle" class="collapsed" data-toggle="collapse" data-target="#page-sidebar">
<span></span></button>
<a href="{% url "index" %}" class="logo-content-small" title="{% trans 'CyberPanel' %}"></a>
</div>
<div id="header-logo" class="logo-bg">
@@ -166,7 +213,8 @@
<div id="header-nav-left">
<div ng-controller="adminController" class="user-account-btn dropdown">
<a href="#" title="{% trans 'My Account' %}" class="user-profile clearfix" data-toggle="dropdown">
<img width="28" src="{% static 'baseTemplate/assets/image-resources/gravatar.png' %}" alt="Profile image">
<img width="28" src="{% static 'baseTemplate/assets/image-resources/gravatar.png' %}"
alt="Profile image">
<span>{$ currentAdmin $}</span>
<i class="glyph-icon icon-angle-down"></i>
</a>
@@ -182,8 +230,10 @@
{$ currentAdmin $}
<i>{$ admin_type $}</i>
</span>
<a href="{% url 'modifyUsers' %}" title="{% trans 'Edit profile' %}">{% trans "Edit profile" %}</a>
<a href="{% url 'viewProfile' %}" title="{% trans 'View Profile' %}">{% trans "View Profile" %}</a>
<a href="{% url 'modifyUsers' %}"
title="{% trans 'Edit profile' %}">{% trans "Edit profile" %}</a>
<a href="{% url 'viewProfile' %}"
title="{% trans 'View Profile' %}">{% trans "View Profile" %}</a>
</div>
</div>
<div class="divider"></div>
@@ -201,56 +251,66 @@
<div ng-controller="loadAvg" id="header-nav-right">
<a class="hide-on-phone" style="background-color: none;width: 33px" href="#" class="hdr-btn" title="{% trans 'CPU Load Average' %}" data-placement="bottom" >
<a class="hide-on-phone" style="background-color: none;width: 33px" href="#" class="hdr-btn"
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
<span class="badge bg-yellow">{$ one $}</span>
</a>
<a class="hide-on-phone" style="background-color: none;width: 33px" href="#" class="hdr-btn" title="{% trans 'CPU Load Average' %}" data-placement="bottom" >
<a class="hide-on-phone" style="background-color: none;width: 33px" href="#" class="hdr-btn"
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
<span class="badge bg-yellow">{$ two $}</span>
</a>
<a class="hide-on-phone" style="background-color: none;width: 33px" href="#" class="hdr-btn" title="{% trans 'CPU Load Average' %}" data-placement="bottom">
<a class="hide-on-phone" style="background-color: none;width: 33px" href="#" class="hdr-btn"
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
<span class="badge bg-yellow">{$ three $}</span>
</a>
<div class="dropdown" id="dashnav-btn">
<a href="#" data-toggle="dropdown" data-placement="bottom" class="popover-button-header tooltip-button" title="{% trans 'Dashboard Quick Menu' %}">
<a href="#" data-toggle="dropdown" data-placement="bottom"
class="popover-button-header tooltip-button" title="{% trans 'Dashboard Quick Menu' %}">
<i class="glyph-icon icon-linecons-cog"></i>
</a>
<div class="dropdown-menu float-right">
<div class="box-sm">
<div class="pad5T pad5B pad10L pad10R dashboard-buttons clearfix">
<a href="{% url 'loadWebsitesHome' %}" class="btn vertical-button remove-border btn-info" title="{% trans '' %}">
<a href="{% url 'loadWebsitesHome' %}"
class="btn vertical-button remove-border btn-info" title="{% trans '' %}">
<span class="glyph-icon icon-separator-vertical pad0A medium">
<i class="glyph-icon icon-dashboard opacity-80 font-size-20"></i>
</span>
{% trans "Websites" %}
</a>
<a href="{% url 'packagesHome' %}" class="btn vertical-button remove-border btn-danger" title="{% trans '' %}">
<a href="{% url 'packagesHome' %}" class="btn vertical-button remove-border btn-danger"
title="{% trans '' %}">
<span class="glyph-icon icon-separator-vertical pad0A medium">
<i class="glyph-icon icon-tags opacity-80 font-size-20"></i>
</span>
{% trans "Packages" %}
</a>
<a href="{% url 'dnsHome' %}" class="btn vertical-button remove-border btn-purple" title="{% trans '' %}">
<a href="{% url 'dnsHome' %}" class="btn vertical-button remove-border btn-purple"
title="{% trans '' %}">
<span class="glyph-icon icon-separator-vertical pad0A medium">
<i class="glyph-icon icon-fire opacity-80 font-size-20"></i>
</span>
{% trans "DNS" %}
</a>
<a href="{% url 'loadFTPHome' %}" class="btn vertical-button remove-border btn-azure" title="{% trans '' %}">
<a href="{% url 'loadFTPHome' %}" class="btn vertical-button remove-border btn-azure"
title="{% trans '' %}">
<span class="glyph-icon icon-separator-vertical pad0A medium">
<i class="glyph-icon icon-bar-chart-o opacity-80 font-size-20"></i>
</span>
{% trans "FTP" %}
</a>
<a href="{% url 'loadTuningHome' %}" class="btn vertical-button remove-border btn-yellow" title="{% trans '' %}">
<a href="{% url 'loadTuningHome' %}"
class="btn vertical-button remove-border btn-yellow" title="{% trans '' %}">
<span class="glyph-icon icon-separator-vertical pad0A medium">
<i class="glyph-icon icon-laptop opacity-80 font-size-20"></i>
</span>
{% trans "Tuning" %}
</a>
<a href="{% url 'serverStatusHome' %}" class="btn vertical-button remove-border btn-warning" title="{% trans '' %}">
<a href="{% url 'serverStatusHome' %}"
class="btn vertical-button remove-border btn-warning" title="{% trans '' %}">
<span class="glyph-icon icon-separator-vertical pad0A medium">
<i class="glyph-icon icon-code opacity-80 font-size-20"></i>
</span>
@@ -278,19 +338,25 @@
<li class="header"><span>{% trans "Overview" %}</span></li>
<li>
<a href="#" title="{% trans 'Server IP Address' %}">
<i class="glyph-icon tooltip-button icon-laptop" title="{% trans 'Server IP Address' %}" data-original-title=".icon-laptop"></i>
<i class="glyph-icon tooltip-button icon-laptop" title="{% trans 'Server IP Address' %}"
data-original-title=".icon-laptop"></i>
<span style="color: #db6868;font-weight: bold;" id="serverIPAddress"></span>
</a>
<a href="{% url 'index' %}" title="{% trans 'Dashboard' %}">
<i class="glyph-icon icon-linecons-tv"></i>
<span>{% trans "Dashboard" %}</span>
</a>
<a class="versionManagement" href="{% url 'versionManagment' %}" title="{% trans 'Version Management' %}">
<i class="glyph-icon tooltip-button icon-cloud-upload" title="{% trans 'Version Management' %}" data-original-title=".icon-cloud-upload" aria-describedby="tooltip896208"></i>
<a class="versionManagement" href="{% url 'versionManagment' %}"
title="{% trans 'Version Management' %}">
<i class="glyph-icon tooltip-button icon-cloud-upload"
title="{% trans 'Version Management' %}" data-original-title=".icon-cloud-upload"
aria-describedby="tooltip896208"></i>
<span>{% trans "Version Management" %}</span>
</a>
<a class="versionManagement" href="https://platform.cyberpanel.net" title="{% trans 'Connect' %}">
<i class="glyph-icon tooltip-button icon-cloud" title="{% trans 'Connect' %}" data-original-title=".icon-cloud-upload" aria-describedby="tooltip896208"></i>
<a class="versionManagement" href="https://platform.cyberpanel.net"
title="{% trans 'Connect' %}">
<i class="glyph-icon tooltip-button icon-cloud" title="{% trans 'Connect' %}"
data-original-title=".icon-cloud-upload" aria-describedby="tooltip896208"></i>
<span>{% trans "Connect" %}</span>
</a>
</li>
@@ -305,15 +371,32 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'viewProfile' %}" title="{% trans 'View Profile' %}"><span>{% trans "View Profile" %}</span></a></li>
<li class="createNewUser"><a href="{% url 'createUser' %}" title="{% trans 'Create New User' %}"><span>{% trans "Create New User" %}</span></a></li>
<li><a href="{% url 'modifyUsers' %}" title="{% trans 'Modify User' %}"><span>{% trans "Modify User" %}</span></a></li>
<li class="deleteUser"><a href="{% url 'deleteUser' %}" title="{% trans 'Delete User' %}"><span>{% trans "Delete User" %}</span></a></li>
<li class="resellerCenter"><a href="{% url 'resellerCenter' %}" title="{% trans 'Reseller Center' %}"><span>{% trans "Reseller Center" %}</span></a></li>
<li class="changeUserACL"><a href="{% url 'changeUserACL' %}" title="{% trans 'Change User ACL' %}"><span>{% trans "Change User ACL" %}</span></a></li>
<li class="serverACL"><a href="{% url 'createNewACL' %}" title="{% trans 'Create New ACL' %}"><span>{% trans "Create New ACL" %}</span></a></li>
<li class="serverACL"><a href="{% url 'deleteACL' %}" title="{% trans 'Delete ACL' %}"><span>{% trans "Delete ACL" %}</span></a></li>
<li class="serverACL"><a href="{% url 'modifyACL' %}" title="{% trans 'Modify ACL' %}"><span>{% trans "Modify ACL" %}</span></a></li>
<li><a href="{% url 'viewProfile' %}"
title="{% trans 'View Profile' %}"><span>{% trans "View Profile" %}</span></a>
</li>
<li class="createNewUser"><a href="{% url 'createUser' %}"
title="{% trans 'Create New User' %}"><span>{% trans "Create New User" %}</span></a>
</li>
<li><a href="{% url 'modifyUsers' %}"
title="{% trans 'Modify User' %}"><span>{% trans "Modify User" %}</span></a></li>
<li class="deleteUser"><a href="{% url 'deleteUser' %}"
title="{% trans 'Delete User' %}"><span>{% trans "Delete User" %}</span></a>
</li>
<li class="resellerCenter"><a href="{% url 'resellerCenter' %}"
title="{% trans 'Reseller Center' %}"><span>{% trans "Reseller Center" %}</span></a>
</li>
<li class="changeUserACL"><a href="{% url 'changeUserACL' %}"
title="{% trans 'Change User ACL' %}"><span>{% trans "Change User ACL" %}</span></a>
</li>
<li class="serverACL"><a href="{% url 'createNewACL' %}"
title="{% trans 'Create New ACL' %}"><span>{% trans "Create New ACL" %}</span></a>
</li>
<li class="serverACL"><a href="{% url 'deleteACL' %}"
title="{% trans 'Delete ACL' %}"><span>{% trans "Delete ACL" %}</span></a>
</li>
<li class="serverACL"><a href="{% url 'modifyACL' %}"
title="{% trans 'Modify ACL' %}"><span>{% trans "Modify ACL" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -327,11 +410,21 @@
<div class="sidebar-submenu">
<ul>
<li class="createWebsite"><a href="{% url 'createWebsite' %}" title="{% trans 'Create Website' %}"><span>{% trans "Create Website" %}</span></a></li>
<li><a href="{% url 'listWebsites' %}" title="{% trans 'List Websites' %}"><span>{% trans "List Websites" %}</span></a></li>
<li class="modifyWebsite"><a href="{% url 'modifyWebsite' %}" title="{% trans 'Modify Website' %}"><span>{% trans "Modify Website" %}</span></a></li>
<li class="suspendWebsite"><a href="{% url 'siteState' %}" title="{% trans 'Suspend/Unsuspend' %}"><span>{% trans "Suspend/Unsuspend" %}</span></a></li>
<li class="deleteWebsite"><a href="{% url 'deleteWebsite' %}" title="{% trans 'Delete Website' %}"><span>{% trans "Delete Website" %}</span></a></li>
<li class="createWebsite"><a href="{% url 'createWebsite' %}"
title="{% trans 'Create Website' %}"><span>{% trans "Create Website" %}</span></a>
</li>
<li><a href="{% url 'listWebsites' %}"
title="{% trans 'List Websites' %}"><span>{% trans "List Websites" %}</span></a>
</li>
<li class="modifyWebsite"><a href="{% url 'modifyWebsite' %}"
title="{% trans 'Modify Website' %}"><span>{% trans "Modify Website" %}</span></a>
</li>
<li class="suspendWebsite"><a href="{% url 'siteState' %}"
title="{% trans 'Suspend/Unsuspend' %}"><span>{% trans "Suspend/Unsuspend" %}</span></a>
</li>
<li class="deleteWebsite"><a href="{% url 'deleteWebsite' %}"
title="{% trans 'Delete Website' %}"><span>{% trans "Delete Website" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -344,9 +437,15 @@
<div id="packageSub" class="sidebar-submenu">
<ul>
<li class="createPackage"><a href="{% url 'createPackage' %}" title="{% trans 'Create Package' %}"><span>{% trans "Create Package" %}</span></a></li>
<li class="deletePackage"><a href="{% url 'deletePackage' %}" title="{% trans 'Delete Package' %}"><span>{% trans "Delete Package" %}</span></a></li>
<li class="modifyPackage"><a href="{% url 'modifyPackage' %}" title="{% trans 'Modify Package' %}"><span>{% trans "Modify Package" %}</span></a></li>
<li class="createPackage"><a href="{% url 'createPackage' %}"
title="{% trans 'Create Package' %}"><span>{% trans "Create Package" %}</span></a>
</li>
<li class="deletePackage"><a href="{% url 'deletePackage' %}"
title="{% trans 'Delete Package' %}"><span>{% trans "Delete Package" %}</span></a>
</li>
<li class="modifyPackage"><a href="{% url 'modifyPackage' %}"
title="{% trans 'Modify Package' %}"><span>{% trans "Modify Package" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -360,10 +459,17 @@
<div class="sidebar-submenu">
<ul>
<li class="createDatabase"><a href="{% url 'createDatabase' %}" title="{% trans 'Create Database' %}"><span>{% trans "Create Database" %}</span></a></li>
<li class="deleteDatabase"><a href="{% url 'deleteDatabase' %}" title="{% trans 'Delete Database' %}"><span>{% trans "Delete Database" %}</span></a></li>
<li class="listDatabases"><a href="{% url 'listDBs' %}" title="{% trans 'List Databases' %}"><span>{% trans "List Databases" %}</span></a></li>
<li><a href="/phpmyadmin/index.php" title="{% trans 'PHPMYAdmin' %}" target="_blank"><span>{% trans "PHPMYAdmin" %}</span></a></li>
<li class="createDatabase"><a href="{% url 'createDatabase' %}"
title="{% trans 'Create Database' %}"><span>{% trans "Create Database" %}</span></a>
</li>
<li class="deleteDatabase"><a href="{% url 'deleteDatabase' %}"
title="{% trans 'Delete Database' %}"><span>{% trans "Delete Database" %}</span></a>
</li>
<li class="listDatabases"><a href="{% url 'listDBs' %}"
title="{% trans 'List Databases' %}"><span>{% trans "List Databases" %}</span></a>
</li>
<li><a href="/phpmyadmin/index.php" title="{% trans 'PHPMYAdmin' %}"
target="_blank"><span>{% trans "PHPMYAdmin" %}</span></a></li>
<!----<li><a href="{% url 'modifyPackage' %}" title="Change Password"><span>Change Password</span></a></li>--->
</ul>
@@ -378,10 +484,18 @@
<div class="sidebar-submenu">
<ul>
<li class="createNameServer"><a href="{% url 'createNameserver' %}" title="{% trans 'Create Nameserver' %}"><span>{% trans "Create Nameserver" %}</span></a></li>
<li class="createDNSZone"><a href="{% url 'createDNSZone' %}" title="{% trans 'Create DNS Zone' %}"><span>{% trans "Create DNS Zone" %}</span></a></li>
<li class="deleteZone"><a href="{% url 'deleteDNSZone' %}" title="{% trans 'Delete Zone' %}"><span>{% trans "Delete Zone" %}</span></a></li>
<li class="addDeleteRecords"><a href="{% url 'addDeleteDNSRecords' %}" title="{% trans 'Add/Delete Records' %}"><span>{% trans "Add/Delete Records" %}</span></a></li>
<li class="createNameServer"><a href="{% url 'createNameserver' %}"
title="{% trans 'Create Nameserver' %}"><span>{% trans "Create Nameserver" %}</span></a>
</li>
<li class="createDNSZone"><a href="{% url 'createDNSZone' %}"
title="{% trans 'Create DNS Zone' %}"><span>{% trans "Create DNS Zone" %}</span></a>
</li>
<li class="deleteZone"><a href="{% url 'deleteDNSZone' %}"
title="{% trans 'Delete Zone' %}"><span>{% trans "Delete Zone" %}</span></a>
</li>
<li class="addDeleteRecords"><a href="{% url 'addDeleteDNSRecords' %}"
title="{% trans 'Add/Delete Records' %}"><span>{% trans "Add/Delete Records" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -395,12 +509,23 @@
<div class="sidebar-submenu">
<ul>
<li class="createEmail"><a href="{% url 'createEmailAccount' %}" title="{% trans 'Create Email Account' %}"><span>{% trans "Create Email" %}</span></a></li>
<li class="deleteEmail"><a href="{% url 'deleteEmailAccount' %}" title="{% trans 'Delete Email Account' %}"><span>{% trans "Delete Email" %}</span></a></li>
<li class="emailForwarding"><a href="{% url 'emailForwarding' %}" title="{% trans 'Email Forwarding' %}"><span>{% trans "Email Forwarding" %}</span></a></li>
<li class="changeEmailPassword"><a href="{% url 'changeEmailAccountPassword' %}" title="{% trans 'Change Password' %}"><span>{% trans "Change Password" %}</span></a></li>
<li class="dkimManager"><a href="{% url 'dkimManager' %}" title="{% trans 'DKIM Manager' %}"><span>{% trans "DKIM Manager" %}</span></a></li>
<li><a href="/rainloop/index.php" title="{% trans 'Access Webmail' %}" target="_blank"><span>{% trans "Access Webmail" %}</span></a></li>
<li class="createEmail"><a href="{% url 'createEmailAccount' %}"
title="{% trans 'Create Email Account' %}"><span>{% trans "Create Email" %}</span></a>
</li>
<li class="deleteEmail"><a href="{% url 'deleteEmailAccount' %}"
title="{% trans 'Delete Email Account' %}"><span>{% trans "Delete Email" %}</span></a>
</li>
<li class="emailForwarding"><a href="{% url 'emailForwarding' %}"
title="{% trans 'Email Forwarding' %}"><span>{% trans "Email Forwarding" %}</span></a>
</li>
<li class="changeEmailPassword"><a href="{% url 'changeEmailAccountPassword' %}"
title="{% trans 'Change Password' %}"><span>{% trans "Change Password" %}</span></a>
</li>
<li class="dkimManager"><a href="{% url 'dkimManager' %}"
title="{% trans 'DKIM Manager' %}"><span>{% trans "DKIM Manager" %}</span></a>
</li>
<li><a href="/rainloop/index.php" title="{% trans 'Access Webmail' %}"
target="_blank"><span>{% trans "Access Webmail" %}</span></a></li>
</ul>
@@ -415,9 +540,15 @@
<div class="sidebar-submenu">
<ul>
<li class="createFTPAccount"><a href="{% url 'createFTPAccount' %}" title="{% trans 'Create FTP Account' %}"><span>{% trans "Create FTP Account" %}</span></a></li>
<li class="deleteFTPAccount"><a href="{% url 'deleteFTPAccount' %}" title="{% trans 'Delete FTP Account' %}"><span>{% trans "Delete FTP Account" %}</span></a></li>
<li class="listFTPAccounts"><a href="{% url 'listFTPAccounts' %}" title="{% trans 'List FTP Accounts' %}"><span>{% trans "List FTP Accounts" %}</span></a></li>
<li class="createFTPAccount"><a href="{% url 'createFTPAccount' %}"
title="{% trans 'Create FTP Account' %}"><span>{% trans "Create FTP Account" %}</span></a>
</li>
<li class="deleteFTPAccount"><a href="{% url 'deleteFTPAccount' %}"
title="{% trans 'Delete FTP Account' %}"><span>{% trans "Delete FTP Account" %}</span></a>
</li>
<li class="listFTPAccounts"><a href="{% url 'listFTPAccounts' %}"
title="{% trans 'List FTP Accounts' %}"><span>{% trans "List FTP Accounts" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -431,11 +562,21 @@
<div class="sidebar-submenu">
<ul>
<li class="createBackup"><a href="{% url 'backupSite' %}" title="{% trans 'Create Back up' %}"><span>{% trans "Create Back up" %}</span></a></li>
<li class="restoreBackup"><a href="{% url 'restoreSite' %}" title="{% trans 'Restore Back up' %}"><span>{% trans "Restore Back up" %}</span></a></li>
<li class="addDeleteDestinations"><a href="{% url 'backupDestinations' %}" title="{% trans 'Add Destination' %}"><span>{% trans "Add/Delete Destination" %}</span></a></li>
<li class="scheDuleBackups"><a href="{% url 'scheduleBackup' %}" title="{% trans 'Schedule Back up' %}"><span>{% trans "Schedule Back up" %}</span></a></li>
<li class="remoteBackups"><a href="{% url 'remoteBackups' %}" title="{% trans 'Remote Back ups' %}"><span>{% trans "Remote Back ups" %}</span></a></li>
<li class="createBackup"><a href="{% url 'backupSite' %}"
title="{% trans 'Create Back up' %}"><span>{% trans "Create Back up" %}</span></a>
</li>
<li class="restoreBackup"><a href="{% url 'restoreSite' %}"
title="{% trans 'Restore Back up' %}"><span>{% trans "Restore Back up" %}</span></a>
</li>
<li class="addDeleteDestinations"><a href="{% url 'backupDestinations' %}"
title="{% trans 'Add Destination' %}"><span>{% trans "Add/Delete Destination" %}</span></a>
</li>
<li class="scheDuleBackups"><a href="{% url 'scheduleBackup' %}"
title="{% trans 'Schedule Back up' %}"><span>{% trans "Schedule Back up" %}</span></a>
</li>
<li class="remoteBackups"><a href="{% url 'remoteBackups' %}"
title="{% trans 'Remote Back ups' %}"><span>{% trans "Remote Back ups" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -450,9 +591,15 @@
<div class="sidebar-submenu">
<ul>
<li class="manageSSL"><a href="{% url 'manageSSL' %}" title="{% trans 'Manage SSL' %}"><span>{% trans "Manage SSL" %}</span></a></li>
<li class="hostnameSSL"><a href="{% url 'sslForHostName' %}" title="{% trans 'Hostname SSL' %}"><span>{% trans "Hostname SSL" %}</span></a></li>
<li class="mailServerSSL"><a href="{% url 'sslForMailServer' %}" title="{% trans 'MailServer SSL' %}"><span>{% trans "MailServer SSL" %}</span></a></li>
<li class="manageSSL"><a href="{% url 'manageSSL' %}"
title="{% trans 'Manage SSL' %}"><span>{% trans "Manage SSL" %}</span></a>
</li>
<li class="hostnameSSL"><a href="{% url 'sslForHostName' %}"
title="{% trans 'Hostname SSL' %}"><span>{% trans "Hostname SSL" %}</span></a>
</li>
<li class="mailServerSSL"><a href="{% url 'sslForMailServer' %}"
title="{% trans 'MailServer SSL' %}"><span>{% trans "MailServer SSL" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -460,6 +607,29 @@
<li class="header serverACL"><span>{% trans "Server" %}</span></li>
<li class="serverACL">
<a href="#" title="{% trans 'Docker' %}">
<i class="glyph-icon icon-linecons-fire"></i>
<span>{% trans "Docker Manager" %}</span>
<span class="bs-label badge-yellow">{% trans "NEW" %}</span>
</a>
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'manageImages' %}"
title="{% trans 'Manage Docker Images' %}"><span>{% trans "Manage Images" %}</span></a>
</li>
<li><a href="{% url 'listContainers' %}"
title="{% trans 'Manage Docker Containers' %}"><span>{% trans "Manage Containers" %}</span></a>
</li>
<li><a href="{% url 'containerImage' %}"
title="{% trans 'Create New Docker Container' %}"><span>{% trans "Create New Container" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
</li>
<li class="serverACL">
<a href="#" title="{% trans 'Tuning' %}">
<i class="glyph-icon icon-linecons-fire"></i>
@@ -468,8 +638,11 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'liteSpeedTuning' %}" title="{% trans 'LiteSpeed Tuning' %}"><span>{% trans "LiteSpeed Tuning" %}</span></a></li>
<li><a href="{% url 'phpTuning' %}" title="{% trans 'PHP Tuning' %}"><span>{% trans "PHP Tuning" %}</span></a></li>
<li><a href="{% url 'liteSpeedTuning' %}"
title="{% trans 'LiteSpeed Tuning' %}"><span>{% trans "LiteSpeed Tuning" %}</span></a>
</li>
<li><a href="{% url 'phpTuning' %}"
title="{% trans 'PHP Tuning' %}"><span>{% trans "PHP Tuning" %}</span></a></li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -483,10 +656,18 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'topProcesses' %}" title="{% trans 'Top Processes' %}"><span>{% trans "Top Processes" %}</span></a></li>
<li><a href="{% url 'litespeedStatus' %}" title="{% trans 'LiteSpeed Status' %}"><span>{% trans "LiteSpeed Status" %}</span></a></li>
<li><a href="{% url 'cyberCPMainLogFile' %}" title="{% trans 'CyberPanel Main Log File' %}"><span>{% trans "CyberPanel Main Log File" %}</span></a></li>
<li><a href="{% url 'services' %}" title="{% trans 'Services Status' %}"><span>{% trans "Services Status" %}</span></a></li>
<li><a href="{% url 'topProcesses' %}"
title="{% trans 'Top Processes' %}"><span>{% trans "Top Processes" %}</span></a>
</li>
<li><a href="{% url 'litespeedStatus' %}"
title="{% trans 'LiteSpeed Status' %}"><span>{% trans "LiteSpeed Status" %}</span></a>
</li>
<li><a href="{% url 'cyberCPMainLogFile' %}"
title="{% trans 'CyberPanel Main Log File' %}"><span>{% trans "CyberPanel Main Log File" %}</span></a>
</li>
<li><a href="{% url 'services' %}"
title="{% trans 'Services Status' %}"><span>{% trans "Services Status" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -500,8 +681,12 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'installExtensions' %}" title="{% trans 'Install PHP Extensions' %}"><span>{% trans "Install Extensions" %}</span></a></li>
<li><a href="{% url 'editPHPConfigs' %}" title="{% trans 'Edit PHP Configs' %}"><span>{% trans "Edit PHP Configs" %}</span></a></li>
<li><a href="{% url 'installExtensions' %}"
title="{% trans 'Install PHP Extensions' %}"><span>{% trans "Install Extensions" %}</span></a>
</li>
<li><a href="{% url 'editPHPConfigs' %}"
title="{% trans 'Edit PHP Configs' %}"><span>{% trans "Edit PHP Configs" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -515,11 +700,17 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'accessLogs' %}" title="{% trans 'Access Log' %}"><span>{% trans "Access Log" %}</span></a></li>
<li><a href="{% url 'errorLogs' %}" title="{% trans 'Error Logs' %}"><span>{% trans "Error Logs" %}</span></a></li>
<li><a href="{% url 'emaillogs' %}" title="{% trans 'Email Logs' %}"><span>{% trans "Email Log" %}</span></a></li>
<li><a href="{% url 'ftplogs' %}" title="{% trans 'FTP Logs' %}"><span>{% trans "FTP Logs" %}</span></a></li>
<li><a href="{% url 'modSecAuditLogs' %}" title="{% trans 'ModSecurity Audit Logs' %}"><span>{% trans "ModSec Audit Logs" %}</span></a></li>
<li><a href="{% url 'accessLogs' %}"
title="{% trans 'Access Log' %}"><span>{% trans "Access Log" %}</span></a></li>
<li><a href="{% url 'errorLogs' %}"
title="{% trans 'Error Logs' %}"><span>{% trans "Error Logs" %}</span></a></li>
<li><a href="{% url 'emaillogs' %}"
title="{% trans 'Email Logs' %}"><span>{% trans "Email Log" %}</span></a></li>
<li><a href="{% url 'ftplogs' %}"
title="{% trans 'FTP Logs' %}"><span>{% trans "FTP Logs" %}</span></a></li>
<li><a href="{% url 'modSecAuditLogs' %}"
title="{% trans 'ModSecurity Audit Logs' %}"><span>{% trans "ModSec Audit Logs" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -533,12 +724,22 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'firewallHome' %}" title="{% trans 'Firewall Home' %}"><span>{% trans "Firewall" %}</span></a></li>
<li><a href="{% url 'secureSSH' %}" title="{% trans 'Secure SSH' %}"><span>{% trans "Secure SSH" %}</span></a></li>
<li><a href="{% url 'modSecurity' %}" title="{% trans 'ModSecurity Configurations' %}"><span>{% trans "ModSecurity Conf" %}</span></a></li>
<li><a href="{% url 'modSecRules' %}" title="{% trans 'ModSecurity Rules' %}"><span>{% trans "ModSecurity Rules" %}</span></a></li>
<li><a href="{% url 'modSecRulesPacks' %}" title="{% trans 'ModSecurity Rules Packs' %}"><span>{% trans "ModSecurity Rules Packs" %}</span></a></li>
<li><a href="{% url 'csf' %}" title="{% trans 'ConfigServer Security & Firewall (CSF)' %}"><span>{% trans "CSF" %}</span></a></li>
<li><a href="{% url 'firewallHome' %}"
title="{% trans 'Firewall Home' %}"><span>{% trans "Firewall" %}</span></a></li>
<li><a href="{% url 'secureSSH' %}"
title="{% trans 'Secure SSH' %}"><span>{% trans "Secure SSH" %}</span></a></li>
<li><a href="{% url 'modSecurity' %}"
title="{% trans 'ModSecurity Configurations' %}"><span>{% trans "ModSecurity Conf" %}</span></a>
</li>
<li><a href="{% url 'modSecRules' %}"
title="{% trans 'ModSecurity Rules' %}"><span>{% trans "ModSecurity Rules" %}</span></a>
</li>
<li><a href="{% url 'modSecRulesPacks' %}"
title="{% trans 'ModSecurity Rules Packs' %}"><span>{% trans "ModSecurity Rules Packs" %}</span></a>
</li>
<li><a href="{% url 'csf' %}"
title="{% trans 'ConfigServer Security & Firewall (CSF)' %}"><span>{% trans "CSF" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -553,10 +754,18 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'emailPolicyServer' %}" title="{% trans 'Email Policy Server' %}"><span>{% trans "Email Policy Server" %}</span></a></li>
<li><a href="{% url 'listDomains' %}" title="{% trans 'Email Limits' %}"><span>{% trans "Email Limits" %}</span></a></li>
<li><a href="{% url 'SpamAssassin' %}" title="{% trans 'SpamAssassin Configurations' %}"><span>{% trans "SpamAssassin" %}</span></a></li>
<li><a href="{% url 'emailMarketing' %}" title="{% trans 'Email Marketing' %}"><span>{% trans "Email Marketing" %}</span></a></li>
<li><a href="{% url 'emailPolicyServer' %}"
title="{% trans 'Email Policy Server' %}"><span>{% trans "Email Policy Server" %}</span></a>
</li>
<li><a href="{% url 'listDomains' %}"
title="{% trans 'Email Limits' %}"><span>{% trans "Email Limits" %}</span></a>
</li>
<li><a href="{% url 'SpamAssassin' %}"
title="{% trans 'SpamAssassin Configurations' %}"><span>{% trans "SpamAssassin" %}</span></a>
</li>
<li><a href="{% url 'emailMarketing' %}"
title="{% trans 'Email Marketing' %}"><span>{% trans "Email Marketing" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -570,9 +779,14 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'managePowerDNS' %}" title="{% trans 'Manage PowerDNS' %}"><span>{% trans "Manage PowerDNS" %}</span></a></li>
<li><a href="{% url 'managePostfix' %}" title="{% trans 'Manage Postfix' %}"><span>{% trans "Manage Postfix" %}</span></a></li>
<li><a href="{% url 'managePureFtpd' %}" title="{% trans 'Manage FTP' %}"><span>{% trans "Manage FTP" %}</span></a></li>
<li><a href="{% url 'managePowerDNS' %}"
title="{% trans 'Manage PowerDNS' %}"><span>{% trans "Manage PowerDNS" %}</span></a>
</li>
<li><a href="{% url 'managePostfix' %}"
title="{% trans 'Manage Postfix' %}"><span>{% trans "Manage Postfix" %}</span></a>
</li>
<li><a href="{% url 'managePureFtpd' %}"
title="{% trans 'Manage FTP' %}"><span>{% trans "Manage FTP" %}</span></a></li>
</ul>
</div><!-- .sidebar-submenu -->
@@ -586,7 +800,9 @@
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'installed' %}" title="{% trans 'Installed Plugins' %}"><span>{% trans "Installed" %}</span></a></li>
<li><a href="{% url 'installed' %}"
title="{% trans 'Installed Plugins' %}"><span>{% trans "Installed" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->

View File

@@ -1,8 +1,18 @@
app.controller('installDocker', function($scope,$http) {
app.controller('installDocker', function ($scope, $http, $timeout, $window) {
$scope.installDockerStatus = true;
$scope.installBoxGen = true;
$scope.dockerInstallBTN = false;
$scope.installDocker = function () {
$scope.installDockerStatus = false;
$scope.installBoxGen = true;
$scope.dockerInstallBTN = true;
url = "/docker/installDocker";
var data = {};
var config = {
headers: {
@@ -10,42 +20,91 @@ app.controller('installDocker', function($scope,$http) {
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.installDockerStatus === 1)
{
new PNotify({
title: 'Docker installed',
text: 'Reloading...',
type: 'success'
});
location.reload();
$scope.cyberPanelLoading = true;
if (response.data.status === 1) {
$scope.installBoxGen = false;
getRequestStatus();
}
else {
new PNotify({
title: 'Failed to complete request',
text: response.data.error,
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
$scope.installDockerStatus = true;
}
function cantLoadInitialDatas(response) {
$scope.installDockerStatus = true;
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Failed to complete request',
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'
});
}
}
});
/* Java script code for docker management */
var delayTimer = null;
app.controller('dockerImages', function($scope,$http) {
app.controller('dockerImages', function ($scope) {
$scope.tagList = [];
$scope.imageTag = {};
});
@@ -119,8 +178,7 @@ app.controller('runContainer', function($scope,$http) {
function ListInitialDatas(response) {
if (response.data.createContainerStatus === 1)
{
if (response.data.createContainerStatus === 1) {
$scope.currentStatus = "Successful. Redirecting...";
window.location.href = "/docker/view/" + $scope.name
}
@@ -138,8 +196,8 @@ app.controller('runContainer', function($scope,$http) {
}
}
function cantLoadInitialDatas(response) {
$scope.containerCreationLoading = true;
@@ -175,7 +233,7 @@ app.controller('listContainers', function($scope,$http) {
$scope.assignContainer = function (name) {
$("#assign").modal("show");
$scope.assignActive = name;
}
};
$scope.submitAssignContainer = function () {
url = "/docker/assignContainer";
@@ -199,8 +257,7 @@ app.controller('listContainers', function($scope,$http) {
});
window.location.href = '/docker/listContainers';
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -209,6 +266,7 @@ app.controller('listContainers', function($scope,$http) {
}
$("#assign").modal("hide");
}
function cantLoadInitialData(response) {
console.log("not good");
new PNotify({
@@ -217,7 +275,7 @@ app.controller('listContainers', function($scope,$http) {
});
$("#assign").modal("hide");
}
}
};
$scope.delContainer = function (name, unlisted=false) {
(new PNotify({
@@ -296,18 +354,19 @@ app.controller('listContainers', function($scope,$http) {
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
$('#imageLoading').hide();
}
})
}
else
{
else {
$("#listFail").fadeIn();
$scope.errorMessage = response.data.error_message;
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
$('#imageLoading').hide();
}
@@ -345,8 +404,7 @@ app.controller('listContainers', function($scope,$http) {
if (response.data.containerLogStatus === 1) {
$scope.logs = response.data.containerLog;
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -355,6 +413,7 @@ app.controller('listContainers', function($scope,$http) {
}
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',
@@ -386,13 +445,13 @@ app.controller('listContainers', function($scope,$http) {
console.log($scope.ContainerList);
$("#listFail").hide();
}
else
{
else {
$("#listFail").fadeIn();
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialData(response) {
console.log("not good");
}
@@ -421,20 +480,19 @@ app.controller('listContainers', function($scope,$http) {
$scope.ContainerList = finalData;
$("#listFail").hide();
}
else
{
else {
$("#listFail").fadeIn();
$scope.errorMessage = response.data.error_message;
console.log(response.data);
}
}
function cantLoadInitialData(response) {
console.log("not good");
}
};
});
@@ -483,8 +541,7 @@ app.controller('viewContainer', function($scope,$http) {
});
location.reload();
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -494,6 +551,7 @@ app.controller('viewContainer', function($scope,$http) {
}
$('#infoLoading').hide();
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -529,8 +587,7 @@ app.controller('viewContainer', function($scope,$http) {
$scope.topHead = response.data.processes.Titles;
$scope.topProcesses = response.data.processes.Processes;
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -540,6 +597,7 @@ app.controller('viewContainer', function($scope,$http) {
}
$scope.loadingTop = false;
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -587,8 +645,7 @@ app.controller('viewContainer', function($scope,$http) {
});
window.location.href = '/docker/listContainers';
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -597,6 +654,7 @@ app.controller('viewContainer', function($scope,$http) {
}
$('#actionLoading').hide();
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -622,8 +680,7 @@ app.controller('viewContainer', function($scope,$http) {
console.log(response.data.status);
$scope.status = response.data.status;
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -632,6 +689,7 @@ app.controller('viewContainer', function($scope,$http) {
}
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -678,8 +736,7 @@ app.controller('viewContainer', function($scope,$http) {
});
}
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -690,6 +747,7 @@ app.controller('viewContainer', function($scope,$http) {
$('#containerSettingLoading').hide();
$scope.savingSettings = false;
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',
@@ -735,8 +793,7 @@ app.controller('viewContainer', function($scope,$http) {
$scope.status = response.data.status;
$scope.refreshStatus()
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -746,6 +803,7 @@ app.controller('viewContainer', function($scope,$http) {
}
$('#actionLoading').hide();
}
function cantLoadInitialData(response) {
PNotify.error({
title: 'Unable to complete request',
@@ -778,12 +836,12 @@ app.controller('viewContainer', function($scope,$http) {
if (response.data.containerLogStatus === 1) {
$scope.logs = response.data.containerLog;
}
else
{
else {
$scope.logs = response.data.error_message;
}
}
function cantLoadInitialData(response) {
console.log("not good");
$scope.logs = "Error loading log";
@@ -801,8 +859,7 @@ app.controller('manageImages', function($scope,$http) {
$scope.pullImage = function (image, tag) {
function ListInitialDatas(response) {
if (response.data.installImageStatus === 1)
{
if (response.data.installImageStatus === 1) {
new PNotify({
title: 'Image pulled successfully',
text: 'Reloading...',
@@ -821,6 +878,7 @@ app.controller('manageImages', function($scope,$http) {
$('#imageLoading').hide();
}
function cantLoadInitialDatas(response) {
$('#imageLoading').hide();
new PNotify({
@@ -828,6 +886,7 @@ app.controller('manageImages', function($scope,$http) {
type: 'error'
});
}
if (image && tag) {
$('#imageLoading').show();
@@ -880,8 +939,7 @@ app.controller('manageImages', function($scope,$http) {
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.searchImageStatus === 1)
{
if (response.data.searchImageStatus === 1) {
$scope.images = response.data.matches;
console.log($scope.images)
}
@@ -896,6 +954,7 @@ app.controller('manageImages', function($scope,$http) {
$('#imageLoading').hide();
}
function cantLoadInitialDatas(response) {
$('#imageLoading').hide();
new PNotify({
@@ -932,8 +991,7 @@ app.controller('manageImages', function($scope,$http) {
$scope.tagList[image].push("Load more");
}
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -942,6 +1000,7 @@ app.controller('manageImages', function($scope,$http) {
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',
@@ -1012,8 +1071,7 @@ app.controller('manageImages', function($scope,$http) {
$('#history').modal('show');
$scope.historyList = response.data.history;
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -1022,6 +1080,7 @@ app.controller('manageImages', function($scope,$http) {
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',
@@ -1082,8 +1141,7 @@ app.controller('manageImages', function($scope,$http) {
});
window.location.href = "/docker/manageImages";
}
else
{
else {
new PNotify({
title: 'Unable to complete request',
text: response.data.error_message,
@@ -1092,6 +1150,7 @@ app.controller('manageImages', function($scope,$http) {
}
$('#imageLoading').hide();
}
function cantLoadInitialData(response) {
new PNotify({
title: 'Unable to complete request',

View File

@@ -16,7 +16,8 @@
<div ng-controller="installDocker" class="panel">
<div class="panel-body">
<h3 class="title-hero">
{% trans "Install Docker" %} <img ng-hide="installDockerStatus" src="{% static 'images/loading.gif' %}">
{% trans "Install Docker" %} <img ng-hide="installDockerStatus"
src="{% static 'images/loading.gif' %}">
</h3>
<div class="example-box-wrapper">
@@ -30,9 +31,25 @@
{% else %}
<p>{% trans "Docker is currently not installed on this server. To manage containers, you must first install it." %}</p>
<!------ LSWS Switch box ----------------->
<div style="margin-top: 2%" ng-hide="installBoxGen" class="col-md-12">
<form action="/" id="" class="form-horizontal bordered-row">
<div class="form-group">
<div style="margin-top: 2%;" class="col-sm-12">
<textarea ng-model="requestData" rows="15"
class="form-control">{{ requestData }}</textarea>
</div>
</div>
</form>
</div>
<!----- LSWS Switch box ----------------->
<br>
{% if status == 1 %}
<button class="btn btn-primary" ng-click="installDocker()">Install Docker</button>
<button ng-hide="dockerInstallBTN" class="btn btn-primary" ng-click="installDocker()">Install Docker</button>
{% else %}
{% trans "You do not have permissions to install Docker. Please contact your system administrator" %}
{% endif %}
@@ -43,7 +60,6 @@
</div>
</div>

View File

@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render,redirect
from django.shortcuts import render, redirect, HttpResponse
from loginSystem.models import Administrator
from loginSystem.views import loadLoginPage
from plogical.container import ContainerManager
from dockerManager.pluginManager import pluginManager
from decorators import preDockerRun
from plogical.acl import ACLManager
import json
@@ -22,7 +21,7 @@ def dockerPermission(request, userID, context):
else:
return ACLManager.loadError()
else:
return None
return 0
@preDockerRun
def loadDockerHome(request):
@@ -41,22 +40,18 @@ def installDocker(request):
userID = request.session['userID']
perm = dockerPermission(request, userID, 'loadDockerHome')
if perm: return perm
result = pluginManager.preDockerInstallation(request) # Later change to preInstallInstallation
if result != 200:
return result
cm = ContainerManager(userID, 'submitInstallDocker')
cm.start()
cm = ContainerManager()
coreResult = cm.submitInstallDocker(userID, json.loads(request.body))
data_ret = {'status': 1, 'error_message': 'None'}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
result = pluginManager.postDockerInstallation(request, coreResult)
if result != 200:
return result
return coreResult
except KeyError:
return redirect(loadLoginPage)
except BaseException, msg:
data_ret = {'status': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@preDockerRun
def installImage(request):
@@ -332,6 +327,7 @@ def manageImages(request):
def getImageHistory(request):
try:
userID = request.session['userID']
perm = dockerPermission(request, userID, 'loadDockerHome')
if perm: return perm

View File

@@ -780,8 +780,8 @@ class preFlightsChecks:
os.chdir(self.path)
command = "wget http://cyberpanel.sh/CyberPanel.1.7.7.tar.gz"
#command = "wget http://cyberpanel.sh/CyberPanelTemp.tar.gz"
#command = "wget http://cyberpanel.sh/CyberPanel.1.7.7.tar.gz"
command = "wget http://cyberpanel.sh/CyberPanelTemp.tar.gz"
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
'CyberPanel Download',
1, 1, os.EX_OSERR)
@@ -789,8 +789,8 @@ class preFlightsChecks:
##
count = 0
command = "tar zxf CyberPanel.1.7.7.tar.gz"
#command = "tar zxf CyberPanelTemp.tar.gz"
#command = "tar zxf CyberPanel.1.7.7.tar.gz"
command = "tar zxf CyberPanelTemp.tar.gz"
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
'Extract CyberPanel',1, 1, os.EX_OSERR)
@@ -2667,27 +2667,15 @@ class preFlightsChecks:
return 0
def installPYDNS(self):
try:
count = 0
while (1):
command = "pip install pydns"
res = subprocess.call(shlex.split(command))
if preFlightsChecks.resFailed(self.distro, res):
count = count + 1
preFlightsChecks.stdOut(
"Trying to install pydns, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile(
"Failed to install pydns! [installTLDExtract]")
else:
logging.InstallLog.writeToFile("pydns successfully installed! [pip]")
preFlightsChecks.stdOut("pydns successfully installed! [pip]")
break
except OSError, msg:
logging.InstallLog.writeToFile(str(msg) + " [installTLDExtract]")
return 0
preFlightsChecks.call(command, self.distro, '[installPYDNS]',
'Install PYDNS',
1, 0, os.EX_OSERR)
def installDockerPY(self):
command = "pip install docker"
preFlightsChecks.call(command, self.distro, '[installDockerPY]',
'Install DockerPY',
1, 0, os.EX_OSERR)
def installOpenDKIM(self):
try:
@@ -3289,6 +3277,7 @@ def main():
checks.installCertBot()
checks.test_Requests()
checks.installPYDNS()
checks.installDockerPY()
checks.download_install_CyberPanel(installCyberPanel.InstallCyberPanel.mysqlPassword, mysql)
checks.setupCLI()
checks.setup_cron()

View File

@@ -453,7 +453,6 @@ class ACLManager:
@staticmethod
def checkContainerOwnership(name, userID):
return 1
try:
container = Containers.objects.get(name=name)
currentACL = ACLManager.loadedACL(userID)
@@ -513,7 +512,7 @@ class ACLManager:
for items in admins:
cons = items.containers_set.all()
for con in cons:
containerList.append(web)
containerList.append(con)
return containerList

View File

@@ -18,54 +18,88 @@ import subprocess
import shlex
import time
from dockerManager.models import Containers
from django.http import StreamingHttpResponse
from wsgiref.util import FileWrapper
from math import ceil
import docker
import docker.utils
import requests
from processUtilities import ProcessUtilities
from serverStatus.serverStatusUtil import ServerStatusUtil
import threading as multi
# Use default socket to connect
class ContainerManager:
def __init__(self, name=None):
self.name = name
class ContainerManager(multi.Thread):
def submitInstallDocker(self, userID=None, data=None):
def __init__(self, name=None, function=None):
multi.Thread.__init__(self)
self.name = name
self.function = function
def run(self):
try:
currentACL = ACLManager.loadedACL(userID)
if self.function == 'submitInstallDocker':
self.submitInstallDocker()
elif self.function == 'restartGunicorn':
command = 'sudo systemctl restart gunicorn.socket'
ProcessUtilities.executioner(command)
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile( str(msg) + ' [ContainerManager.run]')
@staticmethod
def executioner(command, statusFile):
try:
res = subprocess.call(shlex.split(command), stdout=statusFile, stderr=statusFile)
if res == 1:
return 0
else:
return 1
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0
def submitInstallDocker(self):
try:
currentACL = ACLManager.loadedACL(self.name)
if ACLManager.currentContextPermission(currentACL, 'createContainer') == 0:
return ACLManager.loadError()
statusFile = open(ServerStatusUtil.lswsInstallStatusPath, 'w')
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Starting Docker Installation..\n", 1)
if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
command = 'sudo yum install -y docker'
cmd = shlex.split(command)
res = subprocess.call(cmd)
else:
command = 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io'
if not ServerStatusUtil.executioner(command, statusFile):
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Failed to install Docker. [404]\n", 1)
return 0
command = 'sudo groupadd docker'
cmd = shlex.split(command)
res2 = subprocess.call(cmd)
ServerStatusUtil.executioner(command, statusFile)
command = 'sudo usermod -aG docker cyberpanel'
cmd = shlex.split(command)
res3 = subprocess.call(cmd)
ServerStatusUtil.executioner(command, statusFile)
command = 'sudo service docker start'
cmd = shlex.split(command)
res4 = subprocess.call(cmd)
command = 'sudo systemctl enable docker'
ServerStatusUtil.executioner(command, statusFile)
if res == 0 and res2 == 0 and res3 == 0 and res4 == 0:
data_ret = {'installDockerStatus': 1, 'error_message': 'None'}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
else:
data_ret = {'installDockerStatus': 0, 'error_message': 'Failed to install. Manual install required.'}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
command = 'sudo systemctl start docker'
ServerStatusUtil.executioner(command, statusFile)
return HttpResponse(res)
cm = ContainerManager(self.name, 'restartGunicorn')
cm.start()
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Docker successfully installed.[200]\n", 1)
except BaseException, msg:
return HttpResponse(str(msg))
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
def createContainer(self, request=None, userID=None, data=None):
try:
@@ -779,9 +813,6 @@ class ContainerManager:
name = data['name']
if ACLManager.checkContainerOwnership(name, userID) != 1:
return ACLManager.loadError()
client = docker.from_env()
dockerAPI = docker.APIClient()
@@ -808,6 +839,7 @@ class ContainerManager:
def removeImage(self, userID=None, data=None):
try:
admin = Administrator.objects.get(pk=userID)
if admin.acl.adminStatus != 1:
return ACLManager.loadError()

View File

@@ -21,7 +21,10 @@ class modSec:
mailUtilities.checkHome()
if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
command = 'sudo yum install ols-modsecurity -y'
else:
command = 'sudo DEBIAN_FRONTEND=noninteractive apt-get install ols-modsecurity -y'
cmd = shlex.split(command)

View File

@@ -599,6 +599,40 @@ WantedBy=multi-user.target"""
except:
pass
@staticmethod
def dockerMigrations():
try:
connection, cursor = Upgrade.setupConnection('cyberpanel')
query = """CREATE TABLE `dockerManager_containers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`cid` varchar(64) NOT NULL,
`image` varchar(50) NOT NULL,
`tag` varchar(50) NOT NULL,
`memory` int(11) NOT NULL,
`ports` longtext NOT NULL,
`env` longtext NOT NULL,
`startOnReboot` int(11) NOT NULL,
`admin_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `dockerManager_contai_admin_id_58fb62b7_fk_loginSyst` (`admin_id`),
CONSTRAINT `dockerManager_contai_admin_id_58fb62b7_fk_loginSyst` FOREIGN KEY (`admin_id`) REFERENCES `loginSystem_administrator` (`id`)
)"""
try:
cursor.execute(query)
except:
pass
try:
connection.close()
except:
pass
except:
pass
@staticmethod
def enableServices():
try:
@@ -854,6 +888,7 @@ WantedBy=multi-user.target"""
Upgrade.mailServerMigrations()
Upgrade.emailMarketingMigrationsa()
Upgrade.dockerMigrations()
##

BIN
static/images/docker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -394,6 +394,7 @@ app.controller('servicesManager', function ($scope, $http) {
function ListInitialDatas(response) {
console.log(response.data)
if (response.data.status.litespeed) {
$scope.olsStatus = "Running";
@@ -409,8 +410,18 @@ app.controller('servicesManager', function ($scope, $http) {
$scope.olsStop = false;
}
// Update SQL stats
if (response.data.status.docker) {
$scope.dockerStatus = "Running";
$scope.dockerStart = false;
$scope.dockerStop = true;
}
else {
$scope.dockerStatus = "Stopped";
$scope.dockerStart = true;
$scope.dockerStop = false;
}
// Update SQL stats
if (response.data.status.mysql) {
$scope.sqlStatus = "Running";
$scope.sqlStats = true;
@@ -468,7 +479,7 @@ app.controller('servicesManager', function ($scope, $http) {
}
};
}
getServiceStatus();
$scope.serviceAction = function (serviceName, action) {