Module: check_mk
Branch: master
Commit: e702711bfefc960e13afcf8aa866d596edd15d21
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e702711bfefc96…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 25 18:36:05 2012 +0100
Views: delay refresh after option dial change
This allows to faster toggle through all available options
without intervening refreshes
---
web/htdocs/js/checkmk.js | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 015a91c..212e3ee 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -738,7 +738,7 @@ function toggleRefreshFooter(s) {
// timer to the given interval. If the parameter is 0 the reload is stopped.
// When called with two parmeters the 2nd one is used as new url.
function setReload(secs, url) {
- if(typeof url === 'undefined')
+ if (typeof url === 'undefined')
url = '';
if (gReloadTimer) {
@@ -1716,7 +1716,13 @@ function view_dial_option(oDiv, viewname, option, choices) {
"&option=" + option + "&value=" + new_choice[0]);
if (option == "refresh")
setReload(new_choice[0]);
- handleReload('');
+ else {
+ if (gReloadTimer)
+ clearTimeout(gReloadTimer);
+ if (gReloadTime)
+ gReloadTimer = setTimeout("handleReload('')", 400.0);
+ }
+ // handleReload('');
}
// way ranges from -10 to 10 means centered (normal place)
function turn_dial(option, text, way) {
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')),
Module: check_mk
Branch: master
Commit: 17ac1741006370922b9ce4c33e3d6ccdb60a1515
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17ac1741006370…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 25 12:01:50 2012 +0100
WATO: remove trivial docu_url when saving
---
web/htdocs/wato.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 89189e5..cf5f598 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10086,16 +10086,20 @@ def construct_rule(ruleset, value, tag_specs, host_list, item_list, rule_options
if item_list != None:
rule.append(item_list)
- # Append rule options, but only if they are not trivial
+ # Append rule options, but only if they are not trivial. That way we
+ # keep as close as possible to the original Check_MK in rules.mk so that
+ # command line users will feel at home...
ro = {}
if rule_options.get("disabled"):
ro["disabled"] = True
if rule_options.get("comment"):
ro["comment"] = rule_options["comment"]
+ if rule_options.get("docu_url"):
+ ro["docu_url"] = rule_options["docu_url"]
# Preserve other keys that we do not know of
for k,v in rule_options.items():
- if k not in [ "disabled", "comment"] :
+ if k not in [ "disabled", "comment", "docu_url"]:
ro[k] = v
if ro:
rule.append(ro)