%page args="dashboard,escapedOutput=False,kw={}"/>\
<%!
if cherrypy.config['product_type'] == 'hunk':
faviconFile = 'favicon_hunk.ico'
elif cherrypy.config['product_type'] == 'lite':
faviconFile = 'favicon_lite.ico'
elif cherrypy.config['product_type'] == 'lite_free':
faviconFile = 'favicon_lite.ico'
else:
faviconFile = 'favicon.ico'
isLite = (cherrypy.config['product_type'] == 'lite' or cherrypy.config['product_type'] == 'lite_free')
css_less_qs = {}
if hasattr(cherrypy.request, 'embed') and cherrypy.request.embed:
css_less_qs['embed'] = 1
%>\
<%
from urlparse import urljoin
from urllib import quote
from splunk.models.view_escaping.forminput import BaseInput
CUR_PAGE = "/app/%s/%s" % ( quote(APP['id']), quote(VIEW['id']) ) if escapedOutput else make_url("/app/%s/%s" % ( quote(APP['id']), quote(VIEW['id']) ))
def url(arg):
if escapedOutput:
if arg[0] == '/' and arg[1] != '/': # server-relative URL
return "{{SPLUNKWEB_URL_PREFIX}}%s" % arg
elif arg.startswith('http://') or arg.startswith('https://') or arg.startswith('//'): # absolute or scheme-relative URL
return arg
else: # relative URL
return "{{SPLUNKWEB_URL_PREFIX}}%s" % urljoin(CUR_PAGE, arg)
else:
if arg[0] == '/' and arg[1] != '/': # server-relative URL
return make_url(arg, validate=False)
else: # absolute or relative URL
return urljoin(CUR_PAGE, arg)
augment_perf = splunk.util.normalizeBoolean(cherrypy.config.get('simple_xml_perf_debug'))
hasGlobalTRP = dashboard.hasGlobalTRP()
options = dict()
for option in ['hideChrome', 'hideSplunkBar', 'hideAppBar', 'hideFooter', 'hideTitle', 'hideEdit', 'targetTop']:
options[option] = splunk.util.normalizeBoolean(kw.get(option, False)) if option in kw else getattr(dashboard, option, False)
%>\
% if options['targetTop']:
% endif
${_(dashboard.label if dashboard.label else dashboard.viewName) | h} | Splunk
% if splunk.util.normalizeBoolean(cherrypy.config.get('minify_css')):
% if isLite:
% else:
% endif
% for css in customCssFiles:
% endfor
% else:
% for css in customCssFiles:
% endfor
% endif
% if isLite:
% else:
% endif
Screen reader users, click here to skip the navigation bar
% if (not options['hideChrome']):
% if not isLite:
% if (not options['hideSplunkBar']):
% endif
% if (not options['hideAppBar']):
% endif
% endif
% endif
% if (not options['hideTitle']):
% if dashboard.label:
${_(dashboard.label)|h}
% else:
% endif
% if dashboard.description is not None:
${_(dashboard.description)|h}
% endif
% endif
% if dashboard.fieldset or dashboard.submitButton:
% for input in dashboard.fieldset:
<%include file="elements/${input.__class__.__name__}.html" args="element=input,renderid=True,sourceApp=dashboard.sourceApp,url=url" />\
% endfor
%if dashboard.submitButton:
% endif
% endif
<%def name="tokenDepsData(obj)">\
% if obj.tokenDeps and obj.tokenDeps.depends:
data-depends="${obj.tokenDeps.depends}"\
% endif
% if obj.tokenDeps and obj.tokenDeps.rejects:
data-rejects="${obj.tokenDeps.rejects}"\
% endif
%def>
<%def name="originalId(obj)">\
% if obj.idGenerated is False:
data-original-id="${obj.id}"\
% endif
%def>
% for i,row in enumerate(dashboard.rows):
% if len(row.panels):
<%
width = str(round(100.0/len(row.panels),3))[0:-1].rstrip('0').rstrip('.') + '%'
%>\
% for panel in row.panels:
% if panel.ref:
% else:
% if panel.title:
${panel.title | h}
% endif
% if panel.fieldset:
% for input in panel.fieldset:
<%include file="elements/${input.__class__.__name__}.html" args="element=input,renderid=True,sourceApp=dashboard.sourceApp,url=url" />\
% endfor
% endif
<%
single= False
panel_element_width = '100%'
%>
% for j,element in enumerate(panel.panelElements):
% if element.matchTagName == 'single' and single == False:
\
<%
single_count = 0
for k in range(j,len(panel.panelElements)):
if panel.panelElements[k].matchTagName != 'single':
break
single_count = single_count + 1
panel_element_width = str(round(100.0/single_count,3))[0:-1].rstrip('0').rstrip('.') + '%'
single = True
%>
% endif
% if element.matchTagName != 'single':
% if single:
<%
single= False
panel_element_width = '100%'
%>
% endif
% endfor
% if (not options['hideChrome'] and not options['hideFooter']):
% endif
% if augment_perf:
% endif
% if splunk.util.normalizeBoolean(cherrypy.config.get('minify_js')):
% if splunk.util.normalizeBoolean(cherrypy.config.get('js_no_cache')):
% endif:
% for js in customJsFiles:
% endfor