Module: check_mk
Branch: master
Commit: 18047e65fa54d31d70af24a3a5cb820c91c1b6a0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=18047e65fa54d3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 25 12:15:47 2012 +0100
Reverse order of Condition, Value and General options in rule editor
---
ChangeLog | 1 +
web/htdocs/wato.py | 56 ++++++++++++++++++------------------
web/plugins/wato/active_checks.py | 4 +-
3 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index aef65b6..b44c6c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -77,6 +77,7 @@
* The rules formular now uses POST as transaction method
* Modularized the authentication and user management code
* Default config: add contact group 'all' and put all hosts into it
+ * Reverse order of Condition, Value and General options in rule editor
Event Console:
* FIX: fix exception in rules that use facility local7
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 548c510..1bc25e3 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9382,7 +9382,7 @@ def change_host_tags_in_rules(folder, operations, mode):
# '----------------------------------------------------------------------'
vs_rule_options = Dictionary(
- title = _("General options"),
+ title = _("Additional options"),
optional_keys = False,
render = "form",
elements = [
@@ -9397,7 +9397,7 @@ vs_rule_options = Dictionary(
),
( "docu_url",
TextAscii(
- title = _("Docu-URL"),
+ title = _("Documentation-URL"),
help = _("An optional URL pointing to documentation or any other page.
This will be displayed "
"as an icon <img class=icon
src='images/button_url_lo.png'> and open a new page when clicked. "
"You can use either global URLs (beginning with
<tt>http://</tt>), absolute local urls "
@@ -10271,7 +10271,7 @@ def mode_edit_rule(phase, new = False):
if phase == "action":
if html.check_transaction():
- # General options
+ # Additional options
rule_options = vs_rule_options.from_html_vars("options")
vs_rule_options.validate_value(rule_options, "options")
@@ -10322,34 +10322,10 @@ def mode_edit_rule(phase, new = False):
return ("edit_ruleset", _("%s rule in ruleset '%s' in
folder %s") %
(new and _("Created new") or
_("Edited"), rulespec["title"], new_rule_folder["title"]))
- html.help(rulespec["help"])
+ html.write("<div class=info>" + rulespec["help"] +
"</div>")
html.begin_form("rule_editor", method="POST")
- # Rule Options
- vs_rule_options.render_input("options", rule_options)
-
- # Value
- forms.header(_("Value"))
- if valuespec:
- value = rule[0]
- forms.section()
- try:
- valuespec.validate_datatype(value, "ve")
- valuespec.render_input("ve", value)
- except:
- if config.debug:
- raise
- valuespec.render_input("ve", valuespec.default_value())
-
- valuespec.set_focus("ve")
- else:
- forms.section("")
- for posneg, img in [ ("positive", "yes"),
("negative", "no")]:
- val = img == "yes"
- html.write('<img class=ruleyesno align=top
src="images/rule_%s.png"> ' % img)
- html.radiobutton("value", img, value == val, _("Make the
outcome of the ruleset <b>%s</b><br>") % posneg)
-
# Conditions
forms.header(_("Conditions"))
@@ -10438,6 +10414,30 @@ def mode_edit_rule(phase, new = False):
"For example C:\\\\tmp\\\\message.log"))
html.write("</div>")
+ # Value
+ forms.header(_("Value"))
+ if valuespec:
+ value = rule[0]
+ forms.section()
+ try:
+ valuespec.validate_datatype(value, "ve")
+ valuespec.render_input("ve", value)
+ except:
+ if config.debug:
+ raise
+ valuespec.render_input("ve", valuespec.default_value())
+
+ valuespec.set_focus("ve")
+ else:
+ forms.section("")
+ for posneg, img in [ ("positive", "yes"),
("negative", "no")]:
+ val = img == "yes"
+ html.write('<img class=ruleyesno align=top
src="images/rule_%s.png"> ' % img)
+ html.radiobutton("value", img, value == val, _("Make the
outcome of the ruleset <b>%s</b><br>") % posneg)
+
+ # Addiitonal rule options
+ vs_rule_options.render_input("options", rule_options)
+
forms.end()
html.button("save", _("Save"))
html.hidden_fields()
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index 5bba69a..676d3ce 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -33,8 +33,8 @@ register_rule(group,
"active_checks:dns",
Tuple(
title = _("Check DNS service"),
- help = _("Check optain an IP address for a host or domain"
- "It uses <tt>check_dns</tt> from standard
plugins."),
+ help = _("Check the resultion of a hostname into an IP address by a DNS
server. "
+ "This check uses <tt>check_dns</tt> from the standard
Nagios plugins."),
elements = [
TextAscii(title = _("Hostname"), allow_empty = False,
help = _('The name or address you want to query')),