Module: check_mk
Branch: master
Commit: d9894b8ee672ac77f1f5a7cc9a8d440669bbf4fb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d9894b8ee672ac…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 2 11:00:44 2014 +0100
#1558 Better visualize manually changed notification enable/disable
---
.werks/1558 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/images/icon_ndisabled.gif | Bin 1106 -> 0 bytes
web/htdocs/images/icon_notif_disabled.png | Bin 0 -> 4575 bytes
web/htdocs/images/icon_notif_enabled.png | Bin 0 -> 4868 bytes
web/htdocs/images/icon_notif_man_disabled.png | Bin 0 -> 5161 bytes
web/plugins/icons/builtin.py | 15 ++++++++++++---
web/plugins/views/commands.py | 8 ++++----
8 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/.werks/1558 b/.werks/1558
new file mode 100644
index 0000000..1e06907
--- /dev/null
+++ b/.werks/1558
@@ -0,0 +1,9 @@
+Title: Better visualize manually changed notification enable/disable
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417514424
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 447cec7..44c22c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,6 +60,7 @@
NOTE: Please refer to the migration notes!
* 1500 SEC: Preventing livestatus injections in different places...
* 1530 Dashboard: Host/service statistics dashlets now deal with the context...
+ * 1558 Better visualize manually changed notification enable/disable
* 1164 FIX: Fixed links from servicegroup overviews to single servicegroups
* 1166 FIX: Also prevting stylesheet update issues during version updates (just like
for JS files)
* 1481 FIX: Fix broken layout of Host-, Service- and Contactgroup filters
diff --git a/web/htdocs/images/icon_ndisabled.gif b/web/htdocs/images/icon_ndisabled.gif
deleted file mode 100644
index f515c68..0000000
Binary files a/web/htdocs/images/icon_ndisabled.gif and /dev/null differ
diff --git a/web/htdocs/images/icon_notif_disabled.png
b/web/htdocs/images/icon_notif_disabled.png
new file mode 100644
index 0000000..f4955f9
Binary files /dev/null and b/web/htdocs/images/icon_notif_disabled.png differ
diff --git a/web/htdocs/images/icon_notif_enabled.png
b/web/htdocs/images/icon_notif_enabled.png
new file mode 100644
index 0000000..4dd2492
Binary files /dev/null and b/web/htdocs/images/icon_notif_enabled.png differ
diff --git a/web/htdocs/images/icon_notif_man_disabled.png
b/web/htdocs/images/icon_notif_man_disabled.png
new file mode 100644
index 0000000..853f077
Binary files /dev/null and b/web/htdocs/images/icon_notif_man_disabled.png differ
diff --git a/web/plugins/icons/builtin.py b/web/plugins/icons/builtin.py
index affc9ab..304598d 100644
--- a/web/plugins/icons/builtin.py
+++ b/web/plugins/icons/builtin.py
@@ -402,12 +402,21 @@ multisite_icons.append({
def paint_notifications(what, row, tags, custom_vars):
# Notifications disabled
- if not row[what + "_notifications_enabled"]:
- return '<img class=icon title="%s"
src="images/icon_ndisabled.gif">' % \
+ enabled = row[what + "_notifications_enabled"]
+ modified = "notifications_enabled" in row[what +
"_modified_attributes_list"]
+ if modified and enabled:
+ return '<img class=icon title="%s"
src="images/icon_notif_enabled.png">' % \
+ _('Notifications are manually enabled for this %s') %
what
+ elif modified and not enabled:
+ return '<img class=icon title="%s"
src="images/icon_notif_man_disabled.png">' % \
+ _('Notifications are manually disabled for this %s') %
what
+ elif not enabled:
+ return '<img class=icon title="%s"
src="images/icon_notif_disabled.png">' % \
_('Notifications are disabled for this %s') % what
+
multisite_icons.append({
- 'columns': [ 'notifications_enabled' ],
+ 'columns': [ 'modified_attributes_list',
'notifications_enabled' ],
'paint': paint_notifications,
})
diff --git a/web/plugins/views/commands.py b/web/plugins/views/commands.py
index 493500f..65dc3fc 100644
--- a/web/plugins/views/commands.py
+++ b/web/plugins/views/commands.py
@@ -146,8 +146,8 @@ multisite_commands.append({
# CLEAR MODIFIED ATTRIBUTES
config.declare_permission("action.clearmodattr",
- _("Clear modified attributes"),
- _("Remove the information that an attribute (like check enabling) has been
changed"),
+ _("Reset modified attributes"),
+ _("Reset all manually modified attributes of a host or service (like
disabled notifications)"),
[ "admin" ])
multisite_commands.append({
@@ -155,11 +155,11 @@ multisite_commands.append({
"permission" : "action.clearmodattr",
"title" : _("Modified attributes"),
"render" : lambda: \
- html.button("_clear_modattr", _('Clear information about modified
attributes')),
+ html.button("_clear_modattr", _('Clear modified attributes')),
"action" : lambda cmdtag, spec, row: (
html.var("_clear_modattr") and (
"CHANGE_" + cmdtag + "_MODATTR;%s;0" % spec,
- _("<b>clear the information about modified attributes</b>
of"))),
+ _("<b>clear the modified attributes</b> of"))),
})
# FAKE CHECKS