Module: check_mk
Branch: master
Commit: def391d5c27be15dd9479bb40ab49458b7d0206e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=def391d5c27be1…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Apr 5 14:41:30 2012 +0200
WATO: new config option wato_hide_hosttags.
hides host tags in folder view
---
web/htdocs/config.py | 1 +
web/htdocs/wato.css | 8 ++++++++
web/htdocs/wato.py | 21 ++++++++++++---------
web/plugins/wato/check_mk_configuration.py | 8 ++++++++
4 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 324cdb3..9ed4fad 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -614,6 +614,7 @@ wato_enabled = True
wato_host_tags = []
wato_aux_tags = []
wato_hide_filenames = True
+wato_hide_hosttags = False
wato_max_snapshots = 50
wato_num_hostspecs = 12
wato_num_itemspecs = 15
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index d11e24e..de2a427 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -524,6 +524,14 @@ table.validationerror img {
font-size: 8pt;
}
+.wato td.tag-ellipsis {
+ max-width: 300px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -o-text-overflow: ellipsis;
+}
+
/*-------------------------------------------------------------------------.
| ____ |
| | _ \ _ __ ___ __ _ _ __ ___ ___ ___ |
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 90c2677..3cd1716 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1137,8 +1137,9 @@ def show_hosts(folder):
html.write("<table class=data>\n")
html.write("<tr><th
class=left></th><th></th><th>"
+ _("Hostname") + "</th><th>"
- + _("Auth") + "</th>"
- + "<th>" + _("Tags") + "</th>")
+ + _("Auth") + "</th>")
+ if not config.wato_hide_hosttags:
+ html.write("<th>" + _("Tags") +
"</th>")
for attr, topic in host_attributes:
if attr.show_in_table():
@@ -1256,13 +1257,15 @@ def show_hosts(folder):
title = htmllib.strip_tags(auth)
html.write('<td><img class=icon src="images/icon_%s.png"
title="%s"></td>' % (icon, title))
- # Raw tags
- #
- # Optimize wraps:
- # 1. add <nobr> round the single tags to prevent wrap within tags
- # 2. add "zero width space" (​)
- html.write("<td>%s</td>" % "<b style='color:
#888;'>|</b>​".join(
- [ '<nobr>%s</nobr>' %
t for t in host[".tags"] ]))
+ if not config.wato_hide_hosttags:
+ # Raw tags
+ #
+ # Optimize wraps:
+ # 1. add <nobr> round the single tags to prevent wrap within tags
+ # 2. add "zero width space" (​)
+ tag_title = "|".join([ '%s' % t for t in
host[".tags"] ])
+ html.write("<td title='%s'
class='tag-ellipsis'>%s</td>" % (tag_title, "<b
style='color: #888;'>|</b>​".join(
+ [ '<nobr>%s</nobr>' %
t for t in host[".tags"] ])))
# Show attributes
for attr, topic in host_attributes:
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index fc52c27..1f296d2 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -165,6 +165,14 @@ register_configvar(group,
domain = "multisite")
register_configvar(group,
+ "wato_hide_hosttags",
+ Checkbox(title = _("Hide hosttags in WATO folder view"),
+ label = _("hide hosttags"),
+ help = _("When enabled, hosttags are no longer shown within the WATO
folder view"),
+ default_value = False),
+ domain = "multisite")
+
+register_configvar(group,
"wato_max_snapshots",
Integer(title = _("Number of configuration snapshots to keep"),
help = _("Whenever you successfully activate changes a snapshot of the
configuration "