Commit 7dad3b2d authored by Ted Trask's avatar Ted Trask

Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags

parent 6d0829a8
......@@ -39,57 +39,57 @@ end
</script>
<% if form.value.result then %>
<H1><%= html.html_escape(form.value.result.label) %></H1>
<h1><%= html.html_escape(form.value.result.label) %></h1>
<% if #form.value.result.value == 0 then %>
<p>No results, try adjusting query</p>
<% else %>
<TABLE id="adhocresult" class="tablesorter">
<THEAD>
<TR>
<table id="adhocresult" class="tablesorter">
<thead>
<tr>
<% for i,name in ipairs(form.value.names.value) do %>
<TH class="header"><%= html.html_escape(name) %></TH>
<th class="header"><%= html.html_escape(name) %></th>
<% end %>
</TR>
</THEAD>
<TBODY>
</tr>
</thead>
<tbody>
<% for i,row in ipairs(form.value.result.value) do %>
<TR>
<tr>
<% for j,name in ipairs(form.value.names.value) do %>
<TD><%= html.html_escape(row[name]) %></TD>
<td><%= html.html_escape(row[name]) %></td>
<% end %>
</TR>
</tr>
<% end %>
<TBODY>
</TABLE>
<tbody>
</table>
<% if viewlibrary.check_permission("downloadadhocquery") then %>
<form action="/cgi-bin/acf/weblog/weblog/downloadadhocquery" method="POST">
<form action="/cgi-bin/acf/weblog/weblog/downloadadhocquery" method="post">
<input class="hidden" type="hidden" name="query" value="<%= html.html_escape(form.value.query.value) %>" >
<input class="hidden" type="hidden" name="viewtype" value="stream" >
<DL>
<DT>Download query result</DT><DD><input class="submit" type="submit" name="submit" value="Download"></DD>
</DL>
</FORM>
<div class='item'><p class='left'>Download query result</p>
<div class='right'>
<input class="submit" type="submit" name="submit" value="Download">
</div></div><!-- end .item -->
</form>
<% end %>
<% end %>
<% end %>
<H1><%= html.html_escape(form.label) %></H1>
<h1><%= html.html_escape(form.label) %></h1>
<% htmlviewfunctions.displayformstart(form, page_info) %>
This form accepts a Postgresql SELECT statement and displays the results. Examples:
<p>This form accepts a Postgresql SELECT statement and displays the results. Examples:
<ul>
<li>This statement will return the total bytes transferred by each user for the pre-purge weblog history<pre>SELECT clientuserid, sum(bytes) AS total FROM pubweblog GROUP BY clientuserid ORDER BY total DESC</pre>
<li>This statement limits the above statement to a specific range of dates (just yesterday)<pre>SELECT clientuserid, sum(bytes) AS total FROM pubweblog WHERE logdatetime >= 'yesterday' and logdatetime < 'today' GROUP BY clientuserid ORDER BY total DESC</pre>
<li>This statement will return the number of requests and blocks by hour over the course of the entire usage history<pre>SELECT extract(hour from date) AS hour, sum(numrequest) AS numrequest, sum(numblock) AS numblock FROM usagestat GROUP BY extract(hour from date) ORDER BY hour</pre>
</ul>
The available database tables and descriptions are listed below.
The available database tables and descriptions are listed below.</p>
<% htmlviewfunctions.displayformitem(form.value.query, "query") %>
<% htmlviewfunctions.displayformend(form) %>
<H2>Available Database Tables</H2>
<H3>pubweblog and pubweblog_history</H3>
<DL>
These tables contain the pre-purge and historical access logs respectively. The definition of the table is as follows:
<h2>Available Database Tables</h2>
<h3>pubweblog and pubweblog_history</h3>
<p>These tables contain the pre-purge and historical access logs respectively. The definition of the table is as follows:</p>
<pre>
(
sourcename character varying(40),
......@@ -109,21 +109,19 @@ These tables contain the pre-purge and historical access logs respectively. The
selected boolean,
id int,
)
</pre></DL>
</pre>
<H3>dbhistlog</H3>
<DL>
This table contains the database history, including such information as which log files were loaded and how many entries they contained. The definition of the table is as follows:
<h3>dbhistlog</h3>
<p>This table contains the database history, including such information as which log files were loaded and how many entries they contained. The definition of the table is as follows:</p>
<pre>
(
logdatetime timestamp(3) without time zone NOT NULL,
msgtext text
)
</pre></DL>
</pre>
<H3>source</H3>
<DL>
This table contains the list of log file sources. The definition of the table is as follows:
<h3>source</h3>
<p>This table contains the list of log file sources. The definition of the table is as follows:</p>
<pre>
(
sourcename character varying(40) NOT NULL,
......@@ -134,11 +132,10 @@ This table contains the list of log file sources. The definition of the table is
tzislocal boolean,
enabled boolean
)
</pre></DL>
</pre>
<H3>usagestat</H3>
<DL>
This table contains a historical record of pages requested and blocked by hour. The definition of the table is as follows:
<h3>usagestat</h3>
<p>This table contains a historical record of pages requested and blocked by hour. The definition of the table is as follows:</p>
<pre>
(
sourcename character varying(40) NOT NULL,
......@@ -146,4 +143,4 @@ This table contains a historical record of pages requested and blocked by hour.
numrequest integer,
numblock integer
)
</pre></DL>
</pre>
......@@ -37,17 +37,15 @@ end
<% htmlviewfunctions.displaycommandresults({"editfile"}, session) %>
<H1>File List</H1>
<DL>
<TABLE id="files" class="tablesorter"><THEAD>
<TR>
<TH>File</TH>
<TH>Size</TH>
<TH>Last Modified</TH>
</TR>
</THEAD><TBODY>
<h1>File List</h1>
<table id="files" class="tablesorter"><thead>
<tr>
<th>File</th>
<th>Size</th>
<th>Last Modified</th>
</tr>
</thead><tbody>
<% for k,v in ipairs( view.value ) do
io.write( "<tr><td><a href=\"" .. html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) .. "/editfile?filename=" .. html.html_escape(v.filename) .. "&redir=" .. html.html_escape(page_info.orig_action) .. "\">" .. html.html_escape(v.filename) .. '</a></td><td><span style="display:none">'..convertsize(v.size).."b</span>" .. html.html_escape(v.size) .."</td><td>" .. html.html_escape(v.mtime) .."</td></tr>\n" )
end %>
</TBODY></TABLE>
</DL>
</tbody></table>
......@@ -24,32 +24,31 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"deletesource", "editsource", "testsource", "createsource", "importlogs"}, session) %>
<h1><%= html.html_escape(data.label) %></h1>
<DL>
<TABLE id="sources" class="tablesorter"><THEAD>
<TR>
<TH>Action</TH>
<TH>Name</TH>
<TH>Enabled</TH>
<TH>Source</TH>
<TH>Method</TH>
</TR>
</THEAD><TBODY>
<table id="sources" class="tablesorter"><thead>
<tr>
<th>Action</th>
<th>Name</th>
<th>Enabled</th>
<th>Source</th>
<th>Method</th>
</tr>
</thead><tbody>
<% for i,source in ipairs(data.value) do %>
<TR>
<TD>
<tr>
<td>
<%= html.link{value = "editsource?sourcename=" .. source.sourcename.."&redir="..page_info.orig_action, label="Edit "} %>
<%= html.link{value = "deletesource?submit=true&sourcename=" .. source.sourcename, label="Delete "} %>
<%= html.link{value = "testsource?submit=true&sourcename=" .. source.sourcename, label="Test "} %>
</TD>
<TD><%= html.html_escape(source.sourcename) %></TD>
<TD><%= html.html_escape(tostring(source.enabled)) %></TD>
<TD><%= html.html_escape(source.source) %></TD>
<TD><%= html.html_escape(source.method) %></TD>
</TR>
</td>
<td><%= html.html_escape(source.sourcename) %></td>
<td><%= html.html_escape(tostring(source.enabled)) %></td>
<td><%= html.html_escape(source.source) %></td>
<td><%= html.html_escape(source.method) %></td>
</tr>
<% end %>
</TBODY>
</TABLE>
</tbody>
</table>
<% if data.errtxt then %>
<p class='error'><%= html.html_escape(data.errtxt) %></p>
......@@ -60,13 +59,16 @@ html = require("acf.html")
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createsource") %>">
<DT>Create New Source</DT>
<div class='item'><p class='left'>Create New Source</p>
<div class='right'>
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
<DD><input class="submit" type="submit" value="Create"></DD>
<input class="submit" type="submit" value="Create">
</div></div><!-- end .item -->
</form>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/importlogs") %>">
<DT>Import Logs</DT>
<DD><input class="submit" type="submit" name="submit" value="Import"></DD>
<div class='item'><p class='left'>Import Logs</p>
<div class='right'>
<input class="submit" type="submit" name="submit" value="Import">
</div></div><!-- end .item -->
</form>
</DL>
......@@ -4,8 +4,7 @@ htmlviewfunctions = require("htmlviewfunctions")
<% htmlviewfunctions.displaycommandresults({"createdatabase"}, session, true) %>
<H1>Weblog Database Status</H1>
<DL>
<h1>Weblog Database Status</h1>
<% local status
if viewlibrary and viewlibrary.dispatch_component then
if viewlibrary.check_permission("postgresql/postgresql/status") then
......@@ -13,7 +12,8 @@ if viewlibrary and viewlibrary.dispatch_component then
end
end %>
<DT>Database status</DT><DD>
<div class='item'><p class='left'>Database status</p>
<div class='right'><p>
<% if status then %>
<% if status.value.status.errtxt then
print(status.value.status.errtxt)
......@@ -23,16 +23,16 @@ end %>
<% else %>
Unknown
<% end %>
</DD>
</p></div></div><!-- end .item -->
<DT>Weblog Database</DT><DD>
<div class='item'><p class='left'>Weblog Database</p>
<div class='right'><p>
<% if data.value then %>
Present
<% else %>
Missing
<% end %>
</DD>
</DL>
</p></div></div><!-- end .item -->
<% if not data.value and viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("createdatabase")
......
......@@ -22,22 +22,21 @@
<% local subdata, pagedata = htmlviewfunctions.paginate(data.value, page_info.clientdata, 100) %>
<H1><%= html.html_escape(data.label) %></H1>
<DL>
<h1><%= html.html_escape(data.label) %></h1>
<% htmlviewfunctions.displaypagination(pagedata, page_info) %>
<TABLE id="activity" class="tablesorter"><THEAD>
<TR>
<TH>Date</TH>
<TH>Message</TH>
</TR>
</THEAD><TBODY>
<table id="activity" class="tablesorter"><thead>
<tr>
<th>Date</th>
<th>Message</th>
</tr>
</thead><tbody>
<% for i,log in ipairs(subdata) do %>
<TR>
<TD><%= html.html_escape(string.gsub(log.logdatetime, "%..*", "")) %></TD>
<TD><%= html.html_escape(log.msgtext) %></TD>
</TR>
<tr>
<td><%= html.html_escape(string.gsub(log.logdatetime, "%..*", "")) %></td>
<td><%= html.html_escape(log.msgtext) %></td>
</tr>
<% end %>
</TBODY></TABLE>
</tbody></table>
<% if data.errtxt then %>
<p class='error'><%= html.html_escape(data.errtxt) %></p>
......@@ -45,4 +44,3 @@
<% if #data.value == 0 then %>
<p>No history found</p>
<% end %>
</DL>
......@@ -26,35 +26,32 @@
<% htmlviewfunctions.displaycommandresults({"completeaudit"}, session) %>
<H1>Audit Parameters</H1>
<DL>
<h1>Audit Parameters</h1>
<% htmlviewfunctions.displayitem(data.value.auditstart) %>
<% htmlviewfunctions.displayitem(data.value.auditend) %>
</DL>
<H1><%= html.html_escape(data.label) %></H1>
<DL>
<TABLE id="audit" class="tablesorter"><THEAD>
<TR>
<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>
<h1><%= html.html_escape(data.label) %></h1>
<table id="audit" class="tablesorter"><thead>
<tr>
<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>
<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>
</tbody></table>
<% if data.errtxt then %>
<p class='error'><%= html.html_escape(data.errtxt) %></p>
......@@ -64,7 +61,8 @@
<% 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" name="submit" value="Complete"></DD>
<div class='item'><p class='left'>Complete Audit</p>
<div class='right'>
<input class="submit" type="submit" name="submit" value="Complete">
</div></div><!-- end .item -->
</form>
</DL>
......@@ -16,35 +16,34 @@
<script type="text/javascript">
$(function(){
$("#usage").tablesorter({headers: {0:{sorter: false}, 1:{sorter: 'text'}, 2:{sorter: 'digit'}, 3:{sorter: 'digit'}}, widgets: ['zebra']});
$("#usage").tablesorter({headers: {0:{sorter: 'shortDate'}, 1:{sorter: 'text'}, 2:{sorter: 'digit'}, 3:{sorter: 'digit'}}, widgets: ['zebra']});
});
</script>
<% local subdata, pagedata = htmlviewfunctions.paginate(data.value, page_info.clientdata, 100) %>
<H1><%= html.html_escape(data.label) %></H1>
<DL>
<h1><%= html.html_escape(data.label) %></h1>
<% htmlviewfunctions.displaypagination(pagedata, page_info) %>
<TABLE id="usage" class="tablesorter">
<THEAD>
<TR>
<TH>Date</TH>
<TH>Source</TH>
<TH>Requests</TH>
<TH>Blocks</TH>
</TR>
</THEAD>
<TBODY>
<table id="usage" class="tablesorter">
<thead>
<tr>
<th>Date</th>
<th>Source</th>
<th>Requests</th>
<th>Blocks</th>
</tr>
</thead>
<tbody>
<% for i,stat in ipairs(subdata) do %>
<TR>
<TD><%= html.html_escape(stat.date) %></TD>
<TD><%= html.html_escape(stat.sourcename) %></TD>
<TD><%= html.html_escape(stat.numrequest) %></TD>
<TD><%= html.html_escape(stat.numblock) %></TD>
</TR>
<tr>
<td><%= html.html_escape(stat.date) %></td>
<td><%= html.html_escape(stat.sourcename) %></td>
<td><%= html.html_escape(stat.numrequest) %></td>
<td><%= html.html_escape(stat.numblock) %></td>
</tr>
<% end %>
</TBODY>
</TABLE>
</tbody>
</table>
<% if data.errtxt then %>
<p class='error'><%= html.html_escape(data.errtxt) %></p>
......@@ -52,4 +51,3 @@
<% if #data.value == 0 then %>
<p>No usage stats found</p>
<% end %>
</DL>
......@@ -117,8 +117,7 @@ end
}
</style>
<H1>Search Parameters</H1>
<DL>
<h1>Search Parameters</h1>
<% -- Display the form, but skip log, window, and focus fields
local log = data.value.log
data.value.log = nil
......@@ -131,7 +130,6 @@ data.value.log = log
data.value.window = window
data.value.focus = focus
%>
</DL>
<%
local clientinfo = "submit=true&badyesno=false&deniedyesno=false&bypassyesno=false&selected=false&"
......@@ -144,11 +142,10 @@ end
%>
<% htmlviewfunctions.displaypagination(pagedata, page_info) %>
<H1><%= html.html_escape(data.label) %></H1>
<DL>
<TABLE id="loglist" class="tablesorter">
<THEAD>
<TR>
<h1><%= html.html_escape(data.label) %></h1>
<table id="loglist" class="tablesorter">
<thead>
<tr>
<% local checkhead = true
for i,watch in ipairs(subdata) do
if watch.selected ~= "t" then
......@@ -156,22 +153,22 @@ for i,watch in ipairs(subdata) do
break
end
end %>
<TH><input type="checkbox" id="chkHead"<% if checkhead then %> checked<% end %>></TH>
<TH>Timestamp</TH>
<TH>Source</TH>
<TH>Client IP</TH>
<TH>User ID</TH>
<TH>Size</TH>
<TH>Sus</TH>
<TH>Den</TH>
<TH>Byp</TH>
<TH>Score</TH>
<TH>Reason</TH>
<TH>URL</TH>
<TH>Bad Words</TH>
</TR>
</THEAD>
<TBODY>
<th><input type="checkbox" id="chkHead"<% if checkhead then %> checked<% end %>></th>
<th>Timestamp</th>
<th>Source</th>
<th>Client IP</th>
<th>User ID</th>
<th>Size</th>
<th>Sus</th>
<th>Den</th>
<th>Byp</th>
<th>Score</th>
<th>Reason</th>
<th>URL</th>
<th>Bad Words</th>
</tr>
</thead>
<tbody>
<% for i,watch in ipairs(subdata) do
local a,b = math.modf((i/2))
local mark = ''
......@@ -180,29 +177,29 @@ end %>
time.year, time.month, time.day, time.hour, time.min, time.sec =
string.match(watch.logdatetime, "(%d+)%-(%d+)-(%d+)%s+(%d+):(%d+):(%d+)")
time = os.time(time) %>
<TR<%= mark %>>
<TD><input class="chktbl" type="checkbox" id="<%= html.html_escape(watch.id) %>"<% if watch.selected == "t" then %> checked <% end %>></TD>
<TD <% if data.value.focus.value == watch.logdatetime then %> style="font-weight:bold;" id="focus" <% end %> ><%= html.link{value = "viewweblog?"..clientinfo..
<tr<%= mark %>>
<td><input class="chktbl" type="checkbox" id="<%= html.html_escape(watch.id) %>"<% if watch.selected == "t" then %> checked <% end %>></td>
<td <% if data.value.focus.value == watch.logdatetime then %> style="font-weight:bold;" id="focus" <% end %> ><%= html.link{value = "viewweblog?"..clientinfo..
"starttime="..os.date("%Y-%m-%d %H:%M:%S", time - 60*(tonumber(data.value.window.value)))..
"&endtime="..os.date("%Y-%m-%d %H:%M:%S", time + 60*(tonumber(data.value.window.value)))..
"&focus="..watch.logdatetime,
label=watch.logdatetime} %></TD>
<TD> <%= html.html_escape(watch.sourcename) %></TD>
<TD <% if data.value.clientip.value == watch.clientip then %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientip) %></TD>
<TD <% if data.value.clientuserid.value == watch.clientuserid then %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientuserid) %></TD>
<TD><%= html.html_escape(watch.bytes) %></TD>
<TD><% if watch.badyesno ~= "0" then %><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/dodgy.png' width='13' height='13'><% end %></TD>
<TD><% if watch.deniedyesno ~= "0" then %> <IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/denied.png' width='13' height='13'><% end %></TD>
<TD><% if watch.bypassyesno ~= "0" then %> <IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/bypass.png' width='13' height='13'><% end %></TD>
<TD><%= html.html_escape(watch.score) %></TD>
<TD<% if (watch.shortreason and watch.shortreason ~= "" and watch.reason and watch.reason ~= "") then %> title="<%= html.html_escape(watch.reason) %>"<% end %>>
label=watch.logdatetime} %></td>
<td> <%= html.html_escape(watch.sourcename) %></td>
<td <% if data.value.clientip.value == watch.clientip then %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientip) %></td>
<td <% if data.value.clientuserid.value == watch.clientuserid then %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientuserid) %></td>
<td><%= html.html_escape(watch.bytes) %></td>
<td><% if watch.badyesno ~= "0" then %><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/dodgy.png' width='13' height='13'><% end %></td>
<td><% if watch.deniedyesno ~= "0" then %> <img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/denied.png' width='13' height='13'><% end %></td>
<td><% if watch.bypassyesno ~= "0" then %> <img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/bypass.png' width='13' height='13'><% end %></td>
<td><%= html.html_escape(watch.score) %></td>
<td<% if (watch.shortreason and watch.shortreason ~= "" and watch.reason and watch.reason ~= "") then %> title="<%= html.html_escape(watch.reason) %>"<% end %>>
<% if (watch.shortreason and watch.shortreason ~= "") then %>
<%= html.html_escape(watch.shortreason) %>
<% elseif (watch.reason and watch.reason ~= "") then %>
<%= html.html_escape(watch.reason) %>
<% end %>
</TD>
<TD title="<%= html.html_escape(watch.uri) %>"><% highlight_uri=html.html_escape(watch.shorturi or watch.uri)
</td>
<td title="<%= html.html_escape(watch.uri) %>"><% highlight_uri=html.html_escape(watch.shorturi or watch.uri)
if watch.wordloc ~= nil then
if string.find(watch.wordloc, "|") then
badwords = format.string_to_table(watch.wordloc, "|")
......@@ -213,12 +210,12 @@ end %>
highlight_uri = string_highlight(highlight_uri, watch.wordloc, "yellow", "red")
end
end %>
<%= highlight_uri %></TD>
<TD><%= watch.wordloc %></TD>
</TR>
<%= highlight_uri %></td>
<td><%= watch.wordloc %></td>
</tr>
<% end %>
</TBODY>
</TABLE>
</tbody>
</table>
<% htmlviewfunctions.displaypagination(pagedata, page_info) %>
<% if data.errtxt then %>
......@@ -241,4 +238,3 @@ for n,v in pairs(data.value) do
end
htmlviewfunctions.displayform(data, nil, nil, page_info, 2)
end %>
</DL>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment