<%= 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") %>
Created Time : <%= Time.zone.parse(@report_obj.created_at.to_s).in_time_zone(@report_obj.location_network.timezone).strftime("%b %d %Y %H:%M:%S")%>(Network Time Zone)
<% unless @all_aps_uplinks_usage.blank? %>
<%@tot = {}%>
AP MAC |
<% if @network.id.to_s == '814'%>
SSID |
<% end %>
<%(@uplinks_type_count || []).each do |i|%>
Uplink Type <%= RouterInventory::UPLINK_TYPE[i.to_s]%> |
<% end %>
<%(@uplinks_type_count || []).each do |i|%>
Up |
Down |
Total |
<% end %>
<% (@all_aps_uplinks_usage || []).each do |key,val| %>
<%= @ri_name_mac[key].blank? ? key : "#{@ri_name_mac[key]} (#{key.last(8)})" %>
|
<% if @network.id.to_s == '814'%>
<%= val['ssid']%> |
<% end %>
<%(@uplinks_type_count || []).each do |i|%>
<% if val[i.to_s].present? %>
<%= number_to_human_size(val[i.to_s]['tx'])%> |
<%= number_to_human_size(val[i.to_s]['rx'])%> |
<%= number_to_human_size(val[i.to_s]['total'])%> |
<%
if @tot[i].blank?
@tot[i] = {}
@tot[i]['tx'] = 0
@tot[i]['rx'] = 0
@tot[i]['tot'] = 0
end
@tot[i]['tx'] += val[i.to_s]['tx']
@tot[i]['rx'] += val[i.to_s]['rx']
@tot[i]['tot'] += val[i.to_s]['total']
%>
<% else %>
- |
- |
- |
<% end %>
<% end %>
<% end %>
TOTAL | <%if network.id.to_s == '814'%> | <% end %>
<%(@uplinks_type_count || []).each do |i|%>
<%= number_to_human_size(@tot[i]['tx']) %> |
<%= number_to_human_size(@tot[i]['rx'])%> |
<%= number_to_human_size(@tot[i]['tot'])%> |
<% end %>
<% end %>
<% unless @top_aps_usage.blank? %>
Top 5 APs by Usage
AP MAC |
Down Stream |
Up Stream |
Total Usage |
<%legend = [];data=[];url=""%>
<% (@top_aps_usage || []).each do |x| %>
<%= @ri_name_mac[x["_id"]].blank? ? x["_id"] : "#{@ri_name_mac[x["_id"]]} (#{x["_id"].last(8)})" %> |
<%= number_to_human_size(x["rx"])%> |
<%= number_to_human_size(x["tx"])%> |
<%= number_to_human_size(x["total"])%> |
<% data.push(x["total"])
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
AP MAC |
Down Stream |
Up Stream |
Total Usage |
<%legend = [];data=[];url=""%>
<% (@top_clients_usage || []).each do |x| %>
<%= @ri_name_mac[x["_id"]].blank? ? x["_id"] : "#{@ri_name_mac[x["_id"]]} (#{x["_id"].last(8)})" %> |
<%= number_to_human_size(x["rx"])%> |
<%= number_to_human_size(x["tx"])%> |
<%= number_to_human_size(x["total"])%> |
<% data.push(x["total"])
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["name"]%> |
<%= number_to_human_size(x["rx"])%> |
<%= number_to_human_size(x["tx"])%> |
<%= number_to_human_size(x["total"])%> |
<% data.push(x["total"])
legend.push(x["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
NOTE:Clients count in below table has unique connected clients
Date |
Clients |
<%legend = [];data=[];url=""%>
<% (@no_of_clients || []).each do |x| %>
<% date = x["_id"]["d"].strftime("%Y-%m-%d") -%>
<%= date %> |
<%= x["count"]%> |
<% data.push(x["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
NOTE:Clients count in below table has unique connected clients
SSID NAME |
Clients |
Percentage |
<% sum = 0%>
<% (@no_of_clients_per_ssids || []).each do |x|
sum += x["count"]
end %>
<%legend = [];data=[];url=""%>
<% (@no_of_clients_per_ssids || []).each do |x| %>
<% name = NetworkSsid.find_by_id(x["_id"]).try(:ssid_name) -%>
<%= name %> |
<% count = x["count"] %>
<%= count %> |
<%= ((count * 100)/sum).round(1) %> % |
<% data.push(count)
legend.push(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 MAC |
Version |
<% (@aps_in_network || {}).each do |k, v| %>
<%= @ri_name_mac[k].blank? ? k : "#{@ri_name_mac[k]} (#{k.last(8)})" %> |
<%= v["version"].gsub('"',"") unless v["version"].blank? %> |
<% end %>
<%end%>
<%unless @ap_versions.blank?%>
AP List by Version
AP MAC |
Version |
<% (@ap_versions || []).each do |x| %>
<%= @ri_name_mac[x["_id"]["ap_mac"]].blank? ? x["_id"]["ap_mac"] : "#{@ri_name_mac[x["_id"]["ap_mac"]]} (#{x["_id"]["ap_mac"].last(8)})" %> |
<%= x["version"].last.gsub('"',"") unless x["version"].blank? %> |
<% end %>
<%end%>
<%unless @ap_geo_loc.blank?%>
AP List by Geo Location
AP MAC |
Address |
<% (@ap_geo_loc || []).each do |x| %>
<%= @ri_name_mac[x["_id"]["ap_mac"]].blank? ? x["_id"]["ap_mac"] : "#{@ri_name_mac[x["_id"]["ap_mac"]]} (#{x["_id"]["ap_mac"].last(8)})" %> |
<% ri = RouterInventory.where(mac_id: x["_id"]["ap_mac"]).last %>
<%= ri.city %>,<%= ri.country %> |
<% end %>
<%end%>
<%unless @aps_down_time.blank?%>
<% @tot_downtime = @non_func_aps = 0 %>
AP Down time
Total Number of Aps:<%= @aps_down_time.count%>
<% @aps_down_time.select{ |a| a["down_time"].select {|x| @non_func_aps += x['entire_period'] || 0}} %>
Number of Non-Functional Aps:<%= @non_func_aps%>
AP MAC |
Tags |
Downtime Period |
Total Downtime |
<% @aps_down_time.each do |x|
@tot_downtime = 0
if !x['down_time'].blank?
%>
<%= @ri_name_mac[x["mac"]].blank? ? x["mac"] : "#{@ri_name_mac[x["mac"]]} (#{x["mac"].last(8)})" %>
|
<%= x["tags"].join(', ') %> |
<% (x["down_time"] || []).each do |list| %>
<% unless list['down_secs'].to_i == 0 %>
<%= Time.zone.parse(list['est'].to_s).in_time_zone(x['timezone']).strftime('%Y-%m-%d %H:%M:%S') %> to <%= Time.zone.parse(list['eet'].to_s).in_time_zone(x['timezone']).strftime('%Y-%m-%d %H:%M:%S') %>
<% @tot_downtime += list['down_secs'].to_i %>
<% end %>
<% end %>
|
<%= ApplicationController.helpers.time_converter(@tot_downtime) %> |
<% end %>
<% end %>
<%end%>