Skip to content
Permalink
Browse files

URL dashlets: Added option to enable / disable displaying URLs in iframe

  • Loading branch information
LarsMichelsen committed Aug 25, 2014
1 parent 44117e1 commit d9e723b6df34de6c475886f6986db5f6d87d67e7
Showing with 10 additions and 2 deletions.
  1. +3 −1 web/htdocs/dashboard.py
  2. +7 −1 web/plugins/dashboard/dashlets.py
@@ -482,7 +482,9 @@ def render_dashlet(name, board, nr, dashlet, wato_folder, add_url_vars):

# Optional way to render a dynamic iframe URL
if "iframe_urlfunc" in dashlet_type:
dashlet["iframe"] = dashlet_type["iframe_urlfunc"](dashlet)
url = dashlet_type["iframe_urlfunc"](dashlet)
if url != None:
dashlet["iframe"] = url

elif "iframe_render" in dashlet_type:
dashlet["iframe"] = html.makeuri_contextless([
@@ -567,7 +567,8 @@ def dashlet_view_handle_input(ident, dashlet):
# '----------------------------------------------------------------------'

def dashlet_url(params):
return params['url']
if params.get('show_in_iframe', True):
return params['url']

dashlet_types["url"] = {
"title" : _("Custom URL"),
@@ -585,6 +586,11 @@ def dashlet_url(params):
title = _('Dynamic URL rendering function'),
size = 50,
)),
("show_in_iframe", Checkbox(
title = _('Render in iframe'),
label = _('Render URL contents in own frame'),
default_value = True,
)),
],
"opt_params": ['url', 'urlfunc'],
}

0 comments on commit d9e723b

Please sign in to comment.
You can’t perform that action at this time.