Module: check_mk
Branch: master
Commit: 9a74abc4bbbce9b52195d601e5187a66ac9bc037
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9a74abc4bbbce9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 23 07:55:51 2017 +0200
Cleaned up show_timeranges argument of render_graphs_from_specification_html()
Change-Id: I38102356de07b0f18be4e61c5bbb3eb37947498f
---
web/htdocs/metrics.py | 13 +++++++------
web/plugins/views/painters.py | 5 +++--
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index bb39222..9a2acd6 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -1565,11 +1565,12 @@ def host_service_graph_dashlet_cmk(graph_identification,
custom_graph_render_opt
int((float(html.var("height")) - 18)/html_size_per_ex))
graph_render_options = {
- "size" : size,
- "font_size" : 8,
- "show_legend" : False,
- "show_controls" : False,
- "resizable" : False,
+ "size" : size,
+ "font_size" : 8,
+ "show_legend" : False,
+ "show_controls" : False,
+ "resizable" : False,
+ "show_time_range_previews" : False,
}
graph_render_options.update(custom_graph_render_options)
@@ -1610,7 +1611,7 @@ def host_service_graph_dashlet_cmk(graph_identification,
custom_graph_render_opt
graph_artwork = compute_graph_artwork(graph_recipe, graph_data_range,
graph_render_options)
graph_render_options["size"] = (size[0], size[1] -
graph_legend_height_ex(graph_render_options, graph_artwork))
- html_code = render_graphs_from_definitions([graph_recipe], graph_data_range,
graph_render_options)
+ html_code = render_graphs_from_definitions([graph_recipe], graph_data_range,
graph_render_options, render_async=False)
html.write(html_code)
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index d99ae02..b0c7fe8 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -1020,6 +1020,8 @@ def paint_time_graph_cmk(row, cell, show_timeranges=False):
# b) the painter options set per user and view
graph_render_options = cell.painter_parameters().copy()
+ graph_render_options["show_time_range_previews"] = show_timeranges
+
options = painter_options.get_without_default("graph_render_options")
if options != None:
graph_render_options.update(options)
@@ -1047,8 +1049,7 @@ def paint_time_graph_cmk(row, cell, show_timeranges=False):
return "", metrics.render_graphs_from_specification_html(
graph_identification,
graph_data_range,
- graph_render_options,
- show_timeranges)
+ graph_render_options)
def get_graph_timerange_from_painter_options():