Module: check_mk
Branch: master
Commit: 3af5a163b7c28f2eef0c4ac52397e2512835b6fe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3af5a163b7c28f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 22 09:07:59 2017 +0100
Analyze config: Failed tests can now be hidden using a dedicated button
Change-Id: Ib910bcb811f06f54802325adcfcdc57af1da2b4a
---
web/htdocs/wato.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index e165c27..28a0208 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -16429,8 +16429,9 @@ class ModeAnalyzeConfig(WatoMode):
def _from_vars(self):
- self._show_ok = html.has_var("show_ok")
- self._show_ack = html.has_var("show_ack")
+ self._show_ok = html.has_var("show_ok")
+ self._show_failed = not html.has_var("hide_failed")
+ self._show_ack = html.has_var("show_ack")
def title(self):
@@ -16481,6 +16482,11 @@ class ModeAnalyzeConfig(WatoMode):
else:
html.buttonlink(html.makeuri([("show_ok", "1")]),
_("Show succeeded tests"))
+ if self._show_failed:
+ html.buttonlink(html.makeuri([("hide_failed", "1")]),
_("Hide failed tests"))
+ else:
+ html.buttonlink(html.makeuri([], delvars=["hide_failed"]),
_("Show failed tests"))
+
if self._show_ack:
html.buttonlink(html.makeuri([], delvars=["show_ack"]),
_("Hide acknowledged tests"))
else:
@@ -16624,6 +16630,9 @@ class ModeAnalyzeConfig(WatoMode):
if not self._show_ok:
results = filter(lambda result: type(result) != ACResultOK, results)
+ if not self._show_failed:
+ results = filter(lambda result: type(result) == ACResultOK, results)
+
if not self._show_ack:
results = filter(lambda result: not self._is_acknowledged(result),
results)