From 7dad3b2d66bfdc5d653961e8b4f87870106aaeee Mon Sep 17 00:00:00 2001
From: Ted Trask No results, try adjusting query Download query result This form accepts a Postgresql SELECT statement and displays the results. Examples:
<%= html.html_escape(form.value.result.label) %>
+ <%= html.html_escape(form.value.result.label) %>
<% if #form.value.result.value == 0 then %>
-
-
<% if viewlibrary.check_permission("downloadadhocquery") then %>
-
+
+
+
+
+
+
<% for i,name in ipairs(form.value.names.value) do %>
-
-
-
+
+
+
<% for i,row in ipairs(form.value.result.value) do %>
- <%= html.html_escape(name) %>
+ <%= html.html_escape(name) %>
<% end %>
-
+
<% for j,name in ipairs(form.value.names.value) do %>
-
+
<% end %>
-
- <%= html.html_escape(row[name]) %>
+ <%= html.html_escape(row[name]) %>
<% 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:
+
-The available database tables and descriptions are listed below.
+The available database tables and descriptions are listed below.SELECT clientuserid, sum(bytes) AS total FROM pubweblog GROUP BY clientuserid ORDER BY total DESC
SELECT clientuserid, sum(bytes) AS total FROM pubweblog WHERE logdatetime >= 'yesterday' and logdatetime < 'today' GROUP BY clientuserid ORDER BY total DESC
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
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, ) -
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 ) -
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 ) -
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 ) -
File | -Size | -Last Modified | -
---|
File | +Size | +Last Modified | +
---|---|---|
" .. html.html_escape(v.filename) .. ' | " .. html.html_escape(v.size) .." | " .. html.html_escape(v.mtime) .." |
Action | -Name | -Enabled | -Source | -Method | -
---|
Action | +Name | +Enabled | +Source | +Method | +
---|---|---|---|---|
+ | ||||
<%= 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) %> | + <% end %> - -
<%= html.html_escape(data.errtxt) %>
@@ -60,13 +59,16 @@ html = require("acf.html")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
+<% if data.value then %> Present <% else %> Missing <% end %> - - +
Date | -Message | -
---|
Date | +Message | +
---|---|
<%= html.html_escape(string.gsub(log.logdatetime, "%..*", "")) %> | -<%= html.html_escape(log.msgtext) %> | -
<%= html.html_escape(string.gsub(log.logdatetime, "%..*", "")) %> | +<%= html.html_escape(log.msgtext) %> | +
<%= html.html_escape(data.errtxt) %>
@@ -45,4 +44,3 @@ <% if #data.value == 0 then %>No history found
<% end %> -<% if data.value.groupby.value == "clientip" then %>Client IP<% else %>User ID<% end %> | -Total Requests | -Flagged Requests | -Total Score | -Blocked | -Overridden | -Maximum Score | -
---|
<% if data.value.groupby.value == "clientip" then %>Client IP<% else %>User ID<% end %> | +Total Requests | +Flagged Requests | +Total Score | +Blocked | +Overridden | +Maximum 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) %> |
<%= html.html_escape(data.errtxt) %>
@@ -64,7 +61,8 @@ <% end %>Date | -Source | -Requests | -Blocks | -
---|
Date | +Source | +Requests | +Blocks | +
---|---|---|---|
<%= 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) %> | +
<%= html.html_escape(data.errtxt) %>
@@ -52,4 +51,3 @@ <% if #data.value == 0 then %>No usage stats found
<% end %> -checked<% end %>> | -Timestamp | -Source | -Client IP | -User ID | -Size | -Sus | -Den | -Byp | -Score | -Reason | -URL | -Bad Words | -checked<% end %>> | +Timestamp | +Source | +Client IP | +User ID | +Size | +Sus | +Den | +Byp | +Score | +Reason | +URL | +Bad Words | + + + <% 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) %> -
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 %>![]() |
- <% if watch.deniedyesno ~= "0" then %> ![]() |
- <% if watch.bypassyesno ~= "0" then %> ![]() |
- <%= html.html_escape(watch.score) %> | -title="<%= html.html_escape(watch.reason) %>"<% end %>> + 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 %>![]() |
+ <% if watch.deniedyesno ~= "0" then %> ![]() |
+ <% if watch.bypassyesno ~= "0" then %> ![]() |
+ <%= html.html_escape(watch.score) %> | +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=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 %> | + <% end %> - -