Improved session overview.

This commit is contained in:
Martin Edenhofer 2015-03-22 12:59:39 +01:00
parent 810391d8b7
commit 963bbb5396
2 changed files with 3 additions and 3 deletions

View file

@ -16,8 +16,8 @@
<% for session in @sessions: %>
<tr>
<td><% if session.data.user: %><%= session.data.user.displayName() %><% end %></td>
<td><% if session.data.user_agent: %><%= session.data.user_agent %><% end %></td>
<td><% if session.data.geo: %><%= session.data.geo.country_code %> <%= session.data.geo.city %><% end %></td>
<td title="<%= session.data.user_agent %>"><%= session.data.user_agent %></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.updated_at %>">?</span></td>
<td><a href="#" data-session-id="<%- session.id %>" data-type="delete" class="glyphicon glyphicon-trash" title="<%- @T('Delete') %>"></a></td>

View file

@ -83,7 +83,7 @@ class ApplicationController < ActionController::Base
#session[:ping] = Time.now.utc.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
session[:remote_id] = request.remote_ip
session[:geo] = GeoIp.location( request.remote_ip )