Adjusting wording and stat counts

This commit is contained in:
Will Bradley 2013-10-02 04:57:46 -07:00
parent 370c82e075
commit 0eeaddabd7
4 changed files with 14 additions and 2 deletions

View File

@ -90,6 +90,7 @@ end
# GET /macs/1.json # GET /macs/1.json
def show def show
@mac = Mac.find(params[:id]) @mac = Mac.find(params[:id])
@mac_logs = MacLog.where(:mac => @mac.mac)
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb

View File

@ -17,7 +17,7 @@ class StatisticsController < ApplicationController
} }
@door_log_graph = [] @door_log_graph = []
@door_logs.group_by{|l| l.created_at.beginning_of_day}.each{|l| @door_log_graph << [l.first.to_time.to_i*1000,l.last.size]} @door_logs.where("key = 'G'").group_by{|l| l.created_at.beginning_of_day}.each{|l| @door_log_graph << [l.first.to_time.to_i*1000,l.last.size]}
respond_to do |format| respond_to do |format|
format.html format.html

View File

@ -23,5 +23,16 @@
<%= @mac.ip %> <%= @mac.ip %>
</p> </p>
<% if can? :read, MacLog %>
<p>
<b>Recent Log Entries:</b>
<ul>
<% @mac_logs.each do |log| %>
<li><%= log.created_at %></li>
<% end %>
</ul>
</p>
<% end %>
<%= link_to 'Edit', edit_mac_path(@mac) %> | <%= link_to 'Edit', edit_mac_path(@mac) %> |
<%= link_to 'Back', macs_path %> <%= link_to 'Back', macs_path %>

View File

@ -19,7 +19,7 @@ $(function() {
}, },
yAxis : { yAxis : {
title : { title : {
text : "Hours" text : "Accesses"
} }
}, },
series: [{ series: [{