Adding most active mac and runner up stats

This commit is contained in:
2013-09-27 00:56:52 -07:00
parent 3ddfb3442b
commit e61ac5d32e
2 changed files with 65 additions and 1 deletions

View File

@@ -1,3 +1,17 @@
<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 %>">
<%= @most_active_mac.user.name unless @most_active_mac.user.blank? %>
<%= "("+@most_active_mac.note+")" unless @most_active_mac.note.blank? %>
- <%= (@most_active.last[:time] / 1.hour).round %> hrs
</span>
<br/>
<b>Runner Up:</b>
<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? %>
<%= "("+@runner_up_mac.note+")" unless @runner_up_mac.note.blank? %>
- <%= (@runner_up.last[:time] / 1.hour).round %> hrs
</span>
<h2>What machines are on our network?</h2>
<%= link_to "New MAC registration", new_mac_path if can? :create, Mac %>