summaryrefslogtreecommitdiffstats
path: root/weblog-viewauditstats-html.lsp
blob: 8eddb055414208ddfcad4b843a4d91fccb84303c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<% local data, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>

<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script>
<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		<% if data.value.groupby.value == "clientip" then %>
		$("#audit").tablesorter({headers: {0:{sorter:'ipAddress'}}});
		<% else %>
		$("#audit").tablesorter();
		<% end %>
	});
</script>

<% displaycommandresults({"completeaudit"}, session) %>

<H1>Audit Parameters</H1>
<DL>
<% displayitem(data.value.auditstart) %>
<% displayitem(data.value.auditend) %>
</DL>

<H1><%= html.html_escape(data.label) %></H1>
<DL>
<TABLE id="audit" class="tablesorter"><THEAD>
	<TR style="font-weight:bold;">
		<TH><% if data.value.groupby.value == "clientip" then %>Client IP<% else %>User ID<% end %></TH>
		<TH>Total Requests</TH>
		<TH>Flagged Requests</TH>
		<TH>Total Score</TH>
		<TH>Blocked</TH>
		<TH>Overridden</TH>
		<TH>Maximum Score</TH>
	</TR>
</THEAD><TBODY>
<% for i,stat in ipairs(data.value.stats.value) do %>
	<TR><TD><%= html.link{value = "viewweblog?"..data.value.groupby.value.."="..stat[data.value.groupby.value], label=stat[data.value.groupby.value]} %></TD>
	<TD><%= html.html_escape(stat.numrecords) %></TD>
	<TD><%= html.html_escape(stat.numflagged) %></TD>
	<TD><%= html.html_escape(stat.numhits) %></TD>
	<TD><%= html.html_escape(stat.numdenied) %></TD>
	<TD><%= html.html_escape(stat.numbypassed) %></TD>
	<TD><%= html.html_escape(stat.maxscore) %></TD></TR>
<% end %>
</TBODY></TABLE>

<% if data.errtxt then %>
<p class='error'><%= html.html_escape(data.errtxt) %></p>
<% end %>
<% if #data.value.stats.value == 0 then %>
<p>No flagged records, try adjusting the audit dates</p>
<% end %>

<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/completeaudit") %>">
<DT>Complete Audit</DT>
<DD><input class="submit" type="submit" value="Complete"></DD>
</form>
</DL>