<% vpns.each do |name,config| %> <% status = stati[name] %>

OpenVPN Status for <%= name %>

Client List

<% status.client_list_headers.each_with_index do |header,i| %> <% if i == 0 %> <% end %> <% status.client_list.each do |client| %> <% status.client_list_headers.each_with_index do |header,i| %> <% if i == 0 %> <% elsif client[i].is_a? DateTime %> <%= client[i].strftime('%-d.%-m.%Y %H:%M:%S') %> <% else %> <%= client[i] %> <% end %> <% end %> <% end %>
<% elsif i == status.client_list_headers.size-1 %> <% else %> <% end %> <%= header %>
<% elsif i == status.client_list_headers.size-1 %> <% else %> <% end %> <% if header =~ /(Received|Sent)/ %> <%= client[i].as_bytes %>

Routing Table

<% status.routing_table_headers.each_with_index do |header,i| %> <% if i == 0 %> <% end %> <% status.routing_table.each do |route| %> <% status.routing_table_headers.each_with_index do |header,i| %> <% if i == 0 %> <% else %> <%= route[i] %> <% end %> <% end %> <% end %>
<% elsif i == status.routing_table_headers.size-1 %> <% else %> <% end %> <%= header %>
<% elsif i == status.routing_table_headers.size-1 %> <% else %> <% end %> <% if route[i].is_a? DateTime %> <%= route[i].strftime('%-d.%-m.%Y %H:%M:%S') %>

Global Stats

<% status.global_stats.each do |global| %> <% end %>
<%= global[0] %>: <%= global[1] %>
<% end %>