Module: check_mk
Branch: master
Commit: 8c9664c23f0e8d3c63fcc5c26118ee9eb27b8997
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8c9664c23f0e8d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 26 12:17:47 2012 +0200
Dashboard "iframe" attribute can now be rendered dynamically using the
"iframefunc" attribute in the dashlet declaration
---
ChangeLog | 2 ++
web/htdocs/dashboard.py | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7273308..66bb2fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,8 @@
"Host check command expanded"
* FIX: Corrected garbled description for sorter "Service Performance data"
* Dashboard globes can now be filtered by host_contact_group/service_contact_group
+ * Dashboard "iframe" attribute can now be rendered dynamically using the
+ "iframefunc" attribute in the dashlet declaration
Livestatus:
* Added new table statehist, used for SLA queries
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index dbec35f..2bb4e12 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -196,6 +196,10 @@ def render_dashlet(nr, dashlet, wato_folder):
bg = ""
html.write('<div class="dashlet_inner%s"
id="dashlet_inner_%d">' % (bg, nr))
+ # Optional way to render a dynamic iframe URL
+ if "iframefunc" in dashlet:
+ dashlet["iframe"] = dashlet["iframefunc"]()
+
# The method "view" is a shortcut for "iframe" with a certain
url
if "view" in dashlet:
dashlet["iframe"] =
"view.py?view_name=%s&display_options=HRSIXL&_body_class=dashlet" %
dashlet["view"]