mirror of
https://github.com/unraid/webgui.git
synced 2026-03-17 18:36:14 -05:00
Merge pull request #442 from bergware/master
Dashboard: Suppress PHP warnings
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user