Module: check_mk
Branch: master
Commit: 4ece7f9c2104bcee29f452fbf936d0a36812ff51
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4ece7f9c2104bc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 17 16:37:30 2015 +0100
#2768 SHowing number of unacknowledged incompatible changes in sidebar header
---
.werks/2768 | 9 +++++++++
ChangeLog | 3 ++-
web/htdocs/sidebar.css | 12 ++++++++++++
web/htdocs/sidebar.py | 24 +++++++++++++++---------
web/htdocs/werks.py | 6 +++++-
5 files changed, 43 insertions(+), 11 deletions(-)
diff --git a/.werks/2768 b/.werks/2768
new file mode 100644
index 0000000..2b53e81
--- /dev/null
+++ b/.werks/2768
@@ -0,0 +1,9 @@
+Title: SHowing number of unacknowledged incompatible changes in sidebar header
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447774629
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 9e6912a..5228b9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -87,6 +87,7 @@
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
* 2713 New bookmark lists, strucutrable and shareable between users...
+ * 2768 SHowing number of unacknowledged incompatible changes in sidebar header
* 2680 FIX: LDAP: Fixed exception when syncing groups using configurations from
previous versions...
* 2435 FIX: New graphing system: fixed broken graphs for iSCSI checks...
* 2696 FIX: Fixed broken perfometer for update checks
@@ -120,7 +121,7 @@
* 2760 FIX: Fixed case where "activate changes" was not commiting the
pending changes entries correctly...
* 2767 FIX: Fixed broken user list when non unicode mail addresses are loaded
* 2791 FIX: Service parameter overview: Fixed problem displaying incorrect rule for
classical checks...
- * 2793 FIX: Prevent python unicode warnings for services with umlauts...
+ * 2793 FIX: Parameter Overview: Prevent python unicode warnings for services with
umlauts...
Notifications:
* 2728 FIX: Removed debug notification script (was not executable)...
diff --git a/web/htdocs/sidebar.css b/web/htdocs/sidebar.css
index b7f96dd..fb029f5 100644
--- a/web/htdocs/sidebar.css
+++ b/web/htdocs/sidebar.css
@@ -113,6 +113,18 @@ body.side.screenshotmode {
text-decoration: underline;
}
+#side_version span.unack_werks {
+ z-index: 15;
+ cursor: pointer;
+ background-color: #f00;
+ color: #fff;
+ padding: 2px;
+ border-radius: 10px;
+ position: absolute;
+ right: -12px;
+ top: 5px;
+}
+
/* Scrolling part with snapins */
#side_content {
z-index: 5;
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 05d3bb4..b80b27b 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
import config, defaults, livestatus, views, pprint, os, copy, userdb, pagetypes
-import notify, urlparse
+import notify, werks, urlparse
from lib import *
# Constants to be used in snapins
@@ -172,14 +172,20 @@ def get_check_mk_edition_title():
def sidebar_head():
html.write('<div id="side_header">')
html.write('<div id="side_fold"></div>')
- html.write('<a title="%s" target="main"
href="%s">'
- '<img id="side_bg"
src="images/sidebar_top.png">'
- '<div id="side_version"><a
href="version.py"
target="main">%s<br>%s</a></div>'
- '</a>'
- '</div>\n' % (_("Go to main overview"),
- html.attrencode(config.user.get("start_url") or
config.start_url),
- get_check_mk_edition_title(),
- defaults.check_mk_version))
+ html.write('<a title="%s" target="main"
href="%s">' %
+ (_("Go to main overview"),
html.attrencode(config.user.get("start_url") or config.start_url)))
+ html.write('<img id="side_bg"
src="images/sidebar_top.png">')
+ html.write('<div id="side_version">'
+ '<a href="version.py" target="main"
title=\"%s\">%s<br>%s' %
+ (_("Open release notes"), get_check_mk_edition_title(),
defaults.check_mk_version))
+ if werks.may_acknowledge():
+ num_unacknowledged_werks = werks.num_unacknowledged_incompatible_werks()
+ if num_unacknowledged_werks:
+ html.write("<span title=\"%s\"
class=\"unack_werks\">%d</span>" %
+ (_("%d unacknowledged incompatible werks") %
num_unacknowledged_werks, num_unacknowledged_werks))
+ html.write('</a></div>')
+ html.write('</a></div>\n')
+
def render_messages():
for msg in notify.get_gui_messages():
diff --git a/web/htdocs/werks.py b/web/htdocs/werks.py
index 9bba4ab..f163aac 100644
--- a/web/htdocs/werks.py
+++ b/web/htdocs/werks.py
@@ -235,6 +235,11 @@ def unacknowledged_incompatible_werks():
if werk["compatible"] == "incomp_unack"])
+def num_unacknowledged_incompatible_werks():
+ load_werks()
+ return len(unacknowledged_incompatible_werks())
+
+
werk_table_option_entries = [
( "classes",
"double",
@@ -567,4 +572,3 @@ def insert_manpage_links(text):
def werks_sorted_by_date(werks):
return sorted(werks, cmp = lambda a, b: -cmp(a["date"],
b["date"]))
-