mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 03:33:49 +00:00
Code cleanup to solve a few minor issues
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
if (is_numeric($value)) { $percent_cpu = $percent_cpu + $value; }
|
||||
}
|
||||
if (stristr(PHP_OS, 'BSD')) {
|
||||
$result = trim(shell_exec("dmesg | grep -i --max-count 1 CPUs | sed 's/[^0-9]*//g'"));
|
||||
$result = system("dmesg | grep -i --max-count 1 CPUs | sed 's/[^0-9]*//g'");
|
||||
$cpu_cores = trim($result);
|
||||
}
|
||||
if (stristr(PHP_OS, 'Linux')) {
|
||||
@@ -124,7 +124,7 @@
|
||||
echo "</tr>\n";
|
||||
|
||||
if (PHP_OS == 'FreeBSD' || PHP_OS == 'Linux') {
|
||||
if ($percent_cpu != '') {
|
||||
if (!empty($percent_cpu)) {
|
||||
echo "<tr class='tr_link_void'>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-cpu_usage']."</td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right;'>".$percent_cpu."%</td>\n";
|
||||
@@ -132,7 +132,7 @@
|
||||
$c = ($c) ? 0 : 1;
|
||||
}
|
||||
|
||||
if ($cpu_cores != '') {
|
||||
if (!empty($cpu_cores)) {
|
||||
echo "<tr class='tr_link_void'>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-cpu_cores']."</td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right;'>".$cpu_cores."</td>\n";
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
$tmp = event_socket_request($fp, 'api status');
|
||||
$matches = Array();
|
||||
preg_match("/(\d+)\s+session\(s\)\s+\-\speak/", $tmp, $matches);
|
||||
$channels = $matches[1] ? $matches[1] : 0;
|
||||
$channels = !empty($matches[1]) ? $matches[1] : 0;
|
||||
$tr_link = "href='".PROJECT_PATH."/app/calls_active/calls_active.php'";
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]." hud_text'><a ".$tr_link.">".$text['label-channels']."</a></td>\n";
|
||||
|
||||
Reference in New Issue
Block a user