Module: check_mk
Branch: master
Commit: 73a1cfd7664b02a43945eda9a6534fd98132dc74
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=73a1cfd7664b02…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 3 13:07:00 2010 +0100
Fixed wato url when using multiple sites
---
web/plugins/sidebar/wato.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index f40a7bb..86dc9e2 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -19,7 +19,7 @@ def render_wato_files():
state = html.site_status[sitename]["state"]
if state != "disabled":
html.write("<h3>%s</h3>\n" %
site["alias"])
- ajax_url = site["url_prefix"] +
"check_mk/ajax_wato_files.py"
+ ajax_url = site["url_prefix"] +
"check_mk/ajax_wato_files.py?site=" + sitename
html.javascript("document.write(get_url_sync('%s'));" % ajax_url)
else:
ajax_wato_files(html)
@@ -27,10 +27,14 @@ def render_wato_files():
def ajax_wato_files(h):
global html
html = h
+ sitename = html.var('site', '')
if config.may("use_wato"):
for filename, title, roles in config.config_files:
if config.role in roles:
- bulletlink(title, "wato.py?filename=%s" % filename)
+ if sitename:
+ bulletlink(title, "/%s/check_mk/wato.py?filename=%s" %
(sitename, filename))
+ else:
+ bulletlink(title, "wato.py?filename=%s" % filename)
sidebar_snapins["wato"] = {