%!
import string
def html_trim(text):
return "".join([x.strip() for x in text.splitlines()])
%>\
<%page args="job, event, request, options" />\
<%
xslt = '''\
| <%self:event_row_number job="${job}" event="${event}" request="${request}" options="${options}" /> | % endif % if options.get('enable_event_actions', False):<%self:event_actions job="${job}" event="${event}" request="${request}" options="${options}" /> | % endif<%self:event_time job="${job}" event="${event}" request="${request}" options="${options}" /> | % if '_icon' in event:<%self:event_icon job="${job}" event="${event}" request="${request}" options="${options}" /> | % endif\ <%self:event_audit job="${job}" event="${event}" request="${request}" options="${options}" /> % if not event.raw: % else: <%self:event_raw job="${job}" event="${event}" request="${request}" options="${options}" xslt="${xslt}" />\ <%self:event_show_all job="${job}" event="${event}" request="${request}" options="${options}" />\ % endif <%self:event_fields job="${job}" event="${event}" request="${request}" options="${options}" /> |
${event.pretty_printed}
% elif event.raw.toXml() is None:
${event.raw | h}
% else:
<% transform = event.raw.toXml(xslt) %>
${transform.replace('\n', '
') if options['replace_newlines'] else transform}
% endif
% if event.json:
<%
lineCountIsInt = str(event.get('linecount','')).isdigit()
qs = dict(count=1, field_list=",".join(request['field_list']), has_layout=0, offset=event.offset, sid=job.sid, segmentation=request['segmentation'])
qs['replace_newlines'] = 1 if options['replace_newlines'] else 0
if request['earliest_time']:
qs['earliest_time'] = request['earliest_time']
if request['latest_time']:
qs['latest_time'] = request['latest_time']
qs['display_row_numbers'] = 1 if options['display_row_numbers'] else 0
qs['pretty_print'] = not options['pretty_print']
%>
${options['pretty_print'] and _("Show as raw text") or _("Show syntax highlighted")}
% endif
%def>\
\
<%def name="event_show_all(job, event, request, options)" filter="html_trim">
<%
lineCountIsInt = str(event.get('linecount','')).isdigit()
qs = dict(count=1, field_list=",".join(request['field_list']), has_layout=0, offset=event.offset, sid=job.sid, segmentation=request['segmentation'])
qs['replace_newlines'] = 1 if options['replace_newlines'] else 0
if request['earliest_time']:
qs['earliest_time'] = request['earliest_time']
if request['latest_time']:
qs['latest_time'] = request['latest_time']
if request['post_process']:
qs['post_process'] = request['post_process']
qs['display_row_numbers'] = 1 if options['display_row_numbers'] else 0
%>
% if event.raw.isTruncated is True and request['max_lines'] < max_lines_constraint:
<%
qs['max_lines'] = 0
qs['min_lines'] = request['min_lines']
qs['max_lines_constraint'] = request['max_lines_constraint']
qs['truncation_mode'] = 'truncate'
%>
% if lineCountIsInt:
% if int(str(event.get('linecount', max_lines_constraint)))< (max_lines_constraint+1):
${_("Show all %s lines") % event.get('linecount', '')}
% else:
${_("Show most relevant lines (Exceeds %s limit)") % max_lines_constraint}
% endif:
% else:
Show All Lines
% endif
% elif lineCountIsInt and int(str(event.get('linecount', 0))) > request['min_lines']:
<%
qs['max_lines'] = request['min_lines']
qs['min_lines'] = request['min_lines']
qs['max_lines_constraint'] = request['max_lines_constraint']
%>
${_("Collapse back to %s lines") % request['min_lines']}
% endif
%def>\
\
<%def name="event_actions(job, event, request, options)" filter="html_trim">
»
%def>\
\
<%def name="event_fields(job, event, request, options)" filter="html_trim">