From 23be945fd2810ee82e3a23cbcd2352c9bda43d4f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:44:18 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- .../ProvidedHook/Icingadb/HostDetailExtension.php | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 library/Graphite/ProvidedHook/Icingadb/HostDetailExtension.php (limited to 'library/Graphite/ProvidedHook/Icingadb/HostDetailExtension.php') diff --git a/library/Graphite/ProvidedHook/Icingadb/HostDetailExtension.php b/library/Graphite/ProvidedHook/Icingadb/HostDetailExtension.php new file mode 100644 index 0000000..31e4e6c --- /dev/null +++ b/library/Graphite/ProvidedHook/Icingadb/HostDetailExtension.php @@ -0,0 +1,46 @@ +getRequest()->getUrl()->getParam('graph_debug')) { + IPT::enable(); + } + + $graphs = (string) Graphs::forIcingadbObject($host) + ->setWidth(440) + ->setHeight(220) + ->setClasses(['object-detail-view']) + ->setPreloadDummy() + ->setShowNoGraphsFound(false) + ->handleRequest(); + + if (! empty($graphs)) { + $this->handleTimeRangePickerRequest(); + + $header = Html::tag('h2', [], 'Graphs'); + $timepicker = HtmlString::create($this->renderTimeRangePicker(Icinga::app()->getViewRenderer()->view)); + $graphColorRegistry = Html::tag('div', ['class' => 'graphite-graph-color-registry']); + $graphs = HtmlString::create($graphs); + + return HtmlString::create($header . $timepicker . $graphColorRegistry . $graphs); + } + + return HtmlString::create(''); + } +} -- cgit v1.2.3