99 lines
2.7 KiB
Plaintext
Executable File
99 lines
2.7 KiB
Plaintext
Executable File
<h1>Door Logs</h1>
|
|
|
|
<%= link_to 'Download Door Logs', download_path %>
|
|
<a href="#" onclick="$('#log-guide').toggle();">Show Log Guide</a>
|
|
<div id="log-guide" style="display: none;">
|
|
<pre>
|
|
Guide to Card Number storage:
|
|
cardnum = (R+(r*32767)), convert to hex
|
|
|
|
Guide to log keys and data:
|
|
|
|
Commands:
|
|
* rem_ = remote command issues via web UI (#=user id)
|
|
Statuses:
|
|
* armed = current status of alarm arming
|
|
* activated = current status of alarm ringing
|
|
* alarm_2 = current status of alarm sensor 2
|
|
* alarm_3 = current status of alarm sensor 3
|
|
* door_1_locked = status of door 1
|
|
* door_2_locked = status of door 2
|
|
Log Entries:
|
|
* A=alarm armed (# level)
|
|
* a=added user (# usernum)
|
|
* C=keypad command (# command)
|
|
* c=second half
|
|
* c=checked user (0=failed, #=found usernum)
|
|
* D=denied access (# card num)
|
|
* d=second half
|
|
* d=deleted user (# usernum)
|
|
* E=second (#=second)
|
|
* F=priv fail (0=wrong pw, 1=too many attempts, 2=not logged in)
|
|
* f=second half
|
|
* f=card fail (#=usermask)
|
|
* G=granted access (# card num)
|
|
* g=second half of card
|
|
* H=hour (#=hour)
|
|
* i=attempt to write to invalid eeprom address (# usernum)
|
|
* I=attempt to delete from invalid eeprom address (# usernum)
|
|
* L=locked (1=door1, 2=door2, 3=bedtime)
|
|
* M=minute (#=minute)
|
|
* m=alarm state (# level)
|
|
* p=power restored / arduino boot (1)
|
|
* R=read tag (# card num)
|
|
* r=second half of tag
|
|
* Q=superuser authed (#=superuser)
|
|
* S=auth (0=privileged mode enabled)
|
|
* s=alarm sensor (# zone)
|
|
* t=alarm trained (#=sensor value)
|
|
* T=alarm triggered (0)
|
|
* U=unlocked door (1=door1, 2=door2, # card num)
|
|
* u=second half of card
|
|
* Z=user db cleared (0)
|
|
* z=log cleared (0)
|
|
</pre>
|
|
</div>
|
|
<table>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th>Key</th>
|
|
<th>Data</th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
</tr>
|
|
|
|
<% @divided_tmp = nil %>
|
|
<% @door_logs.each do |door_log| %>
|
|
<tr>
|
|
<td><%= door_log.created_at %></td>
|
|
<td><%= door_log.key %></td>
|
|
<td><%= door_log.data %></td>
|
|
<%
|
|
if door_log.key == 'r' || door_log.key == 'd' ||door_log.key == 'g'
|
|
@divided_tmp = door_log.data.to_i
|
|
elsif (door_log.key == 'R' || door_log.key == 'D' || door_log.key == 'G') && !@divided_tmp.nil? %>
|
|
<td>
|
|
<%= case door_log.key
|
|
when 'R'
|
|
"Read"
|
|
when 'D'
|
|
"Denied"
|
|
when 'G'
|
|
"Granted"
|
|
end %>
|
|
<% @cardnum = (door_log.data.to_i+(@divided_tmp*32767)).to_s(16) %>
|
|
<%= "Card: "+@cardnum %>
|
|
<% @card = Card.find(:first,:conditions=>['lower(card_number) = ?', @cardnum.downcase]) %>
|
|
<%= "("+@card.user.name+")" unless @card.nil? %>
|
|
</td>
|
|
<% else
|
|
@divided_tmp = nil
|
|
end %>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
|
|
<br />
|
|
|