summaryrefslogtreecommitdiffstats
path: root/openvpn-read-html.lsp
blob: b85fe3b2d8ddf4e1cf8eb99d3f4e21da3c680603 (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
<? local view = ... ?>
<? --[[ Notes
 conflistfiles = Filename on config-files
 test
 ]]-- ?>
<html>
<body>
<h1>Welcome</h1>
<h2>Available configs</h2>
<TABLE BORDER=0 WIDTH="100%">
	<TR style="background:#eee;font-weight:bold;vertical-align:top;">
		<TD WIDTH=100>Config</TD>
		<TD WIDTH=70>Type</TD>
		<TD WIDTH=70>Status</TD>
		<TD WIDTH=140>Connected Clients</TD>
		<TD>Notes</TD>
	</TR>		

<? for i = 1, table.maxn(view.conflistfiles) do ?>
	<TR >
		<TD><?= html.link{value = view.url .. "/" .. view.conflistfiles[i].type .. "_config?config=" .. view.conflistfiles[i].name , label=view.conflistfiles[i].name } ?></TD>
		<TD><?= view.conflistfiles[i].type ?></TD>
		<TD><?= view.conflistfiles[i].status ?></TD>
		<TD><? if view.conflistfiles[i].clients > 0 then ?><?= html.link{value = view.url .. "/status_info?name=" .. view.conflistfiles[i].name  , label=view.conflistfiles[i].clients } ?><? else ?><?= view.conflistfiles[i].clients ?><? end ?></TD>
		<TD style="color:red"><?= view.conflistfiles[i].err ?></TD>
	</TR>		
<? end ?>
</TABLE>

<h2>System info</h2>

<dt>Program version</dt>
<dd><?= view.version ?></dd>



</body>
</html>