summaryrefslogtreecommitdiffstats
path: root/openvpn-status-html.lsp
blob: 7f020f4098e62f3e0962a6cb879915570fdcb336 (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 view = ... ?>
<h1>SYSTEM INFO</h1>

<dl>
<dt>Program version</dt>
<DD><?= view.version ?></DD>
</dl>

<H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2>

<H3>Available configs (Click on config-name to see details)</H3>
<TABLE>
	<TR style="background:#eee;font-weight:bold;vertical-align:top;">
		<TD class="header">Config</TD>
		<TD class="header">Type</TD>
		<TD class="header">Status</TD>
		<TD class="header">Connected<BR>Clients</TD>
		<TD class="header">Notes</TD>
	</TR>		

<? for i = 1, table.maxn(view.conflistfiles) do ?>
	<TR >
		<TD><?= html.link{value = view.url .. "/" .. view.conflistfiles[i].type .. "_config?name=" .. 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].type == "server" ) then ?><? 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 ?><? end ?></TD>
		<TD style="color:red"><i><?= view.conflistfiles[i].err ?></i></TD>
	</TR>		
<? end ?>

<? if (#view.conflistfiles == 0) then ?>
	<TR>
	<TD colspan=3>(No existing config-files)</TD>
	</TR>
<? end ?>
</TABLE>

<?
--[[ DEBUG INFORMATION
require("debugs")
io.write(debugs.variables(view))
--]]
?>