Module: check_mk
Branch: master
Commit: e354584d1b994a39fe125fee4ea675de9dc54307
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e354584d1b994a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 29 17:59:49 2011 +0200
WATO: check for duplicate timeperiod names
---
web/htdocs/wato.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b000a14..c96dfe7 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5165,6 +5165,10 @@ def mode_edit_timeperiod(phase):
raise MKUserError("name", _("Please specify a name of the new timeperiod."))
if not re.match("^[-a-z0-9A-Z_]*$", name):
raise MKUserError("name", _("Invalid timeperiod name. Only the characters a-z, A-Z, 0-9, _ and - are allowed."))
+ if name in timeperiods:
+ raise MKUserError("name", _("This name is already being used by another timeperiod."))
+ if name == "7X24":
+ raise MKUserError("name", _("The time period name 7X24 cannot be used. It is always autmatically defined."))
timeperiods[name] = timeperiod
log_pending(None, "edit-timeperiods", _("Created new time period %s" % name))
else:
@@ -5183,6 +5187,7 @@ def mode_edit_timeperiod(phase):
html.write("</td><td class=content>")
if new:
html.text_input("name")
+ html.set_focus("name")
else:
html.write(name)
html.write("</td></tr>")
@@ -5196,6 +5201,8 @@ def mode_edit_timeperiod(phase):
html.write(_("Alias") + "<br><i>" + _("A description of the timeperiod</i>"))
html.write("</td><td class=content>")
html.text_input("alias", alias, size = 50)
+ if not new:
+ html.set_focus("alias")
html.write("</td></tr>")
# Week days
Module: check_mk
Branch: master
Commit: 209496b8b52fc387af3ffba734856a9d3bb9afd1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=209496b8b52fc3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 29 11:44:38 2011 +0200
WATO: rule editor: add titles to host tags
---
web/htdocs/js/wato.js | 9 +++++++
web/htdocs/wato.py | 63 +++++++++++++++++++++++++++++++-----------------
2 files changed, 50 insertions(+), 22 deletions(-)
diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js
index f10930f..0480f9b 100644
--- a/web/htdocs/js/wato.js
+++ b/web/htdocs/js/wato.js
@@ -84,6 +84,15 @@ function wato_toggle_dropdown(oDropdown, divid) {
oDiv = null;
}
+function wato_toggle_dropdownn(oDropdown, divid) {
+ var oDiv = document.getElementById(divid);
+ if (oDropdown.value == "ignore")
+ oDiv.style.display = "none";
+ else
+ oDiv.style.display = "";
+ oDiv = null;
+}
+
// ----------------------------------------------------------------------------
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b0827fe..7b6f936 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -4432,9 +4432,9 @@ class ElementSelection(ValueSpec):
self.load_elements()
if len(self._elements) == 0:
raise MKUserError(varprefix,
- _("You cannot save this rule. There are not defined any elements for this selection yet." % self._what))
+ _("You cannot save this rule. There are not defined any elements for this selection yet."))
if value not in self._elements:
- raise MKUserError(varprefix, _("%s is not an existing element in this selection.") % (value, self._what))
+ raise MKUserError(varprefix, _("%s is not an existing element in this selection.") % (value,))
def validate_datatype(self, value, varprefix):
if type(value) != str:
@@ -7830,29 +7830,48 @@ def mode_edit_rule(phase):
html.write(_("You have not configured any host tags. If you work with rules "
"you should better do so and add a <tt>wato_host_tags = ..</tt> "
"to your <tt>multisite.mk</tt>. You will find an example there."))
- for id, title, tags in config.wato_host_tags:
- default_tag = None
- ignore = True
- for t in tag_specs:
- if t[0] == '!':
- n = True
- t = t[1:]
+ else:
+ html.write("<table>")
+ for id, title, tags in config.wato_host_tags:
+ html.write("<tr><td>%s: </td>" % title)
+ default_tag = None
+ ignore = True
+ for t in tag_specs:
+ if t[0] == '!':
+ n = True
+ t = t[1:]
+ else:
+ n = False
+ if t in [ x[0] for x in tags]:
+ ignore = False
+ negate = n
+ if ignore:
+ deflt = "ignore"
+ elif negate:
+ deflt = "isnot"
+ else:
+ deflt = "is"
+
+ html.write("<td>")
+ html.select("tag_" + id, [
+ ("ignore", _("ignore")),
+ ("is", _("is")),
+ ("isnot", _("isnot"))], deflt,
+ onchange="wato_toggle_dropdownn(this, 'tag_sel_%s');" % id)
+ html.write("</td><td>")
+ if html.form_submitted():
+ div_is_open = html.var("tag_" + id) != "ignore"
else:
- n = False
- if t in [ x[0] for x in tags]:
- ignore = False
- negate = n
-
- html.radiobutton("tag_" + id, "ignore", ignore, _("ignore"))
- html.write(" ")
- html.radiobutton("tag_" + id, "is", not ignore and not negate, _("is"))
- html.write(" ")
- html.radiobutton("tag_" + id, "isnot", not ignore and negate, _("is not"))
- html.write(" ")
- html.select("tagvalue_" + id, [t[0:2] for t in tags if t[0] != None], deflt=default_tag)
- html.write("<br>")
+ div_is_open = deflt != "ignore"
+ html.write('<div id="tag_sel_%s" style="white-space: nowrap; %s">' % (
+ id, not div_is_open and "display: none;" or ""))
+ html.select("tagvalue_" + id, [t[0:2] for t in tags if t[0] != None], deflt=default_tag)
+ html.write("</div>")
+ html.write("</td></tr>")
+ html.write("</table>")
html.write("</td></tr>")
+
# Explicit hosts / ALL_HOSTS
html.write("<tr><td class=legend>")
html.write(_("Explicit hosts"))
Module: check_mk
Branch: master
Commit: e25e677bce3ac4f008757e8d798ee37ac60d0e90
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e25e677bce3ac4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 29 11:04:47 2011 +0200
Fixed ChangeLog, moved message to 1.1.12p1
---
ChangeLog | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 16aec47..7f09a6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,8 +26,6 @@
Multisite:
* FIX: Fixed encoding problem when opening dashboard
- * FIX: Added id parameter to render_statistics() method to allow more than
- one pie dashlet for host/service stats
1.1.12p1:
@@ -35,6 +33,8 @@
* FIX: mk_oracle now also detects XE databases
* FIX: printer_alerts: handle 0-entries of Brother printers
* FIX: printer_supply: fix Perf-O-Meter if no max known
+ * FIX: Added id parameter to render_statistics() method to allow more than
+ one pie dashlet for host/service stats
Multisite:
* FIX: finally fixed long-wanted "NagStaMon create hundreds
Module: check_mk
Branch: master
Commit: 22caca768a5ce6b4e0bcbe63351cf11b54d799de
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=22caca768a5ce6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 28 14:25:09 2011 +0200
Updated bug entries #0400, #0405
---
.bugs/400 | 11 ++++++++---
.bugs/405 | 10 +++++++---
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/.bugs/400 b/.bugs/400
index 3bb55e5..298453f 100644
--- a/.bugs/400
+++ b/.bugs/400
@@ -1,11 +1,12 @@
Title: Service Hardstate-Filter conflicts with Hoststate filter
Component: multisite
-Benefit: 2
-State: open
Cost: 2
Date: 2011-10-27 15:00:16
-Targetversion: 1.1.12
+State: done
Class: bug
+Benefit: 2
+Fun: 0
+Targetversion: 1.1.12
The service hard state filter uses the HTML variables hst0, hst1, ...
just like the host state filter. Change this to hdst0, hdst1, ....
@@ -13,3 +14,7 @@ Otherwise the filter will also have the same setting as the
host state filter.
This might affect builtin views. Check them...
+
+2011-10-28 14:25:06: changed state open -> done
+The variables for the hard state filters are now
+prefixed with hd instead of h.
diff --git a/.bugs/405 b/.bugs/405
index 85518f2..83c50c4 100644
--- a/.bugs/405
+++ b/.bugs/405
@@ -1,11 +1,15 @@
Title: Add filters for hard service state
Component: multisite
-Benefit: 1
-State: open
Cost: 1
Date: 2011-10-27 18:56:40
-Targetversion: 1.2.0
+State: done
Class: todo
+Benefit: 1
+Fun: 0
+Targetversion: 1.2.0
Do we have filters for the hard service state? At least in
the service search they should be visible. Same for hosts.
+
+2011-10-28 14:24:45: changed state open -> done
+Hard state filter added to search and problems views.