diff --git a/lib/openvpn-status-web/main.html.erb b/lib/openvpn-status-web/main.html.erb index e984e28..1d6b198 100644 --- a/lib/openvpn-status-web/main.html.erb +++ b/lib/openvpn-status-web/main.html.erb @@ -50,20 +50,36 @@ thead {
Common Name | -Real Address | -Data Received | -Data Sent | -Connected Since | +<% status.client_list_headers.each_with_index do |header,i| %> +<% if i == 0 %> ++<% elsif i == status.client_list_headers.length-1 %> + | +<% else %> + | +<% end %> + <%= header %> | +<% end %> <% status.client_list.each do |client| %>
<%= client[0] %> | -<%= client[1] %> | -<%= client[2].to_i.as_bytes %> | -<%= client[3].to_i.as_bytes %> | -<%= client[4].strftime('%-d.%-m.%Y %H:%M:%S') %> | +<% status.client_list_headers.each_with_index do |header,i| %> +<% if i == 0 %> ++<% elsif i == status.client_list_headers.length-1 %> + | +<% else %> + | +<% end %> +<% if header =~ /(Received|Sent)/ %> + <%= client[i].to_i.as_bytes %> | +<% elsif client[i].is_a? DateTime %> + <%= client[i].strftime('%-d.%-m.%Y %H:%M:%S') %> +<% else %> + <%= client[i] %> +<% end %> +<% end %>
Virtual Address | -Common Name | -Real Address | -Last Ref | +<% status.routing_table_headers.each_with_index do |header,i| %> +<% if i == 0 %> ++<% elsif i == status.routing_table_headers.length-1 %> + | +<% else %> + | +<% end %> + <%= header %> | +<% end %> <% status.routing_table.each do |route| %>
<%= route[0] %> | -<%= route[1] %> | -<%= route[2] %> | -<%= route[3].strftime('%-d.%-m.%Y %H:%M:%S') %> | +<% status.routing_table_headers.each_with_index do |header,i| %> +<% if i == 0 %> ++<% elsif i == status.routing_table_headers.length-1 %> + | +<% else %> + | +<% end %> +<% if route[i].is_a? DateTime %> + <%= route[i].strftime('%-d.%-m.%Y %H:%M:%S') %> | +<% else %> + <%= route[i] %> +<% end %> +<% end %>