diff --git a/application/controllers/IcingadbimgController.php b/application/controllers/IcingadbimgController.php index 5b44581..489c32c 100644 --- a/application/controllers/IcingadbimgController.php +++ b/application/controllers/IcingadbimgController.php @@ -19,7 +19,6 @@ use ipl\Stdlib\Filter; use ipl\Web\Url; -#[\AllowDynamicProperties] class IcingadbimgController extends IcingadbGrafanaController { protected $host; @@ -49,7 +48,13 @@ class IcingadbimgController extends IcingadbGrafanaController protected $cacheTime; protected $defaultdashboarduid; protected $refresh = "yes"; - + protected $customVars; + protected $timerangeto; + protected $object; + protected $dashboard; + protected $dashboarduid; + protected $panelId; + protected $orgId; public function init() { @@ -66,7 +71,7 @@ public function init() if ($this->hasParam('timerangeto')) { $this->timerangeto = urldecode($this->getParam('timerangeto')); } else { - $this->timerangeto = strpos($this->timerange, '/') ? 'now-' . $this->timerange : "now"; + $this->timerangeto = strpos($this->timerange ?? '', '/') ? 'now-' . $this->timerange ?? '' : "now"; } $this->cacheTime = $this->hasParam('cachetime') ? $this->getParam('cachetime') : 300; @@ -326,7 +331,7 @@ private function getMyimageHtml($serviceName, $hostName, &$imageHtml) return false; } - $this->pngUrl = sprintf( + $pngUrl = sprintf( '%s://%s/render/d-solo/%s/%s?var-hostname=%s&var-service=%s&var-command=%s%s&panelId=%s&orgId=%s' . '&width=%s&height=%s&theme=%s&from=%s&to=%s', $this->protocol, @@ -349,7 +354,7 @@ private function getMyimageHtml($serviceName, $hostName, &$imageHtml) // fetch image with curl $curl_handle = curl_init(); $curl_opts = array( - CURLOPT_URL => $this->pngUrl, + CURLOPT_URL => $pngUrl, CURLOPT_CONNECTTIMEOUT => 2, CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true, diff --git a/application/controllers/IcingadbshowController.php b/application/controllers/IcingadbshowController.php index eb533bd..48bf123 100644 --- a/application/controllers/IcingadbshowController.php +++ b/application/controllers/IcingadbshowController.php @@ -31,6 +31,8 @@ class IcingadbshowController extends IcingadbGrafanaController protected $showFullscreen; protected $host; protected $custvardisable = "grafana_graph_disable"; + protected $config; + protected $object; public function init() { diff --git a/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php b/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php index dc8c1f1..5cdc4f7 100644 --- a/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php +++ b/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php @@ -68,6 +68,13 @@ trait IcingaDbGrapher protected $grafanaVersion = "0"; protected $defaultdashboarduid; protected $object; + protected $permission; + protected $dashboard; + protected $dashboarduid; + protected $panelId; + protected $orgId; + protected $customVars; + protected $pngUrl; protected function init() { @@ -236,7 +243,7 @@ private function getGraphConf($serviceName, $serviceCommand = null): ?self $this->timerange = Url::fromRequest()->hasParam('timerange') ? 'now-' . urldecode(Url::fromRequest()->getParam('timerange')) : 'now-' . $this->getGraphConfigOption($serviceName, 'timerange', $this->timerange); - $this->timerangeto = strpos($this->timerange, '/') ? $this->timerange : $this->timerangeto; + $this->timerangeto = strpos($this->timerange ?? '', '/') ? $this->timerange : $this->timerangeto; } $this->height = $this->getGraphConfigOption($serviceName, 'height', $this->height);