<%page args="element,renderid=False,sourceApp=None" />\ <%namespace name="lib" file="//lib.html" import="*"/>\ % if renderid:
% endif
<% html = element.options.get('rawcontent')%>\ <% src = element.options.get('serverSideInclude')%>\ % if html: <% html = _(html) from lxml.html.clean import Cleaner import re cleaner = Cleaner(comments = False, links = False, meta = False, page_structure = False, processing_instructions = False, embedded = False, frames = False, forms = False, annoying_tags = False, remove_unknown_tags = False, safe_attrs_only = False) html = cleaner.clean_html('

' + html + '

') html = re.sub('^

|

$','',html) %>\ ${html} % elif src: <% import cherrypy from mako import exceptions from splunk.appserver.mrsparkle.lib.i18n import path_to_i18n_paths import logging logger = logging.getLogger("splunk.appserver.dashboard.html") error_header = "Dashboard HTML Error!" app = sourceApp if sourceApp is not None else cherrypy.request.path_info[1:].split('/')[2] while src.startswith('../'): src = src[3:] src = src.replace('/../','/') src = "/APP/%s/appserver/static/%s" % (app, src) output = None # allow for i18n specific static includes to override the default # eg. a request for index.html may check for index-en_GB.html and index-en.html before # falling back to index.html for i18nsrc in path_to_i18n_paths(src): try: output = capture(self.include_file, i18nsrc) break except exceptions.TemplateLookupException, e: continue except: traceback = exceptions.RichTraceback() logger.error("Fatal template error. %s" % traceback.error) output = lib.template.get_def('traceback').render(header=error_header) if output is None: logger.error("Invalid template path. %s" % e) output = '

%s

%s
' % (error_header, e) %>\ ${output} % else: % endif
% if renderid:
% endif