diff --git a/lib/openvpn-status-web.rb b/lib/openvpn-status-web.rb index eb6dd76..3623449 100644 --- a/lib/openvpn-status-web.rb +++ b/lib/openvpn-status-web.rb @@ -7,9 +7,9 @@ require 'yaml' require 'rack' require 'metriks' +require 'openvpn-status-web/status' require 'openvpn-status-web/parser/v1' require 'openvpn-status-web/int_patch' -require 'openvpn-status-web/status' require 'openvpn-status-web/version' module OpenVPNStatusWeb @@ -37,7 +37,7 @@ module OpenVPNStatusWeb main_tmpl = read_template(File.join(File.dirname(__FILE__), 'openvpn-status-web/main.html.erb')) # variables for template name = @name - client_list, routing_table, global_stats = read_status_log(@file) + status = read_status_log(@file) html = main_tmpl.result(binding) [200, {"Content-Type" => "text/html"}, [html]] diff --git a/lib/openvpn-status-web/main.html.erb b/lib/openvpn-status-web/main.html.erb index 7270eed..71b09ee 100644 --- a/lib/openvpn-status-web/main.html.erb +++ b/lib/openvpn-status-web/main.html.erb @@ -55,7 +55,7 @@ thead {
<%= e[0] %>: | <%= e[1] %> | diff --git a/lib/openvpn-status-web/parser/v1.rb b/lib/openvpn-status-web/parser/v1.rb index f9485a8..9f45edc 100644 --- a/lib/openvpn-status-web/parser/v1.rb +++ b/lib/openvpn-status-web/parser/v1.rb @@ -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 diff --git a/lib/openvpn-status-web/status.rb b/lib/openvpn-status-web/status.rb index e69de29..8dbd39a 100644 --- a/lib/openvpn-status-web/status.rb +++ b/lib/openvpn-status-web/status.rb @@ -0,0 +1,8 @@ + +module OpenVPNStatusWeb + class Status + attr_accessor :client_list + attr_accessor :routing_table + attr_accessor :global_stats + end +end