Admin: Letzte Aktivität pro User (nur echte Aktionen, kein Polling)
This commit is contained in:
@@ -1499,6 +1499,22 @@ function UserManagement({ toast }) {
|
||||
border:`1px solid ${u.role==='admin'?'rgba(255,230,109,0.3)':'rgba(78,205,196,0.3)'}`,
|
||||
borderRadius:4, padding:'1px 6px',
|
||||
}}>{u.role}</span>
|
||||
{u.last_active_at && (
|
||||
<span style={{
|
||||
marginLeft:6, fontSize:9, fontFamily:'monospace',
|
||||
color:'rgba(255,255,255,0.35)',
|
||||
}}>
|
||||
● {(() => {
|
||||
const d = new Date(u.last_active_at.replace(' ','T'));
|
||||
const now = new Date();
|
||||
const diff = Math.floor((now - d) / 60000);
|
||||
if (diff < 2) return 'gerade eben';
|
||||
if (diff < 60) return `vor ${diff} min`;
|
||||
if (diff < 1440) return `vor ${Math.floor(diff/60)} h`;
|
||||
return d.toLocaleDateString('de-DE', {day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit'});
|
||||
})()}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div style={{display:'flex',gap:5}}>
|
||||
<button onClick={()=>{setResetId(u.id);setResetPw('');}}
|
||||
|
||||
Reference in New Issue
Block a user