mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed some scrut issues labelled Major
This commit is contained in:
@@ -94,6 +94,7 @@ function error($code, $code_msg, $title, $msg) {
|
||||
imagestring($png, 5, 60, 35, sprintf('%s [%d]', $code_msg, $code), $c_etxt);
|
||||
if (function_exists('imagettfbbox') && is_file($config['error_font'])) {
|
||||
// Detailled error message
|
||||
$errorfont = $config['error_font'];
|
||||
$fmt_msg = makeTextBlock($msg, $errorfont, 10, ($w - 86));
|
||||
$fmtbox = imagettfbbox(12, 0, $errorfont, $fmt_msg);
|
||||
imagettftext($png, 10, 0, 55, (35 + 3 + imagefontwidth(5) - $fmtbox[7] + $fmtbox[1]), $c_txt, $errorfont, $fmt_msg);
|
||||
@@ -274,7 +275,7 @@ else if ($rrd_cmd) {
|
||||
header('Cache-Control: max-age=60');
|
||||
$rt = 0;
|
||||
passthru($rrd_cmd, $rt);
|
||||
if ($rt != 0) {
|
||||
if ($rt !== 0) {
|
||||
return error500($graph_identifier, 'RRD failed to generate the graph: '.$rt);
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@ $rrd_options .= ' -l 0 -E ';
|
||||
$iter = '1';
|
||||
$rrd_options .= " COMMENT:'Toner level Cur Min Max\\n'";
|
||||
foreach (dbFetchRows('SELECT * FROM toner where device_id = ?', array($device['device_id'])) as $toner) {
|
||||
$colour = toner2colour($toner['toner_descr']);
|
||||
$colour = toner2colour($toner['toner_descr'], 100 - $toner['toner_current']);
|
||||
|
||||
if ($colour['left'] == null) {
|
||||
// FIXME generic colour function
|
||||
|
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrd_options .= " COMMENT:' Cur Max\\n'";
|
||||
|
||||
$colour = toner2colour($toner['toner_descr']);
|
||||
$colour = toner2colour($toner['toner_descr'], 100 - $toner['toner_current']);
|
||||
if ($colour['left'] == null) {
|
||||
$colour['left'] = 'CC0000';
|
||||
}
|
||||
|
Reference in New Issue
Block a user