mirror of
https://github.com/cmur2/openvpn-status-web.git
synced 2024-12-22 22:54:24 +01:00
Show multiple vpns
This commit is contained in:
parent
a1a6b33902
commit
c51968618d
@ -43,8 +43,11 @@ module OpenVPNStatusWeb
|
|||||||
return [404, {"Content-Type" => "text/plain"}, ["Not Found"]] if env["PATH_INFO"] != "/"
|
return [404, {"Content-Type" => "text/plain"}, ["Not Found"]] if env["PATH_INFO"] != "/"
|
||||||
|
|
||||||
# variables for template
|
# variables for template
|
||||||
name = @vpns.keys.first
|
vpns = @vpns
|
||||||
status = parse_status_log(@vpns[name])
|
stati = {}
|
||||||
|
@vpns.each do |name,config|
|
||||||
|
stati[name] = parse_status_log(config)
|
||||||
|
end
|
||||||
# eval
|
# eval
|
||||||
html = @main_tmpl.result(binding)
|
html = @main_tmpl.result(binding)
|
||||||
|
|
||||||
|
@ -42,11 +42,13 @@ thead {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>OpenVPN Status for <%= name %></h1>
|
<% vpns.each do |name,config| %>
|
||||||
|
<% status = stati[name] %>
|
||||||
|
<h1>OpenVPN Status for <%= name %></h1>
|
||||||
|
|
||||||
<h2>Client List</h2>
|
<h2>Client List</h2>
|
||||||
<div>
|
<div>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<td class="first">Common Name</td>
|
<td class="first">Common Name</td>
|
||||||
<td class="middle">Real Address</td>
|
<td class="middle">Real Address</td>
|
||||||
@ -65,12 +67,12 @@ thead {
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Routing Table</h2>
|
<h2>Routing Table</h2>
|
||||||
<div>
|
<div>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<td class="first">Virtual Address</td>
|
<td class="first">Virtual Address</td>
|
||||||
<td class="middle">Common Name</td>
|
<td class="middle">Common Name</td>
|
||||||
@ -87,12 +89,12 @@ thead {
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Global Stats</h2>
|
<h2>Global Stats</h2>
|
||||||
<div>
|
<div>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% status.global_stats.each do |e| %>
|
<% status.global_stats.each do |e| %>
|
||||||
<tr>
|
<tr>
|
||||||
@ -101,8 +103,9 @@ thead {
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user