diff options
Diffstat (limited to 'weblog-adhocquery-html.lsp')
-rw-r--r-- | weblog-adhocquery-html.lsp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/weblog-adhocquery-html.lsp b/weblog-adhocquery-html.lsp index 7c3d804..0e381da 100644 --- a/weblog-adhocquery-html.lsp +++ b/weblog-adhocquery-html.lsp @@ -39,7 +39,7 @@ end </script> <% if form.value.result then %> - <h1><%= html.html_escape(form.value.result.label) %></h1> + <% local header_level = htmlviewfunctions.displaysectionstart(form.value.result, page_info) %> <% if #form.value.result.value == 0 then %> <p>No results, try adjusting query</p> <% else %> @@ -63,32 +63,26 @@ end </table> <% if viewlibrary.check_permission("downloadadhocquery") then %> - <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" > - <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> + <% local query = cfe({ type="hidden", value=form.value.query.value }) %> + <% local viewtype = cfe({ type="hidden", value="stream" }) %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={query=query, viewtype=viewtype}, label="Download query result", option="Download", action="downloadadhocquery" }), page_info, 0) %> <% end %> <% end %> + <% htmlviewfunctions.displaysectionend(header_level) %> <% end %> -<h1><%= html.html_escape(form.label) %></h1> -<% htmlviewfunctions.displayformstart(form, page_info) %> +<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %> <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 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.</p> -<% htmlviewfunctions.displayformitem(form.value.query, "query") %> -<% htmlviewfunctions.displayformend(form) %> +<% htmlviewfunctions.displayform(form, page_info, htmlviewfunctions.incrementheader(header_level)) %> -<h2>Available Database Tables</h2> -<h3>pubweblog and pubweblog_history</h3> +<% local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Available Database Tables"}), page_info, htmlviewfunctions.incrementheader(header_level)) %> +<% local header_level3 = htmlviewfunctions.displaysectionstart(cfe({label="pubweblog and pubweblog_history"}), page_info, htmlviewfunctions.incrementheader(header_level2)) %> <p>These tables contain the pre-purge and historical access logs respectively. The definition of the table is as follows:</p> <pre> ( @@ -110,8 +104,9 @@ The available database tables and descriptions are listed below.</p> id int, ) </pre> +<% htmlviewfunctions.displaysectionend(header_level3) %> -<h3>dbhistlog</h3> +<% htmlviewfunctions.displaysectionstart(cfe({label="dbhistlog"}), page_info, header_level3) %> <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> ( @@ -119,8 +114,9 @@ The available database tables and descriptions are listed below.</p> msgtext text ) </pre> +<% htmlviewfunctions.displaysectionend(header_level3) %> -<h3>source</h3> +<% htmlviewfunctions.displaysectionstart(cfe({label="source"}), page_info, header_level3) %> <p>This table contains the list of log file sources. The definition of the table is as follows:</p> <pre> ( @@ -133,8 +129,9 @@ The available database tables and descriptions are listed below.</p> enabled boolean ) </pre> +<% htmlviewfunctions.displaysectionend(header_level3) %> -<h3>usagestat</h3> +<% htmlviewfunctions.displaysectionstart(cfe({label="usagestat"}), page_info, header_level3) %> <p>This table contains a historical record of pages requested and blocked by hour. The definition of the table is as follows:</p> <pre> ( @@ -144,3 +141,6 @@ The available database tables and descriptions are listed below.</p> numblock integer ) </pre> +<% htmlviewfunctions.displaysectionend(header_level3) %> +<% htmlviewfunctions.displaysectionend(header_level2) %> +<% htmlviewfunctions.displaysectionend(header_level) %> |