mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
Remove Version Management from normal user.
This commit is contained in:
@@ -58,7 +58,7 @@ app.filter('getwebsitename', function() {
|
||||
|
||||
app.controller('systemStatusInfo', function($scope,$http,$timeout) {
|
||||
|
||||
getStuff();
|
||||
//getStuff();
|
||||
|
||||
function getStuff() {
|
||||
|
||||
@@ -109,10 +109,10 @@ app.controller('adminController', function($scope,$http,$timeout) {
|
||||
|
||||
$("#serverIPAddress").text(response.data.serverIPAddress);
|
||||
|
||||
if (response.data.admin_type != "Administrator")
|
||||
if (response.data.admin_type !== "Administrator")
|
||||
{
|
||||
|
||||
if(response.data.admin_type != "Reseller") {
|
||||
if(response.data.admin_type !== "Reseller") {
|
||||
$("#normalUser").hide();
|
||||
$("#normalUserA").hide();
|
||||
$("#normalUserB").hide();
|
||||
@@ -140,6 +140,7 @@ app.controller('adminController', function($scope,$http,$timeout) {
|
||||
$("#createWebsite").hide();
|
||||
$("#modifyWebSite").hide();
|
||||
$("#deleteWebsite").hide();
|
||||
$("#versionManagement").hide();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -156,7 +157,7 @@ app.controller('adminController', function($scope,$http,$timeout) {
|
||||
|
||||
app.controller('loadAvg', function($scope,$http,$timeout) {
|
||||
|
||||
getStuff();
|
||||
//getStuff();
|
||||
|
||||
function getStuff() {
|
||||
|
||||
@@ -179,7 +180,7 @@ app.controller('loadAvg', function($scope,$http,$timeout) {
|
||||
console.log("not good");
|
||||
}
|
||||
|
||||
$timeout(getStuff, 2000);
|
||||
//$timeout(getStuff, 2000);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -89,70 +89,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="content-box border-top border-red">
|
||||
<h3 class="content-box-header clearfix text-center">
|
||||
{% trans "HTTP Statistics" %}
|
||||
</h3>
|
||||
|
||||
|
||||
<div style="padding-left: 7%;padding-bottom: 2%;" class="custom-padding">
|
||||
<div class="box">
|
||||
<div class="container">
|
||||
<span class="number">{$ Avail $}/{$ MAXCONN $}</span>
|
||||
<br />
|
||||
{% trans "Available/Max Connections" %}
|
||||
</div>
|
||||
<div class="fill speed1" style="background : #81c784; "></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="box">
|
||||
<div class="container">
|
||||
<span class="number">{$ AvailSSL $}/{$ MAXSSL $}</span>
|
||||
<br />
|
||||
{% trans "Available/Max SSL Connections" %}
|
||||
</div>
|
||||
<div class="fill speed2" style="background : #f69679;"></div>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="container">
|
||||
<span class="number">{$ RequestProcessing $}</span>
|
||||
<br />
|
||||
{% trans "Requests Processing" %}
|
||||
</div>
|
||||
<div class="fill speed3" style="background : #92bafb;"></div>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="container">
|
||||
<span class="number">{$ TotalRequests $}</span>
|
||||
<br />
|
||||
{% trans "Total Requests" %}
|
||||
</div>
|
||||
<div class="fill speed4" style="background : #9b92fb;"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,10 +86,7 @@
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<a href="#" title="{% trans '' %}" data-toggle="collapse" data-target="#sidebar-toggle-3" class="popover-title">
|
||||
{% trans "CPU Status" %}
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
|
||||
<div ng-controller="systemStatusInfo" id="sidebar-toggle-3" class="collapse in">
|
||||
|
||||
<ul class="progress-box">
|
||||
@@ -215,11 +212,6 @@
|
||||
<span class="badge bg-yellow">{$ three $}</span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown" id="cloud-btn">
|
||||
<a href="#" data-placement="bottom" class="tooltip-button sb-toggle-right" title="{% trans 'System Status' %}">
|
||||
<i class="glyph-icon icon-linecons-cloud"></i>
|
||||
</a>
|
||||
</div>
|
||||
<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' %}">
|
||||
<i class="glyph-icon icon-linecons-cog"></i>
|
||||
@@ -292,7 +284,7 @@
|
||||
<i class="glyph-icon icon-linecons-tv"></i>
|
||||
<span>{% trans "Dashboard" %}</span>
|
||||
</a>
|
||||
<a href="{% url 'versionManagment' %}" title="{% trans 'Version Management' %}">
|
||||
<a id="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>
|
||||
|
||||
@@ -72,39 +72,7 @@ def getSystemStatus(request):
|
||||
try:
|
||||
|
||||
HTTPData = SystemInformation.getSystemInformation()
|
||||
|
||||
try:
|
||||
command = "sudo cat /tmp/lshttpd/.rtreport"
|
||||
data = subprocess.check_output(shlex.split(command)).split("\n")
|
||||
|
||||
httpData = data[3]
|
||||
requestsData = data[4]
|
||||
|
||||
finalHTTP = re.findall(r"[A-Za-z0-9]+", httpData)
|
||||
finalReq = re.findall(r"[A-Za-z0-9]+", requestsData)
|
||||
|
||||
|
||||
HTTPData['RequestProcessing'] = finalReq[4]
|
||||
HTTPData['TotalRequests'] = finalReq[11]
|
||||
|
||||
|
||||
HTTPData['MAXCONN'] = finalHTTP[1]
|
||||
HTTPData['MAXSSL'] = finalHTTP[4]
|
||||
HTTPData['Avail'] = finalHTTP[8]
|
||||
HTTPData['AvailSSL'] = finalHTTP[14]
|
||||
|
||||
except BaseException,msg:
|
||||
#logging.CyberCPLogFileWriter.writeToFile("Failed to read status file, error: " + str(msg))
|
||||
HTTPData['RequestProcessing'] = 0
|
||||
HTTPData['TotalRequests'] = 0
|
||||
|
||||
HTTPData['MAXCONN'] = 2000
|
||||
HTTPData['MAXSSL'] = 1000
|
||||
HTTPData['Avail'] = 2000
|
||||
HTTPData['AvailSSL'] = 1000
|
||||
|
||||
json_data = json.dumps(HTTPData)
|
||||
|
||||
return HttpResponse(json_data)
|
||||
|
||||
except KeyError:
|
||||
|
||||
@@ -703,7 +703,7 @@ class preFlightsChecks:
|
||||
|
||||
count = 0
|
||||
while (1):
|
||||
command = "wget http://cyberpanel.net/CyberPanel.1.6.1.tar.gz"
|
||||
command = "wget http://cyberpanel.net/CyberPanel.1.6.2.tar.gz"
|
||||
#command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz"
|
||||
res = subprocess.call(shlex.split(command))
|
||||
|
||||
@@ -723,7 +723,7 @@ class preFlightsChecks:
|
||||
|
||||
count = 0
|
||||
while(1):
|
||||
command = "tar zxf CyberPanel.1.6.1.tar.gz"
|
||||
command = "tar zxf CyberPanel.1.6.2.tar.gz"
|
||||
#command = "tar zxf CyberPanelTemp.tar.gz"
|
||||
|
||||
res = subprocess.call(shlex.split(command))
|
||||
|
||||
@@ -129,7 +129,7 @@ def loadLoginPage(request):
|
||||
firstName="Cyber",lastName="Panel")
|
||||
admin.save()
|
||||
|
||||
vers = version(currentVersion="1.6",build=1)
|
||||
vers = version(currentVersion="1.6",build=2)
|
||||
vers.save()
|
||||
|
||||
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
||||
|
||||
@@ -66,12 +66,22 @@ modsecurity_rules_file /usr/local/lsws/conf/modsec/rules.conf
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
confFile = os.path.join(virtualHostUtilities.Server_root,"conf/httpd_config.conf")
|
||||
|
||||
conf = open(confFile,'a+')
|
||||
conf.write(initialConfigs)
|
||||
conf.close()
|
||||
confData = open(confFile).readlines()
|
||||
confData.reverse()
|
||||
|
||||
modSecConfigFlag = False
|
||||
|
||||
for items in confData:
|
||||
if items.find('module mod_security') > -1:
|
||||
modSecConfigFlag = True
|
||||
break
|
||||
|
||||
if modSecConfigFlag == False:
|
||||
conf = open(confFile,'a+')
|
||||
conf.write(initialConfigs)
|
||||
conf.close()
|
||||
|
||||
rulesFilePath = os.path.join(virtualHostUtilities.Server_root,"conf/modsec/rules.conf")
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ app.filter('getwebsitename', function() {
|
||||
|
||||
app.controller('systemStatusInfo', function($scope,$http,$timeout) {
|
||||
|
||||
getStuff();
|
||||
//getStuff();
|
||||
|
||||
function getStuff() {
|
||||
|
||||
@@ -109,10 +109,10 @@ app.controller('adminController', function($scope,$http,$timeout) {
|
||||
|
||||
$("#serverIPAddress").text(response.data.serverIPAddress);
|
||||
|
||||
if (response.data.admin_type != "Administrator")
|
||||
if (response.data.admin_type !== "Administrator")
|
||||
{
|
||||
|
||||
if(response.data.admin_type != "Reseller") {
|
||||
if(response.data.admin_type !== "Reseller") {
|
||||
$("#normalUser").hide();
|
||||
$("#normalUserA").hide();
|
||||
$("#normalUserB").hide();
|
||||
@@ -140,6 +140,7 @@ app.controller('adminController', function($scope,$http,$timeout) {
|
||||
$("#createWebsite").hide();
|
||||
$("#modifyWebSite").hide();
|
||||
$("#deleteWebsite").hide();
|
||||
$("#versionManagement").hide();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -156,7 +157,7 @@ app.controller('adminController', function($scope,$http,$timeout) {
|
||||
|
||||
app.controller('loadAvg', function($scope,$http,$timeout) {
|
||||
|
||||
getStuff();
|
||||
//getStuff();
|
||||
|
||||
function getStuff() {
|
||||
|
||||
@@ -179,7 +180,7 @@ app.controller('loadAvg', function($scope,$http,$timeout) {
|
||||
console.log("not good");
|
||||
}
|
||||
|
||||
$timeout(getStuff, 2000);
|
||||
//$timeout(getStuff, 2000);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
<label class="col-sm-3 control-label">{% trans "Enable GZIP Compression" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select ng-model="gzipCompression" class="form-control">
|
||||
<option>{% trans "Enable" %}</option>
|
||||
<option>{% trans "Disable" %}</option>
|
||||
<option>Enable</option>
|
||||
<option>Disable</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="current-pack">{% trans "Currently:" %} {$ gzipStatus $}</div>
|
||||
@@ -80,7 +80,6 @@
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-click="saveTuningSettings()" class="btn btn-primary btn-lg btn-block">{% trans "Tune Web Server" %}</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user