summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:25:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:25:24 +0000
commitd76d47b12fdcc9e127d023661e806cf2ca8e7715 (patch)
tree52c73718c9e2b6e4aa3f997791786aa2ee6ebcc9 /public
parentInitial commit. (diff)
downloadicingaweb2-module-nagvis-d76d47b12fdcc9e127d023661e806cf2ca8e7715.tar.xz
icingaweb2-module-nagvis-d76d47b12fdcc9e127d023661e806cf2ca8e7715.zip
Adding upstream version 1.1.1.upstream/1.1.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'public')
-rw-r--r--public/css/icingaweb-nagvis-integration.css7
-rw-r--r--public/css/module.less3
-rw-r--r--public/js/module.js54
3 files changed, 64 insertions, 0 deletions
diff --git a/public/css/icingaweb-nagvis-integration.css b/public/css/icingaweb-nagvis-integration.css
new file mode 100644
index 0000000..8fa0890
--- /dev/null
+++ b/public/css/icingaweb-nagvis-integration.css
@@ -0,0 +1,7 @@
+#header ul.head > li:first-child a {
+ display: none;
+}
+
+#header ul.head.right li.dropdown {
+ display: none;
+}
diff --git a/public/css/module.less b/public/css/module.less
new file mode 100644
index 0000000..b430555
--- /dev/null
+++ b/public/css/module.less
@@ -0,0 +1,3 @@
+.compact iframe {
+ height: 40em;
+} \ No newline at end of file
diff --git a/public/js/module.js b/public/js/module.js
new file mode 100644
index 0000000..1d30129
--- /dev/null
+++ b/public/js/module.js
@@ -0,0 +1,54 @@
+
+(function(Icinga) {
+
+ var Nagvis = function(module) {
+
+ this.module = module;
+
+ this.idCache = {};
+
+ this.initialize();
+
+ this.module.icinga.logger.debug('Nagvis module loaded');
+ };
+
+ Nagvis.prototype = {
+
+ initialize: function()
+ {
+ $('#nagvis-iframe').on('load', this.frameLoaded.bind(this));
+ },
+
+ frameLoaded: function (event) {
+ var currentMap;
+ var icinga = this.module.icinga;
+ var $iframe = $('#nagvis-iframe');
+ var matchNagvis = /[\?&]show=([^\&]+)/;
+ var matchIcinga = /[\?&]map=([^\&]+)/;
+ var currentMap = null;
+ var shownMap = null;
+
+ icinga.logger.debug('Nagvis frame loaded');
+ if (currentMap = $iframe.contents()[0].location.search.match(matchNagvis)) {
+ currentMap = currentMap[1];
+ }
+ if (shownMap = document.location.search.match(matchIcinga)) {
+ shownMap = shownMap[1];
+ }
+ if (currentMap !== null && shownMap !== currentMap) {
+ this.setCurrentMap(currentMap);
+ }
+ },
+
+ setCurrentMap: function (map) {
+//icinga.logger.info(icinga.utils.addUrlParams(document.location.pathname + '?' + document.location.search, { map: 'asd' }))
+// var url = parseUrl
+ this.module.icinga.logger.info("Setting current map", map);
+ }
+
+ };
+
+ Icinga.availableModules.nagvis = Nagvis;
+
+}(Icinga));
+