1
0
mirror of https://github.com/cmur2/openvpn-status-web.git synced 2025-06-29 10:30:23 +02:00

Use a status object

This commit is contained in:
cn
2013-05-03 18:30:34 +02:00
parent cd6e41fcfa
commit 438931f8a6
4 changed files with 18 additions and 6 deletions

View File

@ -55,7 +55,7 @@ thead {
<td class="last">Connected Since</td>
</thead>
<tbody>
<% client_list.each do |client| %>
<% status.client_list.each do |client| %>
<tr>
<td class="first"><%= client[0] %></td>
<td class="middle"><%= client[1] %></td>
@ -78,7 +78,7 @@ thead {
<td class="last">Last Ref</td>
</thead>
<tbody>
<% routing_table.each do |e| %>
<% status.routing_table.each do |e| %>
<tr>
<td class="first"><%= e[0] %></td>
<td class="middle"><%= e[1] %></td>
@ -94,7 +94,7 @@ thead {
<div>
<table>
<tbody>
<% global_stats.each do |e| %>
<% status.global_stats.each do |e| %>
<tr>
<td><%= e[0] %>:</td>
<td><%= e[1] %></td>

View File

@ -21,7 +21,11 @@ module OpenVPNStatusWeb
end
end
[client_list[2..-1], routing_table[1..-1], global_stats]
status = Status.new
status.client_list = client_list[2..-1]
status.routing_table = routing_table[1..-1]
status.global_stats = global_stats
status
end
end
end

View File

@ -0,0 +1,8 @@
module OpenVPNStatusWeb
class Status
attr_accessor :client_list
attr_accessor :routing_table
attr_accessor :global_stats
end
end