limit folder names to the top level

This commit is contained in:
SJ
2012-09-11 15:12:58 +02:00
parent 46ec86a070
commit 604ff565e1
2 changed files with 4 additions and 4 deletions

View File

@ -70,10 +70,10 @@ class ModelHealthHealth extends Model {
if(isset($a[0]) && $a[0]) { $_m[$a[0]] = $a[1]; }
}
$mem_percentage = sprintf("%.2f", 100*($_m['MemTotal:'] - $_m['MemFree:'] - $_m['Cached:']) / $_m['MemTotal:']);
$swap_percentage = sprintf("%.2f", 100*($_m['SwapTotal:'] - $_m['SwapFree:']) / $_m['SwapTotal:']);
$mem_percentage = isset($_m['MemTotal:']) ? sprintf("%.2f", 100*($_m['MemTotal:'] - $_m['MemFree:'] - $_m['Cached:']) / $_m['MemTotal:']) : "0";
$swap_percentage = isset($_m['SwapTotal:']) ? sprintf("%.2f", 100*($_m['SwapTotal:'] - $_m['SwapFree:']) / $_m['SwapTotal:']) : "0";
return array(sprintf("%.0f", $_m['MemTotal:'] / 1000), $mem_percentage, sprintf("%.0f", $_m['SwapTotal:'] / 1000), $swap_percentage);
return array(sprintf("%.0f", @$_m['MemTotal:'] / 1000), $mem_percentage, sprintf("%.0f", @$_m['SwapTotal:'] / 1000), $swap_percentage);
}