summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2009-09-17 16:10:23 +0200
committerMika Havela <mika.havela@gmail.com>2009-09-17 16:10:23 +0200
commitd70f37d352c260200b0d7b710c6b33fd48868bd1 (patch)
treecc13ef080cb9c4cf2890004aed243933139ff60c
parent8044a8225aa46c9cb7cbc39920fabf5edd782b59 (diff)
downloadacf-weblog-d70f37d352c260200b0d7b710c6b33fd48868bd1.tar.bz2
acf-weblog-d70f37d352c260200b0d7b710c6b33fd48868bd1.tar.xz
Remodeled the looks of viewblocklog
Filtered values are highlighted in bold Standard rows are altered white/grey Bypassed url's are highlighted red background Page gets scrolled down to focused time/date. Current search-options are displayed below the input field. General modifications that causes the page to look better with different skins.
-rw-r--r--weblog-viewblocklog-html.lsp68
1 files changed, 39 insertions, 29 deletions
diff --git a/weblog-viewblocklog-html.lsp b/weblog-viewblocklog-html.lsp
index f7eb9b6..6f62c06 100644
--- a/weblog-viewblocklog-html.lsp
+++ b/weblog-viewblocklog-html.lsp
@@ -12,29 +12,38 @@
</script>
<% end %>
+<style type="text/css">
+ #content table { border-collapse: collapse; width: 100%; }
+ #content table td { border-bottom: none; white-space: nowrap; padding-right:20px; }
+ #content table tr.mark { background: #E9E9E9; }
+ #content table tr.markfocus { background: #E9E966; }
+ #content table tr.focus { background: #E9E900; }
+ #content table tr.bypass { background: #eaa; }
+ #content table td.reason { color: #000; padding-left: 20px; border-bottom:1px solid #999; }
+</style>
+
<H1>Search Parameters</H1>
<% if data.errtxt then %><p class="error"><%= html.html_escape(data.errtxt) %></p><% end %>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action) %>" method="POST">
<DL>
<DT>Start Time</DT>
-<DD><%= html.html_escape(data.value.starttime.value) %>
-<input class="text" type="text" name="starttime" value="<%= html.html_escape(data.value.starttime.value) %>" >
+<DD><input class="text" type="text" name="starttime" value="<%= html.html_escape(data.value.starttime.value) %>" >
+<p><%= html.html_escape(data.value.starttime.value) %></p>
<% if data.value.starttime.errtxt then %><p class="error"><%= html.html_escape(data.value.starttime.errtxt) %></p><% end %>
</DD>
<DT>User ID</DT>
-<DD><%= html.html_escape(data.value.clientuserid.value) %>
-<input class="text" type="text" name="clientuserid" value="<%= html.html_escape(data.value.clientuserid.value) %>" >
+<DD><input class="text" type="text" name="clientuserid" value="<%= html.html_escape(data.value.clientuserid.value) %>" >
+<p><%= html.html_escape(data.value.clientuserid.value) %></p>
<% if data.value.clientuserid.errtxt then %><p class="error"><%= html.html_escape(data.value.clientuserid.errtxt) %></p><% end %>
</DD>
<DT>Client IP</DT>
-<DD><%= html.html_escape(data.value.clientip.value) %>
-<input class="text" type="text" name="clientip" value="<%= html.html_escape(data.value.clientip.value) %>" >
+<DD><input class="text" type="text" name="clientip" value="<%= html.html_escape(data.value.clientip.value) %>" >
+<p><%= html.html_escape(data.value.clientip.value) %></p>
<% if data.value.clientip.errtxt then %><p class="error"><%= html.html_escape(data.value.clientip.errtxt) %></p><% end %>
</DD>
<DT>End Time</DT>
-<DD><%= html.html_escape(data.value.endtime
-.value) %>
-<input class="text" type="text" name="endtime" value="<%= html.html_escape(data.value.endtime.value) %>" >
+<DD><input class="text" type="text" name="endtime" value="<%= html.html_escape(data.value.endtime.value) %>" >
+<p><%= html.html_escape(data.value.endtime.value) %></p>
<% if data.value.endtime.errtxt then %><p class="error"><%= html.html_escape(data.value.endtime.errtxt) %></p><% end %>
</DD>
<DT></DT><DD><input class="submit" type="submit" name="Update" value="Update"></DD>
@@ -54,45 +63,46 @@ end
<H1><%= html.html_escape(data.label) %></H1>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
- <TD style="padding-right:20px;white-space:nowrap;" class="header">Timestamp</TD>
- <TD style="padding-right:20px;white-space:nowrap;" class="header"></TD>
- <TD style="padding-right:20px;white-space:nowrap;" class="header">Client IP</TD>
- <TD style="padding-right:20px;white-space:nowrap;" class="header">User ID</TD>
- <TD style="white-space:nowrap;" WIDTH="90%" class="header">Size</TD>
+ <TD class="header">Timestamp</TD>
+ <TD class="header">Client IP</TD>
+ <TD class="header">User ID</TD>
+ <TD class="header">Size</TD>
+ <TD WIDTH="90%" class="header">URL</TD>
</TR>
<% for i,watch in ipairs(data.value.log.value) do %>
+ <% local a,b = math.modf((i/2))
+ local mark = ''
+ if (b == 0) then mark=mark..'class="mark"' end
+ if string.find(watch.uri, "GBYPASS=") then mark='class="bypass"' end
+ %>
+
<% local time = {}
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) %>
- <% if data.value.focus and data.value.focus.value == watch.logdatetime then %>
- <TR style="background:#ff0" id="focus">
- <% else %>
- <TR style="background:#eee">
- <% end %>
- <TD colspan=2><%= html.link{value = "viewweblog?"..clientinfo..
+ <TR <%= mark %>>
+ <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.clientip) %></TD>
- <TD><%= html.html_escape(watch.clientuserid) %></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 title="<%= html.html_escape(watch.uri) %>" >
+ <%= html.link{value = watch.uri, label=string.gsub(watch.uri, "[;?].*", "...")} %></TD>
</TR>
- <TR><TD></TD>
- <TD <% if (watch.shortreason and watch.shortreason ~= "") or (watch.reason and watch.reason ~= "") then %>
- style="background:#f33; color:#fff" title="<%= html.html_escape(watch.reason) %>"<% end %> colspan=3>
+ <TR <%= mark %>>
+ <TD class='reason' <% if (watch.shortreason and watch.shortreason ~= "") or (watch.reason and watch.reason ~= "") then %>
+ title="<%= html.html_escape(watch.reason) %>"<% end %> colspan=5>
<% if watch.score and watch.score ~= "0" then %><%= html.html_escape(watch.score) %> - <% end %>
<% if (watch.shortreason and watch.shortreason ~= "") then %>
<%= html.html_escape(watch.shortreason) %>
<% elseif (watch.reason and watch.reason ~= "") then %>
<%= html.html_escape(string.gsub(watch.reason, "%(.*", "")) %>
<% end %>
- </TD>
- <TD <% if string.find(watch.uri, "GBYPASS=") then %> style="background:#ee1" <% end %>
- title="<%= html.html_escape(watch.uri) %>" >
- <%= html.link{value = watch.uri, label=string.gsub(watch.uri, "[;?].*", "...")} %></TD></TR>
+ </TD></TR>
<% end %>
</TABLE>