Module: check_mk
Branch: master
Commit: eac98f269b546b42c2d41624ecaae85e3bdd6d75
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eac98f269b546b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 6 11:31:04 2015 +0200
Readded missing icon image icon
---
web/plugins/icons/builtin.py | 26 ++++++++++++++++++++++++++
web/plugins/wato/check_mk_configuration.py | 22 ++++++++++++----------
2 files changed, 38 insertions(+), 10 deletions(-)
diff --git a/web/plugins/icons/builtin.py b/web/plugins/icons/builtin.py
index b7c0da0..5d7ebf6 100644
--- a/web/plugins/icons/builtin.py
+++ b/web/plugins/icons/builtin.py
@@ -96,6 +96,32 @@ multisite_icons.append({
})
#.
+# .--Icon-Image----------------------------------------------------------.
+# | ___ ___ |
+# | |_ _|___ ___ _ __ |_ _|_ __ ___ __ _ __ _ ___ |
+# | | |/ __/ _ \| '_ \ _____| || '_ ` _ \ / _` |/ _` |/ _ \ |
+# | | | (_| (_) | | | |_____| || | | | | | (_| | (_| | __/ |
+# | |___\___\___/|_| |_| |___|_| |_| |_|\__,_|\__, |\___| |
+# | |___/ |
+# +----------------------------------------------------------------------+
+# | |
+# '----------------------------------------------------------------------'
+
+def paint_icon_image(what, row, tags, custom_vars):
+ img = row[what + '_icon_image']
+ if img:
+ if img.endswith('.png'):
+ img = img[:-4]
+ return html.render_icon(img)
+
+multisite_icons.append({
+ 'columns': [ 'icon_image' ],
+ 'paint': paint_icon_image,
+ 'toplevel': True,
+ 'sort_index': 25,
+})
+
+#.
# .--Reschedule----------------------------------------------------------.
# | ____ _ _ _ |
# | | _ \ ___ ___ ___| |__ ___ __| |_ _| | ___ |
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 74d89db..51ed32f 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -2193,14 +2193,17 @@ register_rule(group,
register_rule(group,
"extra_host_conf:icon_image",
- IconSelector(
- title = _("Icon image for hosts in status GUI"),
- help = _("You can assign icons to hosts for the status GUI. "
- "Put your images into <tt>%s</tt>. ") %
- ( defaults.omd_root
- and defaults.omd_root +
"/local/share/check_mk/web/htdocs/images/icons"
- or defaults.web_dir + "/htdocs/images/icons" ),
- ))
+ Transform(
+ IconSelector(
+ title = _("Icon image for hosts in status GUI"),
+ help = _("You can assign icons to hosts for the status GUI. "
+ "Put your images into <tt>%s</tt>. ") %
+ ( defaults.omd_root
+ and defaults.omd_root +
"/local/share/check_mk/web/htdocs/images/icons"
+ or defaults.web_dir + "/htdocs/images/icons" ),
+ ),
+ forth = lambda v: v.endswith('.png') and v[:-4] or v,
+ ))
register_rule(group,
@@ -2214,8 +2217,7 @@ register_rule(group,
and defaults.omd_root +
"/local/share/check_mk/web/htdocs/images/icons"
or defaults.web_dir + "/htdocs/images/icons" ),
),
- forth = lambda v: v and v[:-4] or v,
- back = lambda v: v and v+'.png' or v,
+ forth = lambda v: v.endswith('.png') and v[:-4] or v,
),
itemtype = "service")