Module: check_mk
Branch: master
Commit: 4f54026c9a9a20d3d7906673ce4f2cbfc997ca3f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4f54026c9a9a20…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 8 08:54:20 2017 +0100
Standardized show_title/title_format render options
Change-Id: I6dcdf1cc608d14ac481c88d666dae451c9eb3fd8
---
web/htdocs/metrics.py | 3 ++-
web/plugins/dashboard/dashlets.py | 8 +++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index 038d199..358648a 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -1544,7 +1544,8 @@ def host_service_graph_popup_pnp(site, host_name,
service_description):
default_dashlet_graph_render_options = {
"font_size" : 8,
"show_legend" : False,
- "show_service" : True,
+ "title_format" : ("add_title_infos", [
"add_host_name",
+
"add_service_description" ]),
"show_controls" : False,
"resizable" : False,
"show_time_range_previews" : False,
diff --git a/web/plugins/dashboard/dashlets.py b/web/plugins/dashboard/dashlets.py
index 4db7889..cdc007a 100644
--- a/web/plugins/dashboard/dashlets.py
+++ b/web/plugins/dashboard/dashlets.py
@@ -366,9 +366,15 @@ def dashlet_graph(nr, dashlet):
def dashlet_graph_reload_js(nr, dashlet):
# Be compatible to pre 1.5.0i2 format
if "graph_render_options" not in dashlet:
+ if dashlet.pop("show_service", True):
+ title_format = ("add_title_infos", ["add_host_name",
+ "add_service_description"])
+ else:
+ title_format = ("plain", [])
+
dashlet["graph_render_options"] = {
"show_legend" : dashlet.pop("show_legend", False),
- "show_service" : dashlet.pop("show_service", True),
+ "title_format" : title_format,
}
host = dashlet['context'].get('host', html.var("host"))