summaryrefslogtreecommitdiffstats
path: root/tinydns-expert-html.lsp
blob: 83e8bf7ed50938fcebf3ef9bcd77e73fe8aa839a (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<? local form = ... 
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>")
--]]
?>


<H1>SYSTEM INFO</H1>	
<DL>
<? 
local myform = form.status 
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
</DL>

<h1>CONFIGURATION</h1>
<h2>Expert config</h2>
<h3>Edit/View existing configfiles</h3>
<DL>

<TABLE>
	<TR style="background:#eee;font-weight:bold;">
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD>
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD>
		<TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
	</TR>		
<? local myform = form.config ?>
<? for i = 1, table.maxn(myform) do ?>
	<TR>
		<TD style="padding-right:20px;white-space:nowrap;"><? io.write(html.link{value = "edit?name=" .. myform[i].filename.value , label=myform[i].filename.value }) ?></TD>
		<TD style="padding-right:20px;white-space:nowrap;"><? io.write(myform[i].filesize.value or "--") ?></TD>
		<TD style="white-space:nowrap;" width="90%"><? io.write(myform[i].mtime.value or "--") ?></TD>
	</TR>
<? end ?>
</TABLE>
</DL>

<h3>Create new configfile</h3>
<form action="<?= form.option.script .. "/" .. form.option.prefix ..
		form.option.controller .. "/" .. form.option.action ..
		(form.option.extra or "") ?>" method="POST">
<DL>
<? 
local myform = form.create
local tags = { "name", "cmdnew", }
displayinfo(myform,tags)
?>
</DL>
</form>

<form action="<?= form.option.script .. "/" .. form.option.prefix ..
		form.option.controller .. "/" .. form.option.action ..
		(form.option.extra or "") ?>" method="POST">
<?
-- Management buttons
local myform = form.management
local tags = { "start", "stop", "restart" }
if (myform) then
	io.write("<H1>MANAGEMENT</H1>\n<DL>")
	displaymanagement(myform,tags)
	io.write("</DL>")
end
?>
</form>