Shift graph_debug URL parameter in graphs overview

- This also adds the InternalProcessTracker to all the graphs in the overview
This commit is contained in:
Markus Opolka 2025-06-24 11:37:45 +02:00 committed by Johannes Meyer
parent f3252bbee7
commit cc8690fdda
2 changed files with 14 additions and 0 deletions

View file

@ -5,6 +5,7 @@
namespace Icinga\Module\Graphite\Controllers;
use GuzzleHttp\Psr7\ServerRequest;
use Icinga\Module\Graphite\Util\InternalProcessTracker as IPT;
use Icinga\Module\Graphite\Web\Controller\IcingadbGraphiteController;
use Icinga\Module\Graphite\Web\Controller\TimeRangePickerTrait;
use Icinga\Module\Graphite\Web\Widget\IcingadbGraphs;
@ -28,7 +29,13 @@ class HostsController extends IcingadbGraphiteController
}
// shift graph params to avoid exception
$graphDebug = $this->params->shift('graph_debug');
$graphRange = $this->params->shift('graph_range');
if ($graphDebug) {
IPT::enable();
}
$baseFilter = $graphRange ? Filter::equal('graph_range', $graphRange) : null;
foreach ($this->preservedParams as $param) {
$this->params->shift($param);

View file

@ -3,6 +3,7 @@
namespace Icinga\Module\Graphite\Controllers;
use GuzzleHttp\Psr7\ServerRequest;
use Icinga\Module\Graphite\Util\InternalProcessTracker as IPT;
use Icinga\Module\Graphite\Web\Controller\IcingadbGraphiteController;
use Icinga\Module\Graphite\Web\Controller\TimeRangePickerTrait;
use Icinga\Module\Graphite\Web\Widget\IcingadbGraphs;
@ -26,7 +27,13 @@ class ServicesController extends IcingadbGraphiteController
}
// shift graph params to avoid exception
$graphDebug = $this->params->shift('graph_debug');
$graphRange = $this->params->shift('graph_range');
if ($graphDebug) {
IPT::enable();
}
$baseFilter = $graphRange ? Filter::equal('graph_range', $graphRange) : null;
foreach ($this->preservedParams as $param) {
$this->params->shift($param);