2012-08-25 06:28:00 +00:00
|
|
|
class DoorLogsController < ApplicationController
|
2012-09-16 10:24:54 +00:00
|
|
|
authorize_resource :except => :auto_download
|
|
|
|
before_filter :authenticate_user!, :except => :auto_download
|
2012-09-02 11:19:13 +00:00
|
|
|
|
2012-08-25 06:28:00 +00:00
|
|
|
# GET /door_logs
|
|
|
|
# GET /door_logs.json
|
|
|
|
def index
|
2012-12-16 03:37:44 +00:00
|
|
|
@door_logs = DoorLog.find(:all, :order => "created_at DESC", :limit => 500)
|
2012-08-25 06:28:00 +00:00
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html # index.html.erb
|
|
|
|
format.json { render :json => @door_logs }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-09-16 10:24:54 +00:00
|
|
|
# GET /door_logs/download
|
2012-08-25 06:28:00 +00:00
|
|
|
def download
|
|
|
|
@results = DoorLog.download_from_door
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html # show.html.erb
|
|
|
|
format.json { render :json => @results }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-09-16 10:24:54 +00:00
|
|
|
# GET /door_logs/auto_download
|
|
|
|
def auto_download
|
|
|
|
@results = DoorLog.download_from_door
|
2013-12-02 02:32:08 +00:00
|
|
|
@status = DoorLog.download_status # for space_api
|
2012-09-16 10:24:54 +00:00
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html # show.html.erb
|
|
|
|
format.json { render :json => @results }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2012-08-25 06:28:00 +00:00
|
|
|
end
|