Module: check_mk
Branch: master
Commit: 5375a0746ca0382298c523fc34e24840eccf448c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5375a0746ca038…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Apr 29 15:30:09 2011 +0200
Fixed handling of embedded graphs to support the changed made in the PNP webservice
---
web/htdocs/js/check_mk.js | 7 ++++---
web/plugins/views/painters.py | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/js/check_mk.js b/web/htdocs/js/check_mk.js
index 4983831..75b11d5 100644
--- a/web/htdocs/js/check_mk.js
+++ b/web/htdocs/js/check_mk.js
@@ -161,7 +161,8 @@ function pnp_response_handler(data, code) {
response = eval(code);
for(var i in response) {
var graph = response[i];
- create_graph(data, '&' +
graph['image_url'].replace('&view=1', ''));
+ var view = data['view'] == '' ? '0' :
data['view'];
+ create_graph(data, '&' +
graph['image_url'].replace('&view='+view, ''));
i = null;
}
} catch(e) {
@@ -207,8 +208,8 @@ function render_pnp_graphs(container, site, host, service, pnpview,
base_url, pn
'pnp_url': pnp_url, 'site': site,
'host': host, 'service': service,
'with_link': with_link, 'view': pnpview};
- get_url(pnp_url + 'index.php/json?&host=' + host + '&srv=' +
service + '&source=0',
- pnp_response_handler, data, pnp_error_response_handler);
+ get_url(pnp_url + 'index.php/json?&host=' + host + '&srv=' +
service + '&source=0&view=' + pnpview,
+ pnp_response_handler, data,
pnp_error_response_handler);
}
// ----------------------------------------------------------------------------
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 225122b..168816c 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -77,7 +77,7 @@ import bi # needed for aggregation icon
multisite_painter_options["pnpview"] = {
"title" : "PNP Timerange",
"default" : "1",
- "values" : [ ("0", "4 Hours"), ("1", "25
Hours"), ("2", "One week"), ("3", "One
Month"), ("4", "One Year"), ]
+ "values" : [ ("0", "4 Hours"), ("1", "25
Hours"), ("2", "One week"), ("3", "One
Month"), ("4", "One Year"), ("", "All") ]
}
multisite_painter_options["ts_format"] = {