From 7dad3b2d66bfdc5d653961e8b4f87870106aaeee Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 3 Feb 2014 21:59:49 +0000 Subject: Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags --- weblog-adhocquery-html.lsp | 73 +++++++++++++++++----------------- weblog-listfiles-html.lsp | 20 +++++----- weblog-listsources-html.lsp | 52 +++++++++++++------------ weblog-status-html.lsp | 14 +++---- weblog-viewactivitylog-html.lsp | 26 ++++++------- weblog-viewauditstats-html.lsp | 52 ++++++++++++------------- weblog-viewusagestats-html.lsp | 42 ++++++++++---------- weblog-viewweblog-html.lsp | 86 ++++++++++++++++++++--------------------- 8 files changed, 176 insertions(+), 189 deletions(-) diff --git a/weblog-adhocquery-html.lsp b/weblog-adhocquery-html.lsp index f60397c..7c3d804 100644 --- a/weblog-adhocquery-html.lsp +++ b/weblog-adhocquery-html.lsp @@ -39,57 +39,57 @@ end <% if form.value.result then %> -

<%= html.html_escape(form.value.result.label) %>

+

<%= html.html_escape(form.value.result.label) %>

<% if #form.value.result.value == 0 then %>

No results, try adjusting query

<% else %> - - - +
+ + <% for i,name in ipairs(form.value.names.value) do %> - + <% end %> - - - + + + <% for i,row in ipairs(form.value.result.value) do %> - + <% for j,name in ipairs(form.value.names.value) do %> - + <% end %> - + <% end %> - -
<%= html.html_escape(name) %><%= html.html_escape(name) %>
<%= html.html_escape(row[name]) %><%= html.html_escape(row[name]) %>
+ + <% if viewlibrary.check_permission("downloadadhocquery") then %> -
+ -
-
Download query result
-
-
+

Download query result

+
+ +
+ <% end %> <% end %> <% end %> -

<%= html.html_escape(form.label) %>

+

<%= html.html_escape(form.label) %>

<% htmlviewfunctions.displayformstart(form, page_info) %> -This form accepts a Postgresql SELECT statement and displays the results. Examples: +

This form accepts a Postgresql SELECT statement and displays the results. Examples:

-The available database tables and descriptions are listed below. +The available database tables and descriptions are listed below.

<% htmlviewfunctions.displayformitem(form.value.query, "query") %> <% htmlviewfunctions.displayformend(form) %> -

Available Database Tables

-

pubweblog and pubweblog_history

-
-These tables contain the pre-purge and historical access logs respectively. The definition of the table is as follows: +

Available Database Tables

+

pubweblog and pubweblog_history

+

These tables contain the pre-purge and historical access logs respectively. The definition of the table is as follows:

 (
     sourcename character varying(40),
@@ -109,21 +109,19 @@ These tables contain the pre-purge and historical access logs respectively. The
     selected boolean,
     id int,
 )
-
+ -

dbhistlog

-
-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: +

dbhistlog

+

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:

 (
     logdatetime timestamp(3) without time zone NOT NULL,
     msgtext text
 )
-
+ -

source

-
-This table contains the list of log file sources. The definition of the table is as follows: +

source

+

This table contains the list of log file sources. The definition of the table is as follows:

 (
     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
 )
-
+ -

usagestat

-
-This table contains a historical record of pages requested and blocked by hour. The definition of the table is as follows: +

usagestat

+

This table contains a historical record of pages requested and blocked by hour. The definition of the table is as follows:

 (
     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
 )
-
+ diff --git a/weblog-listfiles-html.lsp b/weblog-listfiles-html.lsp index fcca5b3..673afa8 100644 --- a/weblog-listfiles-html.lsp +++ b/weblog-listfiles-html.lsp @@ -37,17 +37,15 @@ end <% htmlviewfunctions.displaycommandresults({"editfile"}, session) %> -

File List

-
- - - - - - - +

File List

+
FileSizeLast Modified
+ + + + + + <% for k,v in ipairs( view.value ) do io.write( "\n" ) end %> -
FileSizeLast Modified
" .. html.html_escape(v.filename) .. ''..convertsize(v.size).."b" .. html.html_escape(v.size) .."" .. html.html_escape(v.mtime) .."
-
+ diff --git a/weblog-listsources-html.lsp b/weblog-listsources-html.lsp index 7f71bdb..11682a3 100644 --- a/weblog-listsources-html.lsp +++ b/weblog-listsources-html.lsp @@ -24,32 +24,31 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"deletesource", "editsource", "testsource", "createsource", "importlogs"}, session) %>

