Module: check_mk
Branch: master
Commit: 7963b11562b59bbb29d1c7fb62d29aad816a42c9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7963b11562b59b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 17 15:25:41 2012 +0200
WATO: show host context in rule editor
Also remove obsolete option for showing only rules with
local context. Was never really useful.
---
.bugs/677 | 7 +++++--
web/htdocs/pages.css | 1 +
web/htdocs/wato.css | 1 +
web/htdocs/wato.py | 41 +++++++++++++++++++++++++----------------
4 files changed, 32 insertions(+), 18 deletions(-)
diff --git a/.bugs/677 b/.bugs/677
index 1ddddd1..6e909e5 100644
--- a/.bugs/677
+++ b/.bugs/677
@@ -1,9 +1,12 @@
Title: WATO rule editor does not show host context
Component: wato
-State: open
+Class: bug
+State: done
Date: 2012-04-17 14:53:36
Targetversion: 1.2.0
-Class: bug
The main rule menu keeps the host context, but does not show
it anywhere.
+
+2012-04-17 15:25:03: changed state open -> done
+Should work now
diff --git a/web/htdocs/pages.css b/web/htdocs/pages.css
index adff9bd..3b0816d 100644
--- a/web/htdocs/pages.css
+++ b/web/htdocs/pages.css
@@ -304,6 +304,7 @@ tr.groupheader td {
margin: 0px;
padding-top: 2px;
font-weight: bold;
+ color: white;
}
tr.groupheader a {
color: #000;
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 959198b..40ecee5 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -439,6 +439,7 @@ table.validationerror img {
.wato table.configmodules {
empty-cells: show;
border-spacing: 8px;
+ margin-left: -8px;
}
.wato table.configmodules td {
background-image: url("images/form_background.png");
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 65e50d0..38b6a95 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1925,7 +1925,7 @@ def mode_inventory(phase, firsttime):
html.context_button(_("Folder"),
make_link([("mode", "folder")]),
"back")
html.context_button(_("Host properties"),
- make_link([("mode", "edithost"),
("host", hostname)]), "back")
+ make_link([("mode", "edithost"),
("host", hostname)]), "host")
html.context_button(_("Full Scan"), html.makeuri([("_scan",
"yes")]))
elif phase == "action":
@@ -8504,13 +8504,20 @@ def change_host_tags_in_rules(folder, operations, mode):
def mode_ruleeditor(phase):
only_host = html.var("host", "")
- only_local = html.var("local")
+ only_local = "" # html.var("local")
if phase == "title":
- return _("Configuration of Hosts and Services (Ruleeditor)")
+ if only_host:
+ return _("Rules effective on host ") + only_host
+ else:
+ return _("Configuration of Hosts and Services (Ruleeditor)")
elif phase == "buttons":
global_buttons()
+ if only_host:
+ html.context_button(only_host,
+ make_link([("mode", "edithost"), ("host",
only_host)]), "host")
+
return
elif phase == "action":
@@ -8518,6 +8525,8 @@ def mode_ruleeditor(phase):
if not only_host:
render_folder_path(keepvarnames = ["mode", "local"])
+ else:
+ html.write("<h3>%s: %s</h3>" % (_("Host"),
only_host))
# Group names are separated with "/" into main group and optional subgroup
groupnames = list(set([ gn.split("/")[0] for gn in g_rulespec_groups.keys()
]))
@@ -8537,7 +8546,7 @@ def mode_rulesets(phase):
group = html.var("group") # obligatory
title, help = g_rulegroups.get(group, (group, None))
only_host = html.var("host", "")
- only_local = html.var("local")
+ only_local = "" # html.var("local")
if phase == "title":
if only_host:
@@ -8550,7 +8559,7 @@ def mode_rulesets(phase):
home_button()
html.context_button(_("All Rulesets"),
make_link([("mode", "ruleeditor"), ("host", only_host)]),
"back")
html.context_button(only_host,
- make_link([("mode", "edithost"), ("host",
only_host)]), "back")
+ make_link([("mode", "edithost"), ("host",
only_host)]), "host")
else:
global_buttons()
html.context_button(_("All Rulesets"),
make_link([("mode", "ruleeditor")]), "back")
@@ -8567,17 +8576,17 @@ 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>")
+ # 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