diff --git a/frontend/src/components/admin/sessions/Sessions.svelte b/frontend/src/components/admin/sessions/Sessions.svelte index ad8d622d..876bda60 100644 --- a/frontend/src/components/admin/sessions/Sessions.svelte +++ b/frontend/src/components/admin/sessions/Sessions.svelte @@ -24,6 +24,10 @@ label: 'Session ID', callback: (item, search) => item.id.toLowerCase().includes(search.toLowerCase()), }, + { + label: 'IP', + callback: (item, search) => item.remote_ip?.toLowerCase().includes(search.toLowerCase()), + }, ]; let orderOptions = [ {label: 'Expires', callback: (a, b) => a.exp - b.exp}, @@ -31,6 +35,7 @@ {label: 'Session ID', callback: (a, b) => a.id.localeCompare(b.id)}, {label: 'User ID', callback: (a, b) => a.user_id?.localeCompare(b.user_id)}, {label: 'State', callback: (a, b) => a.state.localeCompare(b.state)}, + {label: 'IP', callback: (a, b) => a.remote_ip?.localeCompare(b.remote_ip)}, ]; onMount(async () => { @@ -81,76 +86,52 @@ orderOptions={orderOptions} firstDirReverse /> -
+
- -
-
- - Session ID - -
- -
- - User ID - -
- -
- - State - -
- -
- - MFA - -
- -
- - Expires - -
- -
- - Last Seen - -
-
- {#each resSessions as session}
now ? 'entryRow' : 'entryRow expired'}> -
- {session.id} -
- -
- {session.user_id} +
+
+
SID:
+ {session.id} +
+ +
+
EXP:
+ {formatDateFromTs(session.exp)} +
+ +
+
SEEN:
+ {formatDateFromTs(session.last_seen)} +
-
- {session.state} -
- -
- -
- -
- {formatDateFromTs(session.exp)} -
- -
- {formatDateFromTs(session.last_seen)} +
+
+
USER:
+ {session.user_id} +
+ +
+
STATE:
+ {session.state} +
+ +
+
IP:
+ {session.remote_ip} +
+ +
+
MFA:
+ +
{/each} @@ -162,44 +143,68 @@ margin: 10px 0 0 25px; } - .c1 { - width: 325px; - margin-left: 5px; + .col-sid { + width: 23rem; + } + + .col-uid { + width: 23rem; } - .c2 { - width: 240px; + .col-state { + width: 12.25rem; } - .c3 { - width: 90px; + .col-mfa { + width: 4.5rem; } - .c4 { - width: 45px; + .col-exp { + width: 12.25rem; } - .c5 { - width: 160px; + .col-seen { + width: 13rem; } - .c6 { - width: 160px; + .col-ip { + width: 9.75rem; } .expired { background: var(--col-gmid); } - .row, .entryRow { + .flex { display: flex; - justify-content: space-between; - width: 1023px; - border-bottom: 1px solid var(--col-gmid); + align-items: center; + } + + .label { + margin-right: .25rem; + font-weight: bold; + font-size: .9rem; + } + + .entryRow { + max-width: 50rem; + margin-bottom: 1rem; } .entryRow:hover { background: var(--col-acnt); color: white } + + .row1, .row2 { + display: inline-flex; + flex-wrap: wrap; + flex: 1; + } + + .row { + display: flex; + flex-wrap: wrap; + align-items: center; + } diff --git a/rauthy-handlers/src/sessions.rs b/rauthy-handlers/src/sessions.rs index 4e6c0ef5..51ff961c 100644 --- a/rauthy-handlers/src/sessions.rs +++ b/rauthy-handlers/src/sessions.rs @@ -46,6 +46,7 @@ pub async fn get_sessions( state: &s.state, exp: s.exp, last_seen: s.last_seen, + remote_ip: s.remote_ip.as_deref(), }) .collect::>(); Ok(HttpResponse::Ok().json(resp)) diff --git a/rauthy-models/src/response.rs b/rauthy-models/src/response.rs index f6b55946..bd5e99c6 100644 --- a/rauthy-models/src/response.rs +++ b/rauthy-models/src/response.rs @@ -235,6 +235,7 @@ pub struct SessionResponse<'a> { pub state: &'a SessionState, pub exp: i64, pub last_seen: i64, + pub remote_ip: Option<&'a str>, } #[derive(Debug, Serialize, ToSchema)]