mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Improve the formating of some graphs (#5507)
This commit is contained in:
committed by
Neil Lathwood
parent
998750ddd9
commit
755860fec5
@@ -2,31 +2,14 @@
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
if ($width > '500') {
|
||||
$descr_len = 24;
|
||||
// FIXME may even be more imo?
|
||||
} else {
|
||||
$descr_len = 12;
|
||||
$descr_len += round(($width - 250) / 8);
|
||||
}
|
||||
$descr_len = 12;
|
||||
|
||||
if ($nototal) {
|
||||
$descr_len += '2';
|
||||
$unitlen += '2';
|
||||
}
|
||||
|
||||
$unit_text = str_pad(truncate($unit_text, $unitlen), $unitlen);
|
||||
|
||||
if ($width > '500') {
|
||||
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, ($descr_len + 5)), 0, ($descr_len + 5))."Now Min Max Avg\l'";
|
||||
if (!$nototal) {
|
||||
$rrd_options .= " COMMENT:'Total '";
|
||||
}
|
||||
|
||||
$rrd_options .= " COMMENT:'\l'";
|
||||
} else {
|
||||
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, ($descr_len + 5)), 0, ($descr_len + 5))."Now Min Max Avg\l'";
|
||||
}
|
||||
$rrd_options .= " COMMENT:'".rrdtool_escape($unit_text, $descr_len)." Now Min Max Avg\l'";
|
||||
|
||||
$unitlen = '10';
|
||||
if ($nototal) {
|
||||
|
Reference in New Issue
Block a user