Improved session overview.
This commit is contained in:
parent
810391d8b7
commit
963bbb5396
2 changed files with 3 additions and 3 deletions
|
@ -16,8 +16,8 @@
|
||||||
<% for session in @sessions: %>
|
<% for session in @sessions: %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><% if session.data.user: %><%= session.data.user.displayName() %><% end %></td>
|
<td><% if session.data.user: %><%= session.data.user.displayName() %><% end %></td>
|
||||||
<td><% if session.data.user_agent: %><%= session.data.user_agent %><% end %></td>
|
<td title="<%= session.data.user_agent %>"><%= session.data.user_agent %></td>
|
||||||
<td><% if session.data.geo: %><%= session.data.geo.country_code %> <%= session.data.geo.city %><% end %></td>
|
<td title="<%= session.data.remote_id %>"><% if session.data.geo && session.data.geo.country_name: %><%= session.data.geo.country_name %> <%= session.data.geo.city_name %><% else: %><%= session.data.remote_id %><% end %></td>
|
||||||
<td><span class="humanTimeFromNow" data-time="<%- session.created_at %>">?</span></td>
|
<td><span class="humanTimeFromNow" data-time="<%- session.created_at %>">?</span></td>
|
||||||
<td><span class="humanTimeFromNow" data-time="<%- session.updated_at %>">?</span></td>
|
<td><span class="humanTimeFromNow" data-time="<%- session.updated_at %>">?</span></td>
|
||||||
<td><a href="#" data-session-id="<%- session.id %>" data-type="delete" class="glyphicon glyphicon-trash" title="<%- @T('Delete') %>"></a></td>
|
<td><a href="#" data-session-id="<%- session.id %>" data-type="delete" class="glyphicon glyphicon-trash" title="<%- @T('Delete') %>"></a></td>
|
||||||
|
|
|
@ -83,7 +83,7 @@ class ApplicationController < ActionController::Base
|
||||||
#session[:ping] = Time.now.utc.iso8601
|
#session[:ping] = Time.now.utc.iso8601
|
||||||
session[:ping] = DateTime.now.iso8601
|
session[:ping] = DateTime.now.iso8601
|
||||||
|
|
||||||
# check if remote ip need to be updated @TODO Move this into model
|
# check if remote ip need to be updated
|
||||||
if !session[:remote_id] || session[:remote_id] != request.remote_ip
|
if !session[:remote_id] || session[:remote_id] != request.remote_ip
|
||||||
session[:remote_id] = request.remote_ip
|
session[:remote_id] = request.remote_ip
|
||||||
session[:geo] = GeoIp.location( request.remote_ip )
|
session[:geo] = GeoIp.location( request.remote_ip )
|
||||||
|
|
Loading…
Reference in a new issue