mirror of
https://github.com/cmur2/openvpn-status-web.git
synced 2025-08-09 04:48:43 +02:00
gem: parse any number of list headers in status-version 2/3
This commit is contained in:
@@ -53,7 +53,7 @@ thead {
|
||||
<% status.client_list_headers.each_with_index do |header,i| %>
|
||||
<% if i == 0 %>
|
||||
<td class="first">
|
||||
<% elsif i == status.client_list_headers.length-1 %>
|
||||
<% elsif i == status.client_list_headers.size-1 %>
|
||||
<td class="last">
|
||||
<% else %>
|
||||
<td class="middle">
|
||||
@@ -67,13 +67,13 @@ thead {
|
||||
<% status.client_list_headers.each_with_index do |header,i| %>
|
||||
<% if i == 0 %>
|
||||
<td class="first">
|
||||
<% elsif i == status.client_list_headers.length-1 %>
|
||||
<% elsif i == status.client_list_headers.size-1 %>
|
||||
<td class="last">
|
||||
<% else %>
|
||||
<td class="middle">
|
||||
<% end %>
|
||||
<% if header =~ /(Received|Sent)/ %>
|
||||
<%= client[i].to_i.as_bytes %></td>
|
||||
<%= client[i].as_bytes %></td>
|
||||
<% elsif client[i].is_a? DateTime %>
|
||||
<%= client[i].strftime('%-d.%-m.%Y %H:%M:%S') %></td>
|
||||
<% else %>
|
||||
@@ -93,7 +93,7 @@ thead {
|
||||
<% status.routing_table_headers.each_with_index do |header,i| %>
|
||||
<% if i == 0 %>
|
||||
<td class="first">
|
||||
<% elsif i == status.routing_table_headers.length-1 %>
|
||||
<% elsif i == status.routing_table_headers.size-1 %>
|
||||
<td class="last">
|
||||
<% else %>
|
||||
<td class="middle">
|
||||
@@ -107,7 +107,7 @@ thead {
|
||||
<% status.routing_table_headers.each_with_index do |header,i| %>
|
||||
<% if i == 0 %>
|
||||
<td class="first">
|
||||
<% elsif i == status.routing_table_headers.length-1 %>
|
||||
<% elsif i == status.routing_table_headers.size-1 %>
|
||||
<td class="last">
|
||||
<% else %>
|
||||
<td class="middle">
|
||||
|
Reference in New Issue
Block a user