Module: check_mk
Branch: master
Commit: afc385a68b59a0a0fd10d8435a09459d4e4ff113
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=afc385a68b59a0…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Dec 6 10:47:37 2016 +0100
improved filter choices
---
web/plugins/visuals/filters.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/web/plugins/visuals/filters.py b/web/plugins/visuals/filters.py
index 71ca836..db85b94 100644
--- a/web/plugins/visuals/filters.py
+++ b/web/plugins/visuals/filters.py
@@ -1227,16 +1227,17 @@ class FilterECServiceLevelRange(Filter):
def _prepare_choices(self):
- return map( lambda x: ( str(x[0]), "%s - %s" % (x[0], x[1]) ),
- config.mkeventd_service_levels )
+ choices = config.mkeventd_service_levels[:]
+ choices.sort()
+ return map( lambda x: ( str(x[0]), "%s - %s" % (x[0], x[1]) ), choices
)
def display(self):
selection = [ ("", "") ] + self._prepare_choices()
html.write("From")
- html.sorted_select(self.lower_bound_varname, selection)
+ html.select(self.lower_bound_varname, selection)
html.write("To")
- html.sorted_select(self.upper_bound_varname, selection)
+ html.select(self.upper_bound_varname, selection)
def filter(self, infoname):