Skip to content

Commit

Permalink
fixes #309
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikesch-mp committed Apr 6, 2023
1 parent 0d70d6b commit 32d26b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Binary file added library/Grafana/Helpers/.Timeranges.php.swp
Binary file not shown.
5 changes: 1 addition & 4 deletions library/Grafana/Helpers/Timeranges.php
Expand Up @@ -93,10 +93,7 @@ protected function isValidTimeStamp($timestamp)

private function buildTimerangeMenu($timerange = "", $timerangeto = "")
{
$url = 'grafana/dashboard?';
if (Module::exists('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) {
$url = 'grafana/icingadbdashboard?';
}
$url = 'grafana/icingadbdashboard?';

$clockIcon = $this->view->qlink($timerange, 'dashboard/new-dashlet',
['url' => $url . http_build_query($this->urlparams, '', '&', PHP_QUERY_RFC3986)],
Expand Down
8 changes: 7 additions & 1 deletion library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php
Expand Up @@ -352,11 +352,17 @@ public function getPreviewHtml(Model $object, $report = false)
$serviceName = $object->checkcommand_name;
$hostName = $object->name;
$link = Links::host($object);
$parameters = ['host' => $hostName];
$parameters = array(
'host' => $hostName,
);
} elseif ($object instanceof Service) {
$serviceName = $object->name;
$hostName = $object->host->name;
$link = Links::service($object, $object->host);
$parameters = array(
'host' => $hostName,
'service' => $serviceName,
);
}

$parameters['timerange'] = $this->timerange;
Expand Down

0 comments on commit 32d26b8

Please sign in to comment.