Module: check_mk
Branch: master
Commit: d7cabb1077213e9a86c2a329e48f560f8b11cb87
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d7cabb1077213e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Aug 14 16:06:05 2011 +0200
BI: fixed filter for aggregation group
---
.bugs/241 | 10 +++++++---
ChangeLog | 3 ++-
web/plugins/views/bi.py | 9 ++++++++-
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/.bugs/241 b/.bugs/241
index 680efbb..4417908 100644
--- a/.bugs/241
+++ b/.bugs/241
@@ -1,10 +1,14 @@
Title: BI filter for aggregation group does not work
Component: bi
+State: done
+Class: bug
+Date: 2011-04-07 17:12:11
Benefit: 2
-State: open
Cost: 2
-Date: 2011-04-07 17:12:11
-Class: bug
+Fun: 0
In the table single host aggregations the filter for the
BI group is not effective. It is simply ignored.
+
+2011-08-14 16:05:22: changed state open -> done
+Done. The filter code was simply missing.
diff --git a/ChangeLog b/ChangeLog
index 063c29e..d28e0cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -97,7 +97,8 @@
no scan will be done until new button "Full Scan" is pressed.
BI:
- * Fixed displaying of host states (after i18n introduction)h
+ * FIX: Fixed displaying of host states (after i18n introduction)h
+ * FiX: fixed filter for aggregation group
MK Livestatus:
* FIX: fix compile problem on Debian unstable (Thanks to Sven Velt)
diff --git a/web/plugins/views/bi.py b/web/plugins/views/bi.py
index ab406ed..705e1ba 100644
--- a/web/plugins/views/bi.py
+++ b/web/plugins/views/bi.py
@@ -396,11 +396,18 @@ class BIGroupFilter(Filter):
def display(self):
bi.compile_forest(html.req.user)
htmlvar = self.htmlvars[0]
- html.select(htmlvar, [(g,g) for g in
bi.g_user_cache["forest"].keys()])
+ html.select(htmlvar, [ ("", "") ] + [(g,g) for g in
bi.g_user_cache["forest"].keys()])
def selected_group(self):
return html.var(self.htmlvars[0])
+ def filter_table(self, rows):
+ group = self.selected_group()
+ if not group:
+ return rows
+ else:
+ return [ row for row in rows if row[self.column] == group ]
+
def heading_info(self, infoname):
return html.var(self.htmlvars[0])