<%= html.html_escape(data.label) %>

-
- - - - - - - - - +
ActionNameEnabledSourceMethod
+ + + + + + + + <% for i,source in ipairs(data.value) do %> - - + - - - - - + + + + + + <% end %> - -
ActionNameEnabledSourceMethod
+
<%= 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 "} %> - <%= html.html_escape(source.sourcename) %><%= html.html_escape(tostring(source.enabled)) %><%= html.html_escape(source.source) %><%= html.html_escape(source.method) %>
<%= html.html_escape(source.sourcename) %><%= html.html_escape(tostring(source.enabled)) %><%= html.html_escape(source.source) %><%= html.html_escape(source.method) %>
+ + <% if data.errtxt then %>

<%= html.html_escape(data.errtxt) %>

@@ -60,13 +59,16 @@ html = require("acf.html")
"> -
Create New Source
+

Create New Source

+
-
+ +
"> -
Import Logs
-
+

Import Logs

+
+ +
-
diff --git a/weblog-status-html.lsp b/weblog-status-html.lsp index 6b05dfc..2eb2fb5 100644 --- a/weblog-status-html.lsp +++ b/weblog-status-html.lsp @@ -4,8 +4,7 @@ htmlviewfunctions = require("htmlviewfunctions") <% htmlviewfunctions.displaycommandresults({"createdatabase"}, session, true) %> -

Weblog Database Status

-
+

Weblog Database Status

<% 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 %> -
Database status
+

Database status

+

<% if status then %> <% if status.value.status.errtxt then print(status.value.status.errtxt) @@ -23,16 +23,16 @@ end %> <% else %> Unknown <% end %> -

+

-
Weblog Database
+

Weblog Database

+

<% if data.value then %> Present <% else %> Missing <% end %> -

-
+

<% if not data.value and viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("createdatabase") diff --git a/weblog-viewactivitylog-html.lsp b/weblog-viewactivitylog-html.lsp index f541d91..f7fb0ba 100644 --- a/weblog-viewactivitylog-html.lsp +++ b/weblog-viewactivitylog-html.lsp @@ -22,22 +22,21 @@ <% local subdata, pagedata = htmlviewfunctions.paginate(data.value, page_info.clientdata, 100) %> -

<%= html.html_escape(data.label) %>

-
+

<%= html.html_escape(data.label) %>

<% htmlviewfunctions.displaypagination(pagedata, page_info) %> - - - - - - +
DateMessage
+ + + + + <% for i,log in ipairs(subdata) do %> - - - - + + + + <% end %> -
DateMessage
<%= html.html_escape(string.gsub(log.logdatetime, "%..*", "")) %><%= html.html_escape(log.msgtext) %>
<%= html.html_escape(string.gsub(log.logdatetime, "%..*", "")) %><%= html.html_escape(log.msgtext) %>
+ <% if data.errtxt then %>

<%= html.html_escape(data.errtxt) %>

@@ -45,4 +44,3 @@ <% if #data.value == 0 then %>

No history found

<% end %> -
diff --git a/weblog-viewauditstats-html.lsp b/weblog-viewauditstats-html.lsp index f3cb575..dfee345 100644 --- a/weblog-viewauditstats-html.lsp +++ b/weblog-viewauditstats-html.lsp @@ -26,35 +26,32 @@ <% htmlviewfunctions.displaycommandresults({"completeaudit"}, session) %> -

Audit Parameters

-
+

Audit Parameters

<% htmlviewfunctions.displayitem(data.value.auditstart) %> <% htmlviewfunctions.displayitem(data.value.auditend) %> -
-

<%= html.html_escape(data.label) %>

-
- - - - - - - - - - - +

<%= html.html_escape(data.label) %>

+
<% if data.value.groupby.value == "clientip" then %>Client IP<% else %>User ID<% end %>Total RequestsFlagged RequestsTotal ScoreBlockedOverriddenMaximum Score
+ + + + + + + + + + <% for i,stat in ipairs(data.value.stats.value) do %> - - - - - - - + + + + + + + <% end %> -
<% if data.value.groupby.value == "clientip" then %>Client IP<% else %>User ID<% end %>Total RequestsFlagged RequestsTotal ScoreBlockedOverriddenMaximum Score
<%= html.link{value = "viewweblog?"..data.value.groupby.value.."="..stat[data.value.groupby.value], label=stat[data.value.groupby.value]} %><%= html.html_escape(stat.numrecords) %><%= html.html_escape(stat.numflagged) %><%= html.html_escape(stat.numhits) %><%= html.html_escape(stat.numdenied) %><%= html.html_escape(stat.numbypassed) %><%= html.html_escape(stat.maxscore) %>
<%= html.link{value = "viewweblog?"..data.value.groupby.value.."="..stat[data.value.groupby.value], label=stat[data.value.groupby.value]} %><%= html.html_escape(stat.numrecords) %><%= html.html_escape(stat.numflagged) %><%= html.html_escape(stat.numhits) %><%= html.html_escape(stat.numdenied) %><%= html.html_escape(stat.numbypassed) %><%= html.html_escape(stat.maxscore) %>
+ <% if data.errtxt then %>

<%= html.html_escape(data.errtxt) %>

@@ -64,7 +61,8 @@ <% end %>
"> -
Complete Audit
-
+

Complete Audit

+
+ +
-
diff --git a/weblog-viewusagestats-html.lsp b/weblog-viewusagestats-html.lsp index 6d27669..7bea2f9 100644 --- a/weblog-viewusagestats-html.lsp +++ b/weblog-viewusagestats-html.lsp @@ -16,35 +16,34 @@ <% local subdata, pagedata = htmlviewfunctions.paginate(data.value, page_info.clientdata, 100) %> -

<%= html.html_escape(data.label) %>

-
+

<%= html.html_escape(data.label) %>

<% htmlviewfunctions.displaypagination(pagedata, page_info) %> - - - - - - - - - - +
DateSourceRequestsBlocks
+ + + + + + + + + <% for i,stat in ipairs(subdata) do %> - - - - - - + + + + + + <% end %> - -
DateSourceRequestsBlocks
<%= html.html_escape(stat.date) %><%= html.html_escape(stat.sourcename) %><%= html.html_escape(stat.numrequest) %><%= html.html_escape(stat.numblock) %>
<%= html.html_escape(stat.date) %><%= html.html_escape(stat.sourcename) %><%= html.html_escape(stat.numrequest) %><%= html.html_escape(stat.numblock) %>
+ + <% if data.errtxt then %>

<%= html.html_escape(data.errtxt) %>

@@ -52,4 +51,3 @@ <% if #data.value == 0 then %>

No usage stats found

<% end %> -
diff --git a/weblog-viewweblog-html.lsp b/weblog-viewweblog-html.lsp index c3b64f8..8841bde 100644 --- a/weblog-viewweblog-html.lsp +++ b/weblog-viewweblog-html.lsp @@ -117,8 +117,7 @@ end } -

Search Parameters

-
+

Search Parameters

<% -- 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 %> -
<% local clientinfo = "submit=true&badyesno=false&deniedyesno=false&bypassyesno=false&selected=false&" @@ -144,11 +142,10 @@ end %> <% htmlviewfunctions.displaypagination(pagedata, page_info) %> -

<%= html.html_escape(data.label) %>

-
- - - +

<%= html.html_escape(data.label) %>

+
+ + <% 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 %> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + <% 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) %> -> - - + - - - - - - - - - title="<%= html.html_escape(watch.reason) %>"<% end %>> + label=watch.logdatetime} %> + + + + + + + + + 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 %> - - + - - + <%= highlight_uri %> + + <% end %> - -
checked<% end %>>TimestampSourceClient IPUser IDSizeSusDenBypScoreReasonURLBad Words
checked<% end %>>TimestampSourceClient IPUser IDSizeSusDenBypScoreReasonURLBad Words
checked <% end %>> style="font-weight:bold;" id="focus" <% end %> ><%= html.link{value = "viewweblog?"..clientinfo.. +> + checked <% end %>> 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} %> <%= html.html_escape(watch.sourcename) %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientip) %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientuserid) %><%= html.html_escape(watch.bytes) %><% if watch.badyesno ~= "0" then %><% end %><% if watch.deniedyesno ~= "0" then %> <% end %><% if watch.bypassyesno ~= "0" then %> <% end %><%= html.html_escape(watch.score) %> <%= html.html_escape(watch.sourcename) %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientip) %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientuserid) %><%= html.html_escape(watch.bytes) %><% if watch.badyesno ~= "0" then %><% end %><% if watch.deniedyesno ~= "0" then %> <% end %><% if watch.bypassyesno ~= "0" then %> <% end %><%= html.html_escape(watch.score) %><% highlight_uri=html.html_escape(watch.shorturi or 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 %><%= watch.wordloc %>
<%= watch.wordloc %>
+ + <% 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 %> -
-- cgit v1.2.3