Module: check_mk
Branch: master
Commit: 9253e03e5c8082d7896881f82d3f0e3076553ed8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9253e03e5c8082…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 9 16:18:48 2012 +0100
Site filter shows "(local)" in case of non multi-site setup
---
ChangeLog | 1 +
web/htdocs/pagefunctions.py | 15 +++++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4e9af24..81df73b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
to disable sounds.
* Added filter for log state (UP,DOWN,OK,CRIT...) to all log views
* New painter for normal and retry check interval (added to detail views)
+ * Site filter shows "(local)" in case of non multi-site setup
WATO:
* Removed IP-Address attribute from folders
diff --git a/web/htdocs/pagefunctions.py b/web/htdocs/pagefunctions.py
index 742c885..4ff5d33 100644
--- a/web/htdocs/pagefunctions.py
+++ b/web/htdocs/pagefunctions.py
@@ -34,11 +34,14 @@ def add_site_icon(html, sitename):
return False
def site_selector(html, htmlvar, enforce = True):
- if enforce:
- choices = []
+ if not config.is_multisite():
+ choices = [("", _("(local)"))]
else:
- choices = [("","")]
- for sitename, state in html.site_status.items():
- if state["state"] == "online":
- choices.append((sitename, config.site(sitename)["alias"]))
+ if enforce:
+ choices = []
+ else:
+ choices = [("","")]
+ for sitename, state in html.site_status.items():
+ if state["state"] == "online":
+ choices.append((sitename, config.site(sitename)["alias"]))
html.sorted_select(htmlvar, choices)