1
0
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:
cn 2013-05-03 21:12:06 +02:00
parent a1a6b33902
commit c51968618d
2 changed files with 60 additions and 54 deletions

View File

@ -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)

View File

@ -42,6 +42,8 @@ thead {
</head> </head>
<body> <body>
<% vpns.each do |name,config| %>
<% status = stati[name] %>
<h1>OpenVPN Status for <%= name %></h1> <h1>OpenVPN Status for <%= name %></h1>
<h2>Client List</h2> <h2>Client List</h2>
@ -103,6 +105,7 @@ thead {
</tbody> </tbody>
</table> </table>
</div> </div>
<% end %>
</body> </body>
</html> </html>