Module: check_mk
Branch: master
Commit: dc801547783c18147fd769771f60a36c0f58175a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc801547783c18…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 26 09:15:06 2017 +0200
5043 RBN: Improved displaying of notitification context in analyse notification mode
There is a new icon for toggling the notification context. Once you click on this icon
the notification context will be displayed below the notification you clicked the icon
for.
Change-Id: Ie6c20fc14c4458b7828f3eb770019e81171affe6
---
.bugs/2939 | 7 +++++--
.werks/5043 | 12 ++++++++++++
web/htdocs/images/button_toggle_context.png | Bin 0 -> 2598 bytes
web/htdocs/js/checkmk.js | 9 +++++++++
web/htdocs/pages.css | 17 ++++++++++++-----
web/htdocs/wato.css | 12 ++++++++++++
web/htdocs/wato.py | 28 ++++++++++++++++++++++++++--
7 files changed, 76 insertions(+), 9 deletions(-)
diff --git a/.bugs/2939 b/.bugs/2939
index 9c20201..f9230ff 100644
--- a/.bugs/2939
+++ b/.bugs/2939
@@ -1,9 +1,9 @@
Title: Export WATO folder permissions breaks activate changes in distributed setups
Component: wato
-State: open
+Class: bug
+State: done
Date: 2017-07-18 18:46:33
Targetversion: 1.2.8
-Class: bug
If the option Export WATO permissions is activated and around 1400 users are used in
user management, it will break activation of changes. It will end in a apache process
@@ -12,3 +12,6 @@ which is running on full power to calculate all the settings for all
users.
This option should be blocked if too much users exists or should be better optimized for
higer user amounts.
Workaround: Deactivte the option Export WATO permissions
+
+2017-07-25 17:59:14: changed state open -> done
+Feature has been removed.
diff --git a/.werks/5043 b/.werks/5043
new file mode 100644
index 0000000..aaeb4eb
--- /dev/null
+++ b/.werks/5043
@@ -0,0 +1,12 @@
+Title: RBN: Improved displaying of notitification context in analyse notification mode
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1501052799
+Class: feature
+
+There is a new icon for toggling the notification context. Once you click on this icon
+the notification context will be displayed below the notification you clicked the icon
+for.
diff --git a/web/htdocs/images/button_toggle_context.png
b/web/htdocs/images/button_toggle_context.png
new file mode 100644
index 0000000..e09387c
Binary files /dev/null and b/web/htdocs/images/button_toggle_context.png differ
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index cdbc417..6de3b29 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -231,6 +231,15 @@ function mouse_offset_to_middle(obj, event){
}
}
+function toggle_notification_context(id)
+{
+ var obj = document.getElementById(id);
+ if (has_class(obj, "hidden"))
+ remove_class(obj, "hidden");
+ else
+ add_class(obj, "hidden");
+}
+
//#.
//# .-Events-------------------------------------------------------------.
//# | _____ _ |
diff --git a/web/htdocs/pages.css b/web/htdocs/pages.css
index 51f003a..0c8b5fe 100644
--- a/web/htdocs/pages.css
+++ b/web/htdocs/pages.css
@@ -1345,7 +1345,8 @@ a.element_dragger:hover {
}
td.invtree table,
-td.agent_config table.rulesets table {
+td.agent_config table.rulesets table,
+table.data tr.notification_context table {
border-collapse: collapse;
border: 0.5px solid black;
box-shadow: 0.5px 0.5px 1px #ccc;
@@ -1357,7 +1358,9 @@ td.agent_config table.rulesets table td,
td.invtree table th,
td.agent_config table.rulesets table td.title,
table.data.single tr.data td.invtree table td,
-table.data.single tr.data td.invtree table th
+table.data.single tr.data td.invtree table th,
+table.data tr.notification_context table td,
+table.data tr.notification_context table th
{
border: 1px solid #888;
padding: 1px 5px;
@@ -1365,15 +1368,19 @@ table.data.single tr.data td.invtree table th
}
td.invtree table th,
-td.agent_config table.rulesets table td.title {
+td.agent_config table.rulesets table td.title,
+table.data tr.notification_context table th {
text-align: left;
}
+
td.invtree table td,
-td.agent_config table.rulesets table td {
+td.agent_config table.rulesets table td,
+table.data tr.notification_context table td {
background-color: #fff;
}
-td.agent_config table.rulesets table td.title {
+td.agent_config table.rulesets table td.title,
+table.data tr.notification_context table th {
background-color: #999;
color: #fff;
}
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index c9d2274..c8be8d7 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -1004,6 +1004,18 @@ div.varname {
width: 280px;
}
+.wato table.data tr.notification_context.hidden {
+ display: none;
+}
+
+table.data tr.notification_context table {
+ margin: 5px;
+}
+
+table.data tr.notification_context table th,
+table.data tr.notification_context table td {
+ font-family: monospace;
+}
/*-------------------------------------------------------------------------.
| ____ |
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4f16c2a..2fb53c7 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8470,10 +8470,15 @@ def mode_notifications(phase):
table.cell(" ", css="buttons")
analyse_url = html.makeuri([("analyse", str(nr))])
- tooltip = "".join(("%s: %s\n" % e) for e in
sorted(context.items()))
- html.icon_button(analyse_url, _("Analyze ruleset with this
notification:\n%s") % tooltip, "analyze")
+ html.icon_button(analyse_url, _("Analyze ruleset with this
notification"), "analyze")
+
+ html.icon_button(None, _("Show / hide notification context"),
+ "toggle_context",
+
onclick="toggle_notification_context('notification_context_%d')" % nr)
+
replay_url = html.makeactionuri([("_replay", str(nr))])
html.icon_button(replay_url, _("Replay this notification, send it
again!"), "replay")
+
if html.var("analyse") and nr ==
int(html.var("analyse")):
html.icon(_("You are analysing this notification"),
"rulematch")
@@ -8516,6 +8521,25 @@ def mode_notifications(phase):
table.cell(_("Service"), context.get("SERVICEDESC",
""))
output = context.get("SERVICEOUTPUT",
context.get("HOSTOUTPUT"))
table.cell(_("Plugin output"), format_plugin_output(output))
+
+ # Add toggleable notitication context
+ table.row(class_="notification_context hidden",
+ id_="notification_context_%d" % nr)
+ table.cell(colspan=8)
+
+ html.open_table()
+ for nr, (key, val) in enumerate(sorted(context.items())):
+ if nr % 2 == 0:
+ if nr != 0:
+ html.close_tr()
+ html.open_tr()
+ html.th(key)
+ html.td(val)
+ html.close_table()
+
+ # This dummy row is needed for not destroying the odd/even row
highlighting
+ table.row(class_="notification_context hidden")
+
table.end()
# Do analysis