Module: check_mk
Branch: master
Commit: 20fbe0272f35e52229130af2efd0b98c755cec38
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=20fbe0272f35e5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue May 8 16:13:08 2012 +0200
WATO: New layout of ruleset overviews
---
ChangeLog | 1 +
web/htdocs/wato.css | 61 +++++++++++++++++++++++-----
web/htdocs/wato.py | 57 ++++++++------------------
web/plugins/wato/check_mk_configuration.py | 2 +-
web/plugins/wato/check_parameters.py | 8 ++--
5 files changed, 74 insertions(+), 55 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 07b85f9..7ef4523 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
WATO:
* ps and ps.perf configurable via WATO now (without inventory)
* New layout of main menu and a couple of other similar menus
+ * New layout of ruleset overviews
* FIX: honor folder-permissions when creating, deleting
and modifiying rules
* FIX: detect non-local site even if unix: is being used
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 085882e..11c01de 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -226,6 +226,9 @@ Boston, MA 02110-1301 USA.
}
.wato h3 {
margin-bottom: 2px;
+ color: white;
+ font-size: 13pt;
+ font-weight: normal;
}
/* host validation error */
@@ -680,19 +683,17 @@ form#form_timeperiod td.vlof_content {
font-weight: bold;
position: absolute;
left: 72px;
- top: 15px;
+ top: 14px;
}
.wato div.mainmenu div.help {
position: absolute;
left: 72px;
- top: 33px;
+ top: 32px;
width: 237px;
overflow: hidden;
}
-
-
/* Special styles for roles editor (permissions) */
.wato table.form table.permissions {
border-collapse: collapse;
@@ -714,17 +715,55 @@ form#form_timeperiod td.vlof_content {
width: 120px;
}
-/* Table in page "Rulesets" */
-.wato table.data.rulesets {
- width: 849px;
+/* page "Rulesets" */
+.wato .rulesets {
+ background-color: #eeeeee;
+ padding: 3px 5px;
+ width: 100%;
+ /* box-shadow: 0px 0px 2.5px #888; */
}
-.wato table.data.rulesets td.title {
- width: 430px;
+
+.wato .rulesets div.ruleset {
+ float: left;
+ margin-right: 20px;
}
-.wato table.data.rulesets td.varname {
- width: 300px;
+
+.wato .rulesets div.ruleset div.text {
+ width: 276px;
+ padding-right: 3px;
+ overflow: hidden;
+ float: left;
+}
+.wato .rulesets div.ruleset div {
+ height: 16px;
}
+.wato .rulesets div.ruleset a {
+ text-decoration: none;
+ color: black;
+ white-space: nowrap;
+ margin-right: 3px;
+}
+
+.wato .rulesets div.ruleset a:hover {
+ text-decoration: underline;
+}
+
+.wato .rulesets div.ruleset .dots {
+ color: #888;
+ overflow: hidden;
+}
+
+.wato .rulesets div.ruleset div.rulecount {
+ width: 16px;
+ float: left;
+ text-align: right;
+}
+
+
+
+
+
/* Table in page "Global variables" */
.wato table.data.globalvars {
width: 100%;
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 852612c..10855d7 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9159,22 +9159,6 @@ def mode_rulesets(phase):
if help:
html.write("<div class=info>%s</div>" % help)
- # html.begin_form("local")
- # html.checkbox("local", False, onclick="form.submit();")
- # if only_host:
- # html.write(" " + _("show only rulesets that contain rules
explicitely listing the host <b>%s</b>." %
- # only_host))
- # else:
- # html.write(" " + _("Show only rulesets that contain rules in the
current folder."))
- # html.write(' <img align=absbottom class=icon
src="images/icon_localrule.png"> ')
- # html.hidden_fields()
- # html.end_form()
- # html.write("<br>")
-
- # Load all rules from all folders. Hope this doesn't take too much time.
- # We need this information only for displaying the number of rules in
- # each set.
-
if only_local and not only_host:
all_rulesets = {}
rs = load_rulesets(g_folder)
@@ -9223,37 +9207,32 @@ def mode_rulesets(phase):
if not title_shown:
if something_shown:
- html.write("</table>")
- if do_folding:
- html.end_foldable_container()
+ html.write("</td></tr></table>")
+ # if do_folding:
+ # html.end_foldable_container()
if '/' in groupname:
subgroupname = groupname.split("/", 1)[1]
else:
subgroupname = groupname
- if do_folding:
- html.begin_foldable_container("rulesets", groupname, False,
subgroupname, indent=False)
- html.write('<table class="data rulesets">')
- html.write("<tr><th>" + _("Rule set") +
"</th>")
- if not config.wato_hide_varnames:
- html.write("<th>" + _("Check_MK Variable")
+ "</th>")
- html.write("<th>" + _("Rules") +
"</th></tr>\n")
- odd = "even"
+ # if do_folding:
+ # html.begin_foldable_container("rulesets", groupname,
False, subgroupname, indent=False)
+ html.write("<h3>%s</h3>" % subgroupname)
+ html.write('<table
class="rulesets"><tr><td>')
title_shown = True
something_shown = True
- odd = odd == "odd" and "even" or "odd"
- html.write('<tr class="data %s0">' % odd)
url_vars = [("mode", "edit_ruleset"),
("varname", varname)]
if only_host:
url_vars.append(("host", only_host))
view_url = make_link(url_vars)
- html.write('<td class=title><a
href="%s">%s</a></td>' % (view_url,
rulespec["title"]))
- display_varname = ':' in varname and '%s["%s"]' %
tuple(varname.split(":")) or varname
- if not config.wato_hide_varnames:
- html.write('<td
class=varname><tt>%s</tt></td>' % display_varname)
- html.write('<td class=number>')
+ html.write('<div class=ruleset><div class=text>')
+ html.write('<a class=title><a
href="%s">%s</a>' % (view_url, rulespec["title"]))
+ html.write('<span class=dots>%s</span></div>' %
("." * 100))
+ # if not config.wato_hide_varnames:
+ # display_varname = ':' in varname and
'%s["%s"]' % tuple(varname.split(":")) or varname
+ # html.write('<td
class=varname><tt>%s</tt></td>' % display_varname)
if num_local_rules:
if only_host:
title = _("There are %d rules explicitely listing this
host." % num_local_rules)
@@ -9261,13 +9240,13 @@ def mode_rulesets(phase):
title = _("There are %d rules defined in the current
folder." % num_local_rules)
html.write('<img title="%s" align=absmiddle class=icon
src="images/icon_localrule.png"> ' %
title)
- html.write("%d</td>" % num_rules)
- html.write('</tr>')
+ html.write('<div class=rulecount
title="%s">%d</div>' % (title, num_rules))
+ html.write('</div>')
if something_shown:
- html.write("</table>")
- if do_folding:
- html.end_foldable_container()
+ html.write("</td></tr></table>")
+ # if do_folding:
+ # html.end_foldable_container()
else:
if only_host:
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 60206b6..e26e47e 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -968,7 +968,7 @@ register_rule(group,
register_rule(group,
"usewalk_hosts",
- title = _("Hosts that simulate SNMP by using a stored SNMP walk"),
+ title = _("Simulating SNMP by using a stored SNMP walk"),
help = _("This ruleset helps in test and development. You can create stored SNMP
"
"walks on the command line with cmk --snmpwalk HOSTNAME. A host that
"
"is configured with this ruleset will then use the information from
that "
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 1cedfdf..4893395 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1089,7 +1089,7 @@ checkgroups.append((
checkgroups.append((
subgroup_hardware,
"hw_errors",
- _("Simple checks for BIOS/Hardware errors without parameters"),
+ _("Simple checks for BIOS/Hardware errors"),
None,
None, None))
@@ -1190,7 +1190,7 @@ checkgroups.append((
checkgroups.append((
subgroup_environment,
"room_temperature",
- _("Room temperature (e.g. external thermal sensors in datacenters)"),
+ _("Room temperature (external thermal sensors)"),
Tuple(
help = _("Temperature levels for external thermometers that are used "
"for monitoring the temperature of a datacenter. An example "
@@ -1207,7 +1207,7 @@ checkgroups.append((
checkgroups.append((
subgroup_environment,
"hw_temperature",
- _("Hardware temperature (CPU, Memory, Mainboard, etc.)"),
+ _("Hardware temperature (CPU, Memory, etc.)"),
Tuple(
help = _("Temperature levels for internal sensors found in many appliances,
"
"switches, routers, mainboards and other devices. "),
@@ -1235,7 +1235,7 @@ checkgroups.append((
checkgroups.append((
subgroup_ps,
"wmic_process",
- _("Memory and CPU consumption of processes on Windows (via WMI)"),
+ _("Memory and CPU of processes on Windows"),
Tuple(
elements = [
TextAscii(