Module: check_mk
Branch: master
Commit: 961d1066637dcedfa281597dfa5b3daa7560dc79
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=961d1066637dce…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 16 16:56:39 2018 +0200
5981 FIX Fixed displaying of BI aggregation with icons
When displaying BI aggregations that want to display an icon,
for example when a service is in downtime, an exception like
this could occur: TypeError: render_icon() got an unexpected keyword argument
'class_'.
Change-Id: I0ccb600d9c664b696b67308293631a6479bbd097
---
.werks/5981 | 13 +++++++++++++
web/htdocs/htmllib.py | 5 ++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/5981 b/.werks/5981
new file mode 100644
index 0000000..272ab2b
--- /dev/null
+++ b/.werks/5981
@@ -0,0 +1,13 @@
+Title: Fixed displaying of BI aggregation with icons
+Level: 1
+Component: bi
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1523890523
+
+When displaying BI aggregations that want to display an icon,
+for example when a service is in downtime, an exception like
+this could occur: TypeError: render_icon() got an unexpected keyword argument
'class_'.
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 0357c31..c7ed416 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -2802,7 +2802,7 @@ class html(HTMLGenerator, RequestHandler):
self.write_html(self.render_icon("images/trans.png"))
- def render_icon(self, icon_name, help=None, middle=True, id=None, cssclass=None):
+ def render_icon(self, icon_name, help=None, middle=True, id=None, cssclass=None,
class_=None):
# TODO: Refactor
title = help
@@ -2814,6 +2814,9 @@ class html(HTMLGenerator, RequestHandler):
'align' : 'absmiddle' if middle else None,
'src' : icon_name if "/" in icon_name else
self.detect_icon_path(icon_name)}
+ if class_:
+ attributes['class'].extend(class_)
+
return self._render_opening_tag('img', close_tag=True, **attributes)