summaryrefslogtreecommitdiffstats
path: root/application/controllers/GraphController.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:46:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:46:04 +0000
commitb880345a8a897b3fe600ef94a0fee5bb5f2f8558 (patch)
treefdc7483ceea33373b6cfa4a8c20c11cb02a2676a /application/controllers/GraphController.php
parentInitial commit. (diff)
downloadicingaweb2-module-pnp-upstream.tar.xz
icingaweb2-module-pnp-upstream.zip
Adding upstream version 1.1.0.upstream/1.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/controllers/GraphController.php')
-rw-r--r--application/controllers/GraphController.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/application/controllers/GraphController.php b/application/controllers/GraphController.php
new file mode 100644
index 0000000..312b802
--- /dev/null
+++ b/application/controllers/GraphController.php
@@ -0,0 +1,41 @@
+<?php
+/* Icinga Web 2 | (c) 2013-2017 Icinga Development Team | GPLv2+ */
+
+namespace Icinga\Module\Pnp\Controllers;
+
+use Icinga\Module\Pnp\Web\Controller;
+
+class GraphController extends Controller
+{
+ public function indexAction()
+ {
+ $url = $this->getRequest()->getUrl();
+ $queryString = $url->getQueryString();
+
+ $this->view->url = sprintf(
+ '%s/graph?%s',
+ $this->getBaseUrl(),
+ $queryString
+ );
+
+ $host = $this->getParam('host');
+ $service = $this->getParam('srv');
+
+ $serviceTitle = '';
+ if ($service && $service !== '_HOST_') {
+ $serviceTitle = sprintf(' | %s: %s', $this->translate('Service'), $service);
+ }
+ $this->view->title = $title = sprintf('%s: %s%s',
+ $this->translate('Host'),
+ $host,
+ $serviceTitle
+ );
+
+ $this->getTabs()->add('graph', array(
+ 'label' => $title,
+ 'url' => $url,
+ ))->activate('graph');
+
+ $this->setViewScript('index/iframe');
+ }
+}