Description:
report ip
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r442:ce576ec8e8c3 - - 2 files changed: 10 inserted, 2 deleted
@@ -38,7 +38,11 | |||
|
38 | 38 | .minimum(:created_at), |
|
39 | 39 | max: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", |
|
40 | 40 | user.id,@since_time,@until_time) |
|
41 | - .maximum(:created_at) | |
|
41 | + .maximum(:created_at), | |
|
42 | + ip: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", | |
|
43 | + user.id,@since_time,@until_time) | |
|
44 | + .select(:ip_address).uniq | |
|
45 | + | |
|
42 | 46 | } |
|
43 | 47 | end |
|
44 | 48 | end |
@@ -22,6 +22,7 | |||
|
22 | 22 | %th login count |
|
23 | 23 | %th earliest |
|
24 | 24 | %th latest |
|
25 | + %th IP | |
|
25 | 26 | %tbody |
|
26 | 27 | - @logins.each do |l| |
|
27 | 28 | %tr{class: cycle('info-even','info-odd')} |
@@ -29,4 +30,7 | |||
|
29 | 30 | %td= l[:full_name] |
|
30 | 31 | %td= l[:count] |
|
31 | 32 | %td= l[:min] ? l[:min].in_time_zone.strftime('%Y-%m-%d %H:%M') : '' |
|
32 | - %td= l[:max] ? "#{l[:max].in_time_zone.strftime('%Y-%m-%d %H:%M')} (#{time_ago_in_words(l[:max].in_time_zone)} ago)" : '' | |
|
33 | + %td= l[:max] ? "#{l[:max].in_time_zone.strftime('%Y-%m-%d %H:%M.%S')} (#{time_ago_in_words(l[:max].in_time_zone)} ago)" : '' | |
|
34 | + %td | |
|
35 | + - l[:ip].each do |ip| | |
|
36 | + #{ip.ip_address} <br/> |
You need to be logged in to leave comments.
Login now