<%= wicked_pdf_image_tag 'logo.png' %>
Report Name : <%= @report_obj.title%>
Network Name : <%= @report_obj.location_network.network_name %>
Time Range : <%= @report_obj.from_time.strftime("%b %d %Y")+" to "+ @report_obj.to_time.strftime("%b %d %Y") %>
<% unless @top_aps_usage.blank? %>
Top 5 APs by Usage
MAC ID |
Down Stream |
Up Stream |
Total Usage |
<%legend = [];data=[];url=""%>
<% (@top_aps_usage || []).each do |x| %>
<%= x["_id"]%> |
<%= number_to_human_size(x["rx"])%> |
<%= number_to_human_size(x["tx"])%> |
<%= number_to_human_size(x["total_usage"])%> |
<% data.push(x["total_usage"])
legend.push(x["_id"])
%>
<% end %>
|
<% url = Gchart.pie_3d(:title=>"", :legend => legend, :data => data, :size => '220x220') %>
<%= image_tag(url) unless url.blank? %> |
|
<% end %>
<% unless @top_clients_usage.blank? %>
Top 5 Clients by Usage
MAC ID |
Down Stream |
Up Stream |
Total Usage |
<%legend = [];data=[];url=""%>
<% (@top_clients_usage || []).each do |x| %>
<%= x["_id"]%> |
<%= number_to_human_size(x["rx"])%> |
<%= number_to_human_size(x["tx"])%> |
<%= number_to_human_size(x["total_usage"])%> |
<% data.push(x["total_usage"])
legend.push(x["_id"])%>
<% end %>
|
<%url = Gchart.pie_3d(:title=>"", :legend => legend, :data => data, :size => '220x220') %>
<%= image_tag(url) unless url.blank? %> |
|
<% end %>
<% unless @usage_per_ssid.blank? %>
Usage per SSID
SSID Name |
Down Stream |
Up Stream |
Total Usage |
<%legend = [];data=[];url=""%>
<% (@usage_per_ssid || []).each do |x| %>
<%= x["_id"]["name"]%> |
<%= number_to_human_size(x["rx"])%> |
<%= number_to_human_size(x["tx"])%> |
<%= number_to_human_size(x["total_usage"])%> |
<% data.push(x["total_usage"])
legend.push(x["_id"]["name"])%>
<% end %>
|
<%url = Gchart.pie_3d(:title=>"", :legend => legend, :data => data,:axis_range => [nil, [2,17,5]]) %>
<%= image_tag(url) unless url.blank? %> |
|
<%end%>
<% unless @no_of_clients.blank? %>
Number of connected Clients
SSID NAME |
Date |
Clients |
<%legend = [];data=[];url=""%>
<% (@no_of_clients || []).each do |x| %>
<%= x["_id"]['name']%> |
<% if x["_id"]['day']
date = x["_id"]['month'].to_s+"-"+x["_id"]['day'].to_s
elsif x["_id"]['week']
date = x["_id"]['year'].to_s[-2,4]+" ,"+x["_id"]['week'].to_s
elsif x["_id"]['month']
date = x["_id"]['year'].to_s[-2,4]+"-"+x["_id"]['month'].to_s
elsif x["_id"]['year']
date = x["_id"]['year'].to_s
end
%>
<%= date%> |
<%= x["macs"].count%> |
<% data.push(x["macs"].count)
legend.push(date) %>
<% end %>
|
<%url = Gchart.bar(:data => data,:axis_with_labels => ['x', 'y'],:axis_labels => [legend], :encoding => 'text', :max_value =>:auto, :bar_width_and_spacing => '55,6') %>
<%= image_tag(url) unless url.blank? %> |
|
<%end%>
<% unless @no_of_clients_per_ssids.blank? %>
Number of connected Clients per SSID
SSID NAME |
Clients |
Percentage |
<% sum = 0%>
<% (@no_of_clients_per_ssids || []).each do |x|
sum += x["macs"].size
end %>
<%legend = [];data=[];url=""%>
<% (@no_of_clients_per_ssids || []).each do |x| %>
<%= x["_id"]["name"]%> |
<% count = x["macs"].size %>
<%= count %> |
<%= ((count*100)/sum).round(1) %> % |
<% data.push(count)
legend.push(x["_id"]["name"])%>
<% end %>
|
<%url = Gchart.pie_3d(:title=>"", :legend => legend, :data => data, :size => '220x220') %>
<%= image_tag(url) unless url.blank? %> |
|
<%end%>
<%unless @aps_in_network.blank?%>
AP List
AP |
<% (@aps_in_network || []).each do |x| %>
<%= x %> |
<% end %>
<%end%>
<%unless @ap_versions.blank?%>
AP List by Version
AP |
Version |
<% (@ap_versions || []).each do |x| %>
<%= x["_id"]["ap_mac"] %> |
<%= x["version"].last.gsub('"',"") unless x["version"].blank? %> |
<% end %>
<%end%>
<%unless @ap_geo_loc.blank?%>
AP List by Geo Location
AP |
Address |
<% (@ap_geo_loc || []).each do |x| %>
<%= x["_id"]["ap_mac"] %> |
<% ri = RouterInventory.where(mac_id: x["_id"]["ap_mac"]).last %>
<%= ri.city %>,<%= ri.country %> |
<% end %>
<%end%>