Module: check_mk
Branch: master
Commit: c6af400468562cc40ed3da735fbc9de1213e4a94
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c6af400468562c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jun 24 14:40:50 2011 +0200
WATO: fix bulk inventory if large number of hosts
Problem was too long GET URL due to sel_* variables.
---
web/htdocs/htmllib.py | 5 +++--
web/htdocs/wato.py | 6 +++++-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 1883c62..4c0878d 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -56,7 +56,6 @@ class uriinfo:
def makeuri(self, addvars):
return self.req.myfile + ".py?" + urlencode_vars(self.req.vars.items()
+ addvars)
-
# Liste von Hidden-Felder erzeugen aus aktueller URI
def hiddenfields(self, omit=[]):
return ''.join([ '<input type=hidden name="%s"
value="%s">\n' % i \
@@ -264,8 +263,10 @@ class html:
self.global_vars += varnames
# [('varname1', value1), ('varname2', value2) ]
- def makeuri(self, addvars):
+ def makeuri(self, addvars, remove_prefix = None):
vars = [ (v, self.var(v)) for v in self.req.vars if not
v.startswith("_") ]
+ if remove_prefix != None:
+ vars = [ i for i in vars if not i[0].startswith(remove_prefix) ]
return self.req.myfile + ".py?" + urlencode_vars(vars + addvars)
def makeuri_contextless(self, vars):
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 550bf9d..14f8f0e 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2217,8 +2217,12 @@ def interactive_progress(items, title, stats, finishvars,
timewait):
html.write("</table>")
html.write("</center>")
json_items = '[ %s ]' % ','.join([ "'" + h +
"'" for h in items ])
+ # Remove all sel_* variables. We do not need them for our ajax-calls.
+ # They are just needed for the Abort/Finish links. Those must be converted
+ # to POST.
+ base_url = html.makeuri([], remove_prefix = "sel_")
html.javascript(('progress_scheduler("%s", "%s", 50, %s,
"%s", "' + _("FINISHED.") + '");') %
- (html.var('mode'), html.makeuri([]), json_items,
html.makeuri(finishvars)))
+ (html.var('mode'), base_url, json_items,
html.makeuri(finishvars)))
# +----------------------------------------------------------------------+
# | _ _ _ _ _ _ |