Fixing MAC form and index
This commit is contained in:
parent
aa29f30f30
commit
c6bb164f73
|
@ -224,7 +224,7 @@ end
|
||||||
|
|
||||||
def arp_lookup
|
def arp_lookup
|
||||||
@ip = request.env['REMOTE_ADDR']
|
@ip = request.env['REMOTE_ADDR']
|
||||||
@arp = %x(/usr/sbin/arp -a | grep #{@ip})
|
@arp = /([0-9A-F]{2}[:-]){5}([0-9A-F]{2})/i.match(%x(arp -a | grep #{@ip}))
|
||||||
end
|
end
|
||||||
|
|
||||||
def scan
|
def scan
|
||||||
|
|
|
@ -2,14 +2,22 @@
|
||||||
<% if @mac_time_start_date.present? %>
|
<% if @mac_time_start_date.present? %>
|
||||||
<b>Most Active Machine Last <%= distance_of_time_in_words DateTime.now, @mac_time_start_date %>:</b>
|
<b>Most Active Machine Last <%= distance_of_time_in_words DateTime.now, @mac_time_start_date %>:</b>
|
||||||
<span title="<%= @most_active_mac.mac %><%= " - "+@most_active_mac.ip.to_s if can? :read_details, @most_active_mac %>">
|
<span title="<%= @most_active_mac.mac %><%= " - "+@most_active_mac.ip.to_s if can? :read_details, @most_active_mac %>">
|
||||||
<%= @most_active_mac.user.name unless @most_active_mac.user.blank? %>
|
<% if @most_active_mac.user.blank? %>
|
||||||
|
<%= @most_active_mac.mac %>
|
||||||
|
<% else %>
|
||||||
|
<%= @most_active_mac.user.name %>
|
||||||
|
<% end %>
|
||||||
<%= "("+@most_active_mac.note+")" unless @most_active_mac.note.blank? %>
|
<%= "("+@most_active_mac.note+")" unless @most_active_mac.note.blank? %>
|
||||||
- <%= (@most_active.last[:time] / 1.hour).round %> hrs
|
- <%= (@most_active.last[:time] / 1.hour).round %> hrs
|
||||||
</span>
|
</span>
|
||||||
<br/>
|
<br/>
|
||||||
<b>Runner Up:</b>
|
<b>Runner Up:</b>
|
||||||
<span title="<%= @runner_up_mac.mac %><%= " - "+@runner_up_mac.ip.to_s if can? :read_details, @runner_up_mac %>">
|
<span title="<%= @runner_up_mac.mac %><%= " - "+@runner_up_mac.ip.to_s if can? :read_details, @runner_up_mac %>">
|
||||||
<%= @runner_up_mac.user.name unless @runner_up_mac.user.blank? %>
|
<% if @runner_up_mac.user.blank? %>
|
||||||
|
<%= @runner_up_mac.mac %>
|
||||||
|
<% else %>
|
||||||
|
<%= @runner_up_mac.user.name %>
|
||||||
|
<% end %>
|
||||||
<%= "("+@runner_up_mac.note+")" unless @runner_up_mac.note.blank? %>
|
<%= "("+@runner_up_mac.note+")" unless @runner_up_mac.note.blank? %>
|
||||||
- <%= (@runner_up.last[:time] / 1.hour).round %> hrs
|
- <%= (@runner_up.last[:time] / 1.hour).round %> hrs
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user