Set ping_perf scale_min to 0 (#14989)

And allow scale_min, scale_max, and scale_rigid to be set via url parameter
This commit is contained in:
Tony Murray
2023-04-20 22:30:32 -05:00
committed by GitHub
parent 7ee09ee16a
commit 2ddfba51dd
2 changed files with 4 additions and 0 deletions

View File

@@ -104,6 +104,9 @@ class GraphParameters
$this->to = empty($vars['to']) ? time() : Time::parseAt($vars['to']);
$this->period = $this->to - $this->from;
$this->prev_from = $this->from - $this->period;
$this->scale_min = $vars['scale_min'] ?? null;
$this->scale_max = $vars['scale_max'] ?? null;
$this->scale_rigid = isset($vars['scale_rigid']) && $vars['scale_rigid'] && $vars['scale_rigid'] !== 'no';
$this->inverse = ! empty($vars['inverse']);
$this->in = $this->inverse ? 'out' : 'in';

View File

@@ -16,5 +16,6 @@ $filename = Rrd::name($device['hostname'], 'ping-perf');
$descr = 'Milliseconds';
$ds = 'ping';
$scale_min = 0;
require 'includes/html/graphs/generic_stats.inc.php';