Module: check_mk
Branch: master
Commit: 4620d5a735fe640927ae07fea3df956fd484351b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4620d5a735fe64…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 2 13:57:23 2013 +0200
Sorting group filters by alias now
---
web/plugins/views/filters.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 9e914f1..739dcce 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -112,12 +112,10 @@ declare_filter(102, FilterIPAddress())
# Helper that retrieves the list of host/service/contactgroups via Livestatus
+# use alias by default but fallback to name if no alias defined
def all_groups(what):
groups = dict(html.live.query("GET %sgroups\nColumns: name alias\n" %
what))
- names = groups.keys()
- names.sort()
- # use alias by default but fallback to name if no alias defined
- return [ (name, groups[name] or name) for name in names ]
+ return [ (name, groups[name] or name) for name in groups.keys() ]
class FilterGroupCombo(Filter):
def __init__(self, what, title, enforce):
@@ -137,7 +135,7 @@ class FilterGroupCombo(Filter):
choices = all_groups(self.what.split("_")[-1])
if not self.enforce:
choices = [("", "")] + choices
- html.select(self.htmlvars[0], choices)
+ html.sorted_select(self.htmlvars[0], choices)
if not self.enforce:
html.write(" <nobr>")
html.checkbox(self.htmlvars[1], label=_("negate"))