resolve internal ticket to show php on list site https://app.clickup.com/t/866atrc44
This commit is contained in:
parent
ff04747e49
commit
89d0bb7cb7
|
|
@ -232,6 +232,16 @@ class phpUtilities:
|
|||
result = result.rsplit("lsphp", 1)[0] + "php"
|
||||
return result
|
||||
|
||||
|
||||
@staticmethod
|
||||
def WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile):
|
||||
result = phpUtilities.GetPHPVersionFromFile(vhFile)
|
||||
command = result + " -v | awk '/^PHP/ {print $2}'"
|
||||
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
|
||||
return f"PHP {php_version}"
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def InstallSaidPHP(php):
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20:
|
||||
|
|
|
|||
|
|
@ -61,66 +61,48 @@
|
|||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-sticky-note btn-icon text-muted" data-toggle="tooltip"
|
||||
data-placement="right" title="State"> </i>
|
||||
<span ng-bind="web.state" style="text-transform: none"></span>
|
||||
</div>
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-map-marker btn-icon text-muted" data-toggle="tooltip"
|
||||
data-placement="right" title="IP Address"> </i>
|
||||
<span ng-bind="web.ipAddress"></span>
|
||||
</div>
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-lock btn-icon text-muted" data-toggle="tooltip" data-placement="right"
|
||||
title="SSL"> </i>
|
||||
<span><a ng-click="issueSSL(web.domain)" href=""
|
||||
style="text-transform: none">{% trans "Issue SSL" %}</a></span>
|
||||
</div>
|
||||
<div class="col-md-3 content-box-header">
|
||||
|
||||
<span ng-bind="web.phpVersion"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-hdd-o btn-icon text-muted" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="Disk Usage"> </i>
|
||||
<span ng-bind="web.diskUsed" style="text-transform: none"></span>
|
||||
</div>
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-cubes btn-icon text-muted" data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="Packages"> </i>
|
||||
<span ng-bind="web.package" style="text-transform: none"></span>
|
||||
</div>
|
||||
<div class="col-md-4 content-box-header">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-user btn-icon text-muted" data-toggle="tooltip" data-placement="right"
|
||||
title="Owner"> </i>
|
||||
<span ng-bind="web.admin" style="text-transform: none"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--table cellpadding="0" cellspacing="0" border="0" class="table" style="margin:0px 0px; id="datatable-example">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP Address</th>
|
||||
<th>Package</th>
|
||||
<th>Owner</th>
|
||||
<th>State</th>
|
||||
<th>Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td ng-bind="web.ipAddress"></td>
|
||||
<td ng-bind="web.package"></td>
|
||||
<td ng-bind="web.admin"></td>
|
||||
<td ng-bind="web.state"></td>
|
||||
<td ng-bind="web.adminEmail"></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table-->
|
||||
|
||||
<div id="listFail" class="alert alert-danger">
|
||||
<p>{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2411,18 +2411,28 @@ class WebsiteManager:
|
|||
logging.CyberCPLogFileWriter.writeToFile("Failed to read machine IP, error:" + str(msg))
|
||||
ipAddress = "192.168.100.1"
|
||||
|
||||
### lets first find php path
|
||||
|
||||
from plogical.phpUtilities import phpUtilities
|
||||
|
||||
|
||||
|
||||
for items in websites:
|
||||
if items.state == 0:
|
||||
state = "Suspended"
|
||||
else:
|
||||
state = "Active"
|
||||
|
||||
vhFile = f'/usr/local/lsws/conf/vhosts/{items.domain}/vhost.conf'
|
||||
|
||||
PHPVersionActual = phpUtilities.WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile)
|
||||
|
||||
DiskUsage, DiskUsagePercentage, bwInMB, bwUsage = virtualHostUtilities.FindStats(items)
|
||||
diskUsed = "%sMB" % str(DiskUsage)
|
||||
|
||||
dic = {'domain': items.domain, 'adminEmail': items.adminEmail, 'ipAddress': ipAddress,
|
||||
'admin': items.admin.userName, 'package': items.package.packageName, 'state': state,
|
||||
'diskUsed': diskUsed}
|
||||
'diskUsed': diskUsed, 'phpVersion': PHPVersionActual}
|
||||
|
||||
if checker == 0:
|
||||
json_data = json_data + json.dumps(dic)
|
||||
|
|
|
|||
Loading…
Reference in New Issue