From a58a146ad5cc0079fd68431cd679943f933e35a4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 15:24:14 +0200 Subject: Adding upstream version 1.1.0. Signed-off-by: Daniel Baumann --- .../Map/ProvidedHook/Monitoring/HostActions.php | 30 ++++++++++++++++++++++ .../Map/ProvidedHook/Monitoring/ServiceActions.php | 28 ++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 library/Map/ProvidedHook/Monitoring/HostActions.php create mode 100644 library/Map/ProvidedHook/Monitoring/ServiceActions.php (limited to 'library/Map/ProvidedHook/Monitoring') diff --git a/library/Map/ProvidedHook/Monitoring/HostActions.php b/library/Map/ProvidedHook/Monitoring/HostActions.php new file mode 100644 index 0000000..d64f743 --- /dev/null +++ b/library/Map/ProvidedHook/Monitoring/HostActions.php @@ -0,0 +1,30 @@ +fetchCustomvars(); + if (array_key_exists("geolocation", $host->customvars)) { + $nav->addItem(new NavigationItem(t('Show on map'), array( + 'url' => Url::fromPath('map/', array('showHost' => $host->getName())), + 'target' => '_next', + 'icon' => 'globe', + ))); + } + + return $nav; + } +} diff --git a/library/Map/ProvidedHook/Monitoring/ServiceActions.php b/library/Map/ProvidedHook/Monitoring/ServiceActions.php new file mode 100644 index 0000000..e29140d --- /dev/null +++ b/library/Map/ProvidedHook/Monitoring/ServiceActions.php @@ -0,0 +1,28 @@ +fetchCustomvars(); + if (array_key_exists("geolocation", $service->customvars)) { + $nav->addItem(new NavigationItem(t('Show on map'), array( + 'url' => Url::fromPath('map/', array('showHost' => $service->host_name . "!" . $service->getName())), + 'target' => '_next', + 'icon' => 'globe', + ))); + } + + return $nav; + } +} -- cgit v1.2.3