diff options
Diffstat (limited to 'weblog-adhocquery-html.lsp')
-rw-r--r-- | weblog-adhocquery-html.lsp | 73 |
1 files changed, 35 insertions, 38 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 </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> |