Module: check_mk
Branch: master
Commit: 25db139bdfc9ca7a203cd894b77662d0f623a235
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=25db139bdfc9ca…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 11 10:22:45 2015 +0200
#2604 FIX Dashboards: Improved error handling in case of broken dashlet
---
.werks/2604 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/dashboard.py | 20 +++++++++++---------
web/htdocs/js/checkmk.js | 2 +-
4 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/.werks/2604 b/.werks/2604
new file mode 100644
index 0000000..ea769cc
--- /dev/null
+++ b/.werks/2604
@@ -0,0 +1,9 @@
+Title: Dashboards: Improved error handling in case of broken dashlet
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i3
+Date: 1441959747
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index c30f93e..a1433dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -217,6 +217,7 @@
* 2578 FIX: Fix exception in case a user has a non-existant role...
* 2556 FIX: Availability: Fixed exception when trying to group BI aggregations by
host/service-groups
* 2580 FIX: Remove bogus ;0 in comment of problem acknowledgements...
+ * 2604 FIX: Dashboards: Improved error handling in case of broken dashlet
WATO:
* 2365 Removed old deprecated notification global options for plain emails...
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 9eda7b4..78c23bf 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -539,20 +539,22 @@ dashboard_scheduler(1);
html.body_end() # omit regular footer with status icons, etc.
-def render_dashlet_content(nr, the_dashlet, stash_html_vars = False):
+def render_dashlet_content(nr, the_dashlet, stash_html_vars=True):
if stash_html_vars:
html.stash_vars()
html.del_all_vars()
- visuals.add_context_to_uri_vars(the_dashlet)
- dashlet_type = dashlet_types[the_dashlet['type']]
- if 'iframe_render' in dashlet_type:
- dashlet_type['iframe_render'](nr, the_dashlet)
- else:
- dashlet_type['render'](nr, the_dashlet)
+ try:
+ visuals.add_context_to_uri_vars(the_dashlet)
- if stash_html_vars:
- html.unstash_vars()
+ dashlet_type = dashlet_types[the_dashlet['type']]
+ if 'iframe_render' in dashlet_type:
+ dashlet_type['iframe_render'](nr, the_dashlet)
+ else:
+ dashlet_type['render'](nr, the_dashlet)
+ finally:
+ if stash_html_vars:
+ html.unstash_vars()
# Create the HTML code for one dashlet. Each dashlet has an id "dashlet_%d",
# where %d is its index (in board["dashlets"]). Javascript uses that id
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 64436ff..f40120a 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -2502,7 +2502,7 @@ function add_to_visual(visual_type, visual_name)
function pagetype_add_to_container(page_type, page_name)
{
- var element_type = popup_data[0]; // e.g. 'graph'
+ var element_type = popup_data[0]; // e.g. 'pnpgraph'
var create_info = popup_data[1]; // complex JSON struct describing the thing
var create_info_json = JSON.stringify(create_info);