Module: check_mk
Branch: master
Commit: 5df8cc0afbd5641b4e57949717ec853df682d7e9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5df8cc0afbd564…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 31 16:00:35 2016 +0200
moved helper function
---
web/htdocs/views.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index f30a2c1..afea5b9 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1173,6 +1173,16 @@ class Cell(object):
# Same as self.render() for HTML output: Gets a painter and a data
# row and creates the text for being painted.
def render_for_pdf(self, row, time_range):
+ # TODO: Move this somewhere else!
+ def find_htdocs_image_path(filename):
+ dirs = [
+ defaults.omd_root + "/local/share/check_mk/web/htdocs/",
+ defaults.omd_root + "/share/check_mk/web/htdocs/",
+ ]
+ for d in dirs:
+ if os.path.exists(d + filename):
+ return d + filename
+
try:
row = join_row(row, self)
css_classes, txt = self.render_content(row)
Module: check_mk
Branch: master
Commit: b1f9e204db47a8f27e27a467adfbbd4944ef9458
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b1f9e204db47a8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 31 15:50:56 2016 +0200
Fixed linter error
---
web/htdocs/views.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 7ed146b..f30a2c1 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1006,6 +1006,10 @@ class Cell(object):
return False
+ def join_service(self):
+ return None
+
+
def _has_link(self):
return self._link_view_name != None
@@ -1105,6 +1109,7 @@ class Cell(object):
# - Add in the front of the user sorters when not set
sorter_name = get_sorter_name_of_painter(self.painter_name())
if self.is_joined():
+ # TODO: Clean this up and then remove Cell.join_service()
this_asc_sorter = (sorter_name, False, self.join_service())
this_desc_sorter = (sorter_name, True, self.join_service())
else:
@@ -1114,9 +1119,11 @@ class Cell(object):
if user_sort and this_asc_sorter == user_sort[0]:
# Second click: Change from asc to desc order
sorter[sorter.index(this_asc_sorter)] = this_desc_sorter
+
elif user_sort and this_desc_sorter == user_sort[0]:
# Third click: Remove this sorter
sorter.remove(this_desc_sorter)
+
else:
# First click: add this sorter as primary user sorter
# Maybe the sorter is already in the user sorters or view sorters, remove it