Module: check_mk
Branch: master
Commit: 54a493dbfcdac33c68cbabf0454311c989fe09bb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=54a493dbfcdac3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 5 13:16:54 2011 +0200
FIX: endless javascript when fetching pnp graphs on host/service detail pages
---
ChangeLog | 1 +
web/htdocs/js/check_mk.js | 14 +++++++-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c121dcb..a66e5de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
* FIX: Fixed js errors in IE when having not enough space on dashboard
* FIX: fix error when using non-Ascii characters in view title
* FIX: fix error on comment page caused by missing sorter
+ * FIX: endless javascript when fetching pnp graphs on host/service detail pages
* Added missing i18n strings in command form and list of views
* Views are not reloaded completely anymore. The data tables are reloaded
on their own.
diff --git a/web/htdocs/js/check_mk.js b/web/htdocs/js/check_mk.js
index a19595c..3df1ca8 100644
--- a/web/htdocs/js/check_mk.js
+++ b/web/htdocs/js/check_mk.js
@@ -319,15 +319,15 @@ function pnp_error_response_handler(data, statusCode) {
function pnp_response_handler(data, code) {
var valid_response = true;
- var response = null;
+ var response = [];
try {
response = eval(code);
for(var i = 0; i < response.length; i++) {
- var graph = response[i];
var view = data['view'] == '' ? '0' :
data['view'];
- create_graph(data, '&' +
graph['image_url'].replace('&view='+view, ''));
- i = null;
+ create_graph(data, '&' +
response[i]['image_url'].replace('&view='+view, ''));
}
+ view = null;
+ i = null;
} catch(e) {
valid_response = false;
}
@@ -339,9 +339,9 @@ function pnp_response_handler(data, code) {
// Fallback bei doofer/keiner Antwort
function fallback_graphs(data) {
- for(var i = 0; i < 8; i++) {
- create_graph(data, '&host=' + data['host'] +
'&srv=' + data['service'] + '&source=' + i);
- }
+ for(var s = 0; s < 8; s++) {
+ create_graph(data, '&host=' + data['host'] +
'&srv=' + data['service'] + '&source=' + s);
+ }
}
function create_graph(data, params) {