summaryrefslogtreecommitdiffstats
path: root/tinydns-listfiles-html.lsp
blob: 21bc6523bc25c55e5f464bb4248f44a3b4fcd048 (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
40
41
42
43
44
<% local form, viewlibrary, page_info, session = ... 
require("viewfunctions")
%>
<%
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
%>

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

<h1>Configuration</h1>
<h2>Edit/View existing Domains</h2>
<TABLE>
	<TR style="background:#eee;font-weight:bold;">
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
		<TD style="padding-right:20px;white-space:nowrap;text-align:right;" class="header">Size</TD>
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
		<TD style="white-space:nowrap;text-align:left;" class="header">File</TD>
	</TR>		
<% for i,file in ipairs(form.value) do %>
	<TR>
		<TD style="padding-right:20px;white-space:nowrap;">
			<% io.write(html.link{value = "delete?filename=" .. file.value.filename.value, label="Delete " }) %>
			<% io.write(html.link{value = "view?filename=" .. file.value.filename.value, label="View " }) %>
			<% io.write(html.link{value = "edit?filename=" .. file.value.filename.value, label="Edit " }) %>
			<% io.write(html.link{value = "editfile?filename=" .. file.value.filename.value, label="Expert " }) %>
		</TD>
		<TD style="padding-right:20px;white-space:nowrap;text-align:right;"><%= file.value.filesize.value %></TD>
		<TD style="padding-right:20px;white-space:nowrap;"><%= file.value.mtime.value %></TD>
		<TD style="white-space:nowrap;" width="90%"><%= file.value.filename.value %></TD>
	</TR>
<% end %>
</TABLE>

<% if viewlibrary and viewlibrary.dispatch_component and session.permissions.tinydns.newfile then
	local newfileform = viewlibrary.dispatch_component("newfile", nil, true) %>
<h2>Create new Domain</h2>
<%
	newfileform.action = "newfile"
	displayform(newfileform)
end %>