Usman Nasir
2022-02-28 15:09:15 +05:00
parent 4c3db218c1
commit 332d1f1e02
3 changed files with 215 additions and 171 deletions

View File

@@ -217,68 +217,70 @@
<span class="badge bg-red" id="load3">{$ three $}</span> <span class="badge bg-red" id="load3">{$ three $}</span>
</a>{% endcomment %} </a>{% endcomment %}
{# <div class="dropdown" id="dashnav-btn">#} {# <div class="dropdown" id="dashnav-btn">#}
{# <a href="#" data-toggle="dropdown" data-placement="bottom"#} {# <a href="#" data-toggle="dropdown" data-placement="bottom"#}
{# class="popover-button-header tooltip-button" title="{% trans 'Dashboard Quick Menu' %}">#} {# class="popover-button-header tooltip-button" title="{% trans 'Dashboard Quick Menu' %}">#}
{# <i class="glyph-icon icon-linecons-cog"></i>#} {# <i class="glyph-icon icon-linecons-cog"></i>#}
{# </a>#} {# </a>#}
{# <div class="dropdown-menu float-right">#} {# <div class="dropdown-menu float-right">#}
{# <div class="box-sm">#} {# <div class="box-sm">#}
{# <div class="pad5T pad5B pad10L pad10R dashboard-buttons clearfix">#} {# <div class="pad5T pad5B pad10L pad10R dashboard-buttons clearfix">#}
{# <a href="{% url 'loadWebsitesHome' %}"#} {# <a href="{% url 'loadWebsitesHome' %}"#}
{# class="btn vertical-button remove-border btn-info" title="{% trans '' %}">#} {# class="btn vertical-button remove-border btn-info" title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-dashboard opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-dashboard opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "Websites" %}#} {# {% trans "Websites" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'packagesHome' %}"#} {# <a href="{% url 'packagesHome' %}"#}
{# class="btn vertical-button remove-border btn-danger"#} {# class="btn vertical-button remove-border btn-danger"#}
{# title="{% trans '' %}">#} {# title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-tags opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-tags opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "Packages" %}#} {# {% trans "Packages" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'dnsHome' %}" class="btn vertical-button remove-border btn-purple"#} {# <a href="{% url 'dnsHome' %}" class="btn vertical-button remove-border btn-purple"#}
{# title="{% trans '' %}">#} {# title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-fire opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-fire opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "DNS" %}#} {# {% trans "DNS" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'loadFTPHome' %}"#} {# <a href="{% url 'loadFTPHome' %}"#}
{# class="btn vertical-button remove-border btn-azure"#} {# class="btn vertical-button remove-border btn-azure"#}
{# title="{% trans '' %}">#} {# title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-bar-chart-o opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-bar-chart-o opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "FTP" %}#} {# {% trans "FTP" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'loadTuningHome' %}"#} {# <a href="{% url 'loadTuningHome' %}"#}
{# class="btn vertical-button remove-border btn-yellow" title="{% trans '' %}">#} {# class="btn vertical-button remove-border btn-yellow" title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-laptop opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-laptop opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "Tuning" %}#} {# {% trans "Tuning" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'serverStatusHome' %}"#} {# <a href="{% url 'serverStatusHome' %}"#}
{# class="btn vertical-button remove-border btn-warning" title="{% trans '' %}">#} {# class="btn vertical-button remove-border btn-warning" title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-code opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-code opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "Status" %}#} {# {% trans "Status" %}#}
{# </a>#} {# </a>#}
{##} {##}
{# </div>#} {# </div>#}
{##} {##}
{# </div>#} {# </div>#}
{# </div>#} {# </div>#}
{# </div>#} {# </div>#}
<a class="header-btn" target="_blank" href="https://go.cyberpanel.net/community" title="{% trans 'Community' %}"> <a class="header-btn" target="_blank" href="https://go.cyberpanel.net/community"
title="{% trans 'Community' %}">
<i class="glyph-icon icon-comments"></i> <i class="glyph-icon icon-comments"></i>
</a> </a>
<a class="header-btn" target="_blank" href="https://go.cyberpanel.net/support" title="{% trans 'Support' %}"> <a class="header-btn" target="_blank" href="https://go.cyberpanel.net/support"
title="{% trans 'Support' %}">
<i class="glyph-icon icon-support"></i> <i class="glyph-icon icon-support"></i>
</a> </a>
<a class="header-btn" id="logout-btn" href="{% url 'logout' %}" title="{% trans 'Logout' %}"> <a class="header-btn" id="logout-btn" href="{% url 'logout' %}" title="{% trans 'Logout' %}">
@@ -286,7 +288,6 @@
</a> </a>
</div> </div>
<!-- #header-nav-right --> <!-- #header-nav-right -->
@@ -494,6 +495,8 @@
</div><!-- .sidebar-submenu --> </div><!-- .sidebar-submenu -->
</li> </li>
{% if dnsAsWhole %}
<li class="dnsAsWhole"> <li class="dnsAsWhole">
<a title="{% trans 'DNS' %}"> <a title="{% trans 'DNS' %}">
<i class="glyph-icon icon-sitemap"></i> <i class="glyph-icon icon-sitemap"></i>
@@ -528,7 +531,8 @@
</li> </li>
{% endif %} {% endif %}
{% if admin or addDeleteRecords %} {% if admin or addDeleteRecords %}
<li class="addDeleteRecords"><a href="{% url 'addDeleteDNSRecordsCloudFlare' %}" <li class="addDeleteRecords"><a
href="{% url 'addDeleteDNSRecordsCloudFlare' %}"
title="{% trans 'CloudFlare' %}"><span>{% trans "CloudFlare" %}</span></a> title="{% trans 'CloudFlare' %}"><span>{% trans "CloudFlare" %}</span></a>
</li> </li>
{% endif %} {% endif %}
@@ -537,6 +541,10 @@
</div><!-- .sidebar-submenu --> </div><!-- .sidebar-submenu -->
</li> </li>
{% endif %}
{% if emailAsWhole %}
<li class="emailAsWhole"> <li class="emailAsWhole">
<a href="{% url 'loadEmailHome' %}" title="{% trans 'Email' %}"> <a href="{% url 'loadEmailHome' %}" title="{% trans 'Email' %}">
<i class="glyph-icon icon-paper-plane"></i> <i class="glyph-icon icon-paper-plane"></i>
@@ -585,6 +593,9 @@
</div><!-- .sidebar-submenu --> </div><!-- .sidebar-submenu -->
</li> </li>
{% endif %}
{% if ftpAsWhole %}
<li class="ftpAsWhole"> <li class="ftpAsWhole">
<a href="{% url 'ftpHome' %}" title="{% trans 'FTP' %}"> <a href="{% url 'ftpHome' %}" title="{% trans 'FTP' %}">
<i class="glyph-icon icon-cloud-upload"></i> <i class="glyph-icon icon-cloud-upload"></i>
@@ -613,6 +624,8 @@
</div><!-- .sidebar-submenu --> </div><!-- .sidebar-submenu -->
</li> </li>
{% endif¬ %}
<li> <li>
<a href="{% url 'loadBackupHome' %}" title="{% trans 'Backup' %}"> <a href="{% url 'loadBackupHome' %}" title="{% trans 'Backup' %}">
<i class="glyph-icon tooltip-button icon-copy" title=".icon-folder"></i> <i class="glyph-icon tooltip-button icon-copy" title=".icon-folder"></i>

View File

@@ -1,6 +1,7 @@
#!/usr/local/CyberCP/bin/python #!/usr/local/CyberCP/bin/python
import os,sys import os,sys
from manageServices.models import PDNSStatus
from .processUtilities import ProcessUtilities from .processUtilities import ProcessUtilities
sys.path.append('/usr/local/CyberCP') sys.path.append('/usr/local/CyberCP')
@@ -863,3 +864,31 @@ class ACLManager:
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
@staticmethod
def GetServiceStatus(dic):
if os.path.exists('/home/cyberpanel/postfix'):
dic['emailAsWhole'] = 1
else:
dic['emailAsWhole'] = 0
if os.path.exists('/home/cyberpanel/pureftpd'):
dic['ftpAsWhole'] = 1
else:
dic['ftpAsWhole'] = 0
try:
pdns = PDNSStatus.objects.get(pk=1)
dic['dnsAsWhole'] = pdns.serverStatus
except:
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20:
pdnsPath = '/etc/powerdns'
else:
pdnsPath = '/etc/pdns'
if os.path.exists(pdnsPath):
PDNSStatus(serverStatus=1).save()
dic['dnsAsWhole'] = 1
else:
dic['dnsAsWhole'] = 0

View File

@@ -55,6 +55,8 @@ class httpProc:
except: except:
pass pass
ACLManager.GetServiceStatus(self.data)
self.data.update(currentACL) self.data.update(currentACL)
return render(self.request, self.templateName, self.data) return render(self.request, self.templateName, self.data)