summaryrefslogtreecommitdiffstats
path: root/logfiles-status-html.lsp
blob: 2b2fa9ede29450e675f0fe7703907e3a302341cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<% local view, viewlibrary, page_info, session  = ... %>
<% require("viewfunctions") %>

<% displaycommandresults({"delete"}, session) %>

<h1>Available Logfiles</h1>

<TABLE>
	<TR style="background:#eee;font-weight:bold;">
	<% if session.permissions.logfiles.delete then %>
		<TD style="padding-right:20px;white-space:nowrap;" class="header">Delete</TD>
	<% end %>
		<TD style="padding-right:20px;white-space:nowrap;" class="header">View</TD>
		<TD style="padding-right:20px;white-space:nowrap;" class="header">Tail</TD>
		<TD style="padding-right:20px;white-space:nowrap;" class="header">Save</TD>
		<TD style="padding-right:20px;white-space:nowrap;text-align:right;" class="header">Size</TD>
		<TD style="padding-right:20px;white-space:nowrap;" class="header">Last Modified</TD>
		<TD style="white-space:nowrap;" WIDTH="90%" class="header">File</TD>
	</TR>		

<% for i,file in ipairs(view.value) do %>
	<TR>
	<% if session.permissions.logfiles.delete then %>
		<TD style="padding-right:20px;white-space:nowrap;">
		<% if file.value.inuse.value then %>
			in use
		<% else %>
			<%= html.link{value = "delete?name="..file.value.filename.value, label="Delete" } %>
		<% end %></TD>
	<% end %>
		<TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "view?name="..file.value.filename.value, label="View" } %></TD>
		<TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "tail?name="..file.value.filename.value, label="Tail" } %></TD>
		<TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "download?name="..file.value.filename.value, label="Download" } %></TD>
		<TD style="padding-right:20px;white-space:nowrap;text-align:right"><%= html.html_escape(file.value.filesize.value) %></TD>
		<TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(file.value.mtime.value) %></TD>
		<TD style="white-space:nowrap;"><%= html.html_escape(file.value.filename.value) %></TD>
	</TR>		
<% end %>
</TABLE>