Stabilize visitor panel ordering
This commit is contained in:
@@ -1825,8 +1825,8 @@ function currentVisitors() {
|
||||
FROM visitor_sessions vs
|
||||
JOIN sites s ON s.id = vs.site_id
|
||||
LEFT JOIN visitor_profiles vp ON vp.site_id = vs.site_id AND vp.visitor_token = vs.visitor_token
|
||||
WHERE datetime(vs.last_seen_at) >= datetime('now', '-${presence.offlineSeconds} seconds')
|
||||
ORDER BY datetime(vs.last_seen_at) DESC
|
||||
WHERE datetime(COALESCE(vs.last_activity_at, vs.last_seen_at)) >= datetime('now', '-${presence.offlineSeconds} seconds')
|
||||
ORDER BY datetime(vs.first_seen_at) ASC, vs.id ASC
|
||||
LIMIT 100
|
||||
`).all();
|
||||
return rows.map((row) => formatVisitorSession(row, presence));
|
||||
@@ -1861,6 +1861,7 @@ function formatVisitorSession(row, thresholds = adminPresenceSettings()) {
|
||||
countryCode,
|
||||
countryFlag: countryCode ? flagEmoji(countryCode) : "",
|
||||
sessionSeconds: sessionSeconds(row.browsing_history_json, row.first_seen_at),
|
||||
firstSeenAt: row.first_seen_at,
|
||||
lastActivityAt: row.last_activity_at,
|
||||
lastSeenAt: row.last_seen_at
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user