Merge pull request #442 from bergware/master

Dashboard: Suppress PHP warnings
This commit is contained in:
tom mortensen
2019-01-17 08:44:13 -08:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -277,7 +277,7 @@ class DockerTemplates {
if ($ct['Running']) {
$port = &$ct['Ports'][0];
$ip = ($ct['NetworkMode']=='host'||$port['NAT'] ? $host : $port['IP']);
$tmp['url'] = strpos($tmp['url'],$ip)!==false ? $tmp['url'] : $this->getControlURL($ct, $ip);
$tmp['url'] = $ip ? (strpos($tmp['url'],$ip)!==false ? $tmp['url'] : $this->getControlURL($ct, $ip)) : $tmp['url'];
$tmp['shell'] = $tmp['shell'] ?? $this->getTemplateValue($image, 'Shell');
}
$tmp['registry'] = $tmp['registry'] ?? $this->getTemplateValue($image, 'Registry');

View File

@@ -198,8 +198,8 @@ function device_usage(&$disk, $array, &$full, &$high) {
$load = substr($used,0,-1);
$critical = $disk['critical'] ?? $_POST['critical'];
$warning = $disk['warning'] ?? $_POST['warning'];
if ($load >= $critical) {$class = 'redbar'; $full++;}
elseif ($load >= $warning) {$class = 'orangebar'; $high++;}
if ($critical > 0 && $load >= $critical) {$class = 'redbar'; $full++;}
elseif ($warning > 0 && $load >= $warning) {$class = 'orangebar'; $high++;}
else $class = 'greenbar';
} else $class = false;
} else $used = false;
@@ -240,8 +240,8 @@ function extra_group(&$disks) {
}
switch ($_POST['cmd']) {
case 'array':
$var = parse_ini_file('state/var.ini');
$disks = array_filter(parse_ini_file('state/disks.ini',true),'active_disks');
$var = parse_ini_file('state/var.ini') ?: [];
$disks = array_filter(parse_ini_file('state/disks.ini',true),'active_disks') ?: [];
$saved = @parse_ini_file('state/monitor.ini',true) ?: [];
require_once "$docroot/webGui/include/CustomMerge.php";
require_once "$docroot/webGui/include/Preselect.php";