Module: check_mk
Branch: master
Commit: f10cd513227743d363981175bf031ded138cddba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f10cd513227743…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 19 16:02:35 2017 +0100
5586 FIX Raw edition: Fixed adding graphs to dashboards
Change-Id: Id9610aee4522f215c90fba48be27ce26b87cffb2
---
.werks/5586 | 11 +++++++++++
web/htdocs/dashboard.py | 7 +++++--
web/htdocs/js/checkmk.js | 2 +-
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/5586 b/.werks/5586
new file mode 100644
index 0000000..7579f14
--- /dev/null
+++ b/.werks/5586
@@ -0,0 +1,11 @@
+Title: Raw edition: Fixed adding graphs to dashboards
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i2
+Date: 1513695677
+
+
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index b6543d3..9dd3079 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -1300,10 +1300,13 @@ def popup_add_dashlet(dashboard_name, dashlet_type, context,
params):
# Exceptions do not work here.
return
- if dashlet_type == "pnpgraph":
+ if dashlet_type == "pnpgraph" and context is None:
+ # Raw Edition graphs are added correctly by htdocs/js/checkmk.js
create_pnp_graph().
+ # Enterprise Edition graphs:
+ #
# Context will always be None here, but the specification (in params)
# will contain it. Transform the data to the format needed by the dashlets.
-
+ #
# Example:
# params = [ 'template', {'service_description': 'CPU
load', 'site': 'mysite',
# 'graph_index': 0, 'host_name':
'server123'}])
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 0ecd9ac..8ecb1f0 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -805,7 +805,7 @@ function create_pnp_graph(data, params) {
var view = data['view'] == '' ? 0 : data['view'];
// needs to be extracted from "params", hack!
- var source = parseInt(getUrlParam('source', params));
+ var source = parseInt(getUrlParam('source', params)) + 1;
// Add the control for adding the graph to a visual
var visualadd = document.createElement('a');