dnscache-listdomains-html.lsp 1.15 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
<% local data, viewlibrary, page_info, session = ... 
2
require("htmlviewfunctions")
3
html = require("acf.html")
Natanael Copa's avatar
Natanael Copa committed
4
%>
Ted Trask's avatar
Ted Trask committed
5

6 7
<% htmlviewfunctions.displaycommandresults({"editdomain", "deletedomain"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createdomain"}, session, true) %>
8

Ted Trask's avatar
Ted Trask committed
9 10
<h1>Configuration</h1>
<h2>Edit/View DNS server entries</h2>
Ted Trask's avatar
Ted Trask committed
11
<DL><TABLE>
Ted Trask's avatar
Ted Trask committed
12 13 14 15
	<TR style="background:#eee;font-weight:bold;">
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
		<TD style="white-space:nowrap;text-align:left;" class="header">Domain</TD>
	</TR>		
Natanael Copa's avatar
Natanael Copa committed
16
<% for i,domain in ipairs(data.value) do %>
Ted Trask's avatar
Ted Trask committed
17 18
	<TR>
		<TD style="padding-right:20px;white-space:nowrap;">
19
			<% io.write(html.link{value = "editdomain?domain=" .. domain.."&redir="..page_info.orig_action, label="Edit " }) %>
Natanael Copa's avatar
Natanael Copa committed
20
			<% if domain ~= "@" then 
21
				io.write(html.link{value = "deletedomain?submit=true&domain=" .. domain, label="Delete " })
Natanael Copa's avatar
Natanael Copa committed
22
			end %>
Ted Trask's avatar
Ted Trask committed
23
		</TD>
24
		<TD style="white-space:nowrap;" width="90%"><%= html.html_escape(domain) %></TD>
Ted Trask's avatar
Ted Trask committed
25
	</TR>
Natanael Copa's avatar
Natanael Copa committed
26
<% end %>
Ted Trask's avatar
Ted Trask committed
27
</TABLE></DL>
Ted Trask's avatar
Ted Trask committed
28

Natanael Copa's avatar
Natanael Copa committed
29
<% if viewlibrary and viewlibrary.dispatch_component then
Ted Trask's avatar
Ted Trask committed
30
	viewlibrary.dispatch_component("createdomain")
Natanael Copa's avatar
Natanael Copa committed
31
end %>