Module: check_mk
Branch: master
Commit: b32bb8224a9e5a8c9763653be490b5f7e2d9135e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b32bb8224a9e5a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 16 15:20:12 2014 +0200
Virtual Host Trees: show problem icon also on non-leaf nodes
---
web/plugins/sidebar/shipped.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index b18e419..39756de 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -1283,6 +1283,15 @@ def tag_tree_worst_state(tree):
return 2
return max(states)
+def tag_tree_has_svc_problems(tree):
+ if "_svc_problems" in tree:
+ return tree["_svc_problems"]
+ else:
+ for x in tree.values():
+ if tag_tree_has_svc_problems(x):
+ return True
+ return False
+
def tag_tree_url(taggroups, taglist, viewname):
urlvars = [("view_name", viewname), ("filled_in",
"filter")]
if viewname == "svcproblems":
@@ -1299,6 +1308,14 @@ def tag_tree_bullet(state, leaf):
def render_tag_tree_level(taggroups, path, title, tree):
bullet = tag_tree_bullet(tag_tree_worst_state(tree), False)
+ if tag_tree_has_svc_problems(tree):
+ html.plug()
+ url = tag_tree_url(taggroups, path, "svcproblems")
+ html.icon_button(url, _("Show the service problems contained in this
branch"),
+ "svc_problems", target="main")
+ bullet += html.drain()
+ html.unplug()
+
if path:
html.begin_foldable_container("tag-tree", ".".join(map(str,
path)), False, bullet + title)
items = tree.items()