summaryrefslogtreecommitdiffstats
path: root/openvpn-statusinfo-html.lsp
blob: c468e2c6f4b444e6a00f55ff2011098e9c687e28 (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
<% local view, viewlibrary, page_info, session = ... %>
<% html = require("acf.html") %>

<script type="text/javascript">
	if (typeof jQuery == 'undefined') {
		document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>');
	}
</script>

<script type="text/javascript">
	if (typeof $.tablesorter == 'undefined') {
		document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>');
	}
</script>

<script type="text/javascript">
	$(document).ready(function() {
		$("#list").tablesorter({widgets: ['zebra']});
	});
</script>

<% viewlibrary.dispatch_component("status") %>

<% viewlibrary.dispatch_component("viewconfig") %>

<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Status"}), page_info) %>
<% local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Connected clients"}), page_info, htmlviewfunctions.incrementheader(header_level)) %>
<table id="list" class="tablesorter"><thead>
	<tr>
		<th>Common Name<br/>Connected at</th>
		<th>Virtual Address</th>
		<th>Real Address</th>
		<th>Bytes<br/>Received</th>
		<th>Bytes<br/>Sent</th>
	</tr>
</thead><tbody>
<% for i in ipairs(view.value) do %>
	<tr>
		<td><%= html.html_escape(view.value[i].CN) %></td>
		<td><%= html.html_escape(view.value[i].VIRTADDR) %></td>
		<td><%= html.html_escape(view.value[i].REALADDR) %></td>
		<td><%= html.html_escape(view.value[i].BYTEsrcV) %></td>
		<td><%= html.html_escape(view.value[i].BYTESSND) %></td>
	</tr>
	<tr>
		<td colspan=5><%= html.html_escape(view.value[i].CONN) %></td>
	</tr>
<% end %>

</tbody></table>
<% htmlviewfunctions.displaysectionend(header_level2) %>
<% htmlviewfunctions.displaysectionend(header_level) %>