1
0
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:
cn
2022-01-18 01:56:15 +01:00
committed by Christian Nicolai
parent 39d2b3ce94
commit 528709c895
5 changed files with 39 additions and 25 deletions

View File

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