Module: check_mk
Branch: master
Commit: 63fe181e759e044128ef596ec11fcf7a6ed9788f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=63fe181e759e04…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 17 15:35:00 2017 +0100
4379 FIX Don't show delete event icon in event history views
This icon makes only sense in regular Event Console views to delete
an open event.
Change-Id: I380ab177ac3c83f2fad5ae00b8cc4855ae516ca1
---
.werks/4379 | 11 +++++++++++
web/plugins/views/mkeventd.py | 24 +++++++++++++++++++-----
2 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/.werks/4379 b/.werks/4379
new file mode 100644
index 0000000..7823ce8
--- /dev/null
+++ b/.werks/4379
@@ -0,0 +1,11 @@
+Title: Don't show delete event icon in event history views
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.5.0i1
+Date: 1487342019
+
+This icon makes only sense in regular Event Console views to delete
+an open event.
diff --git a/web/plugins/views/mkeventd.py b/web/plugins/views/mkeventd.py
index 5119223..2921683 100644
--- a/web/plugins/views/mkeventd.py
+++ b/web/plugins/views/mkeventd.py
@@ -279,6 +279,7 @@ if mkeventd_enabled:
def render_event_phase_icons(row):
phase = row["event_phase"]
+
if phase == "ack":
title = _("This event has been acknowledged.")
elif phase == "counting":
@@ -287,6 +288,7 @@ if mkeventd_enabled:
title = _("The action of this event is still delayed in the hope of a
cancelling event.")
else:
return ''
+
return html.render_icon(phase, help=title)
def render_delete_event_icons(row):
@@ -330,9 +332,12 @@ if mkeventd_enabled:
else:
return ''
- def paint_event_icons(row):
- htmlcode = render_event_phase_icons(row)
- htmlcode += render_delete_event_icons(row)
+ def paint_event_icons(row, history=False):
+ htmlcode = render_event_phase_icons(row)
+
+ if not history:
+ htmlcode += render_delete_event_icons(row)
+
if htmlcode:
return "icons", htmlcode
else:
@@ -347,6 +352,15 @@ if mkeventd_enabled:
}
+ multisite_painters["event_history_icons"] = {
+ "title" : _("Event Icons"),
+ "short" : _("Icons"),
+ "printable" : False,
+ "columns" : [ "event_phase" ],
+ "paint" : lambda row: paint_event_icons(row, history=True),
+ }
+
+
def paint_event_contact_groups(row):
cgs = row.get("event_contact_groups")
if cgs == None:
@@ -878,7 +892,7 @@ if mkeventd_enabled:
('event_id', 'ec_historyentry', ''),
('history_who', None, ''),
('history_what', None, ''),
- ('event_icons', None, ''),
+ ('event_history_icons', None, ''),
('event_state', None, ''),
('event_phase', None, ''),
('event_sl', None, ''),
@@ -953,7 +967,7 @@ if mkeventd_enabled:
('event_first', None, ''),
('event_last', None, ''),
('event_id', 'ec_history_of_event', ''),
- ('event_icons', None, ''),
+ ('event_history_icons', None, ''),
('event_count', None, ''),
('event_sl', None, ''),
('event_contact', None, ''),