Module: check_mk
Branch: master
Commit: 6cc51fa3ea03e1a5f48975fe2e718c21cd722a7f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6cc51fa3ea03e1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 30 14:19:07 2015 +0100
Added edition text to sidebar header
---
web/htdocs/images/sidebar_top.png | Bin 17744 -> 18195 bytes
web/htdocs/sidebar.css | 2 +-
web/htdocs/sidebar.py | 17 ++++++++++++++++-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/images/sidebar_top.png b/web/htdocs/images/sidebar_top.png
index e367ab7..43fa2ab 100644
Binary files a/web/htdocs/images/sidebar_top.png and b/web/htdocs/images/sidebar_top.png
differ
diff --git a/web/htdocs/sidebar.css b/web/htdocs/sidebar.css
index 7e9da2d..b7f96dd 100644
--- a/web/htdocs/sidebar.css
+++ b/web/htdocs/sidebar.css
@@ -96,7 +96,7 @@ body.side.screenshotmode {
#side_version {
position: absolute;
- top: 24px;
+ top: 12px;
right: 20px;
z-index: 54;
color: #fff;
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index f5c94c0..f69b141 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -151,19 +151,34 @@ def load_user_config():
return user_config
+
def save_user_config(user_config):
if config.may("general.configure_sidebar"):
config.save_user_file("sidebar", user_config)
+
+def get_check_mk_edition_title():
+ if not defaults.omd_root:
+ return "Raw"
+ version_link = os.readlink("/omd/sites/heute/version")
+ if version_link.endswith(".cee.demo"):
+ return "Enterprise (Demo)"
+ elif "cee" in version_link:
+ return "Enterprise"
+ else:
+ return "Raw"
+
+
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</a></div>'
+ '<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))
def render_messages():