mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
@@ -109,6 +109,7 @@ function api_get_graph(Request $request, array $additional = [])
|
|||||||
'noagg',
|
'noagg',
|
||||||
'inverse',
|
'inverse',
|
||||||
'previous',
|
'previous',
|
||||||
|
'duration',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$graph = Graph::get([
|
$graph = Graph::get([
|
||||||
|
@@ -6,15 +6,16 @@ $float_precision = '3';
|
|||||||
$scale_min = '0';
|
$scale_min = '0';
|
||||||
$scale_max = '100';
|
$scale_max = '100';
|
||||||
|
|
||||||
if ($vars['duration'] > 86400) {
|
$duration = $vars['duration'] ?? 86400;
|
||||||
$rrd_filename = Rrd::name($device['hostname'], ['availability', $vars['duration']]);
|
if ($duration > 86400) {
|
||||||
|
$rrd_filename = Rrd::name($device['hostname'], ['availability', $duration]);
|
||||||
|
|
||||||
$colour_line = '000000';
|
$colour_line = '000000';
|
||||||
$colour_area = '8B8BEB44';
|
$colour_area = '8B8BEB44';
|
||||||
|
|
||||||
$colour_area_max = 'cc9999';
|
$colour_area_max = 'cc9999';
|
||||||
|
|
||||||
$line_text = \LibreNMS\Util\Time::formatInterval($vars['duration']);
|
$line_text = \LibreNMS\Util\Time::formatInterval($duration);
|
||||||
|
|
||||||
$graph_title .= '::' . $line_text;
|
$graph_title .= '::' . $line_text;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ if ($vars['duration'] > 86400) {
|
|||||||
|
|
||||||
require 'includes/html/graphs/generic_simplex.inc.php';
|
require 'includes/html/graphs/generic_simplex.inc.php';
|
||||||
} else {
|
} else {
|
||||||
$filename = Rrd::name($device['hostname'], ['availability', $vars['duration']]);
|
$filename = Rrd::name($device['hostname'], ['availability', $duration]);
|
||||||
$descr = '';
|
$descr = '';
|
||||||
|
|
||||||
require 'includes/html/graphs/generic_stats.inc.php';
|
require 'includes/html/graphs/generic_stats.inc.php';
|
||||||
|
Reference in New Issue
Block a user