connectiopn fix round 2 3

This commit is contained in:
2026-08-21 16:02:23 +02:00
parent 8c9af78672
commit 763be3e7bf
12 changed files with 708 additions and 11 deletions

View File

@ -1921,13 +1921,20 @@ async def list_sessions(
result = []
for r in rows:
recording_path = r[11]
is_active = r[8] is None
killable = r[0] in active_ids
result.append({
"id": r[0], "user_id": r[1], "username": r[2], "host_id": r[3],
"hostname": r[4], "host_group_name": r[5], "protocol": r[6],
"started_at": r[7], "ended_at": r[8], "client_ip": r[9], "end_reason": r[10],
"is_active": r[8] is None,
"killable": r[0] in active_ids,
"is_active": is_active,
"killable": killable,
"has_recording": bool(recording_path) and Path(recording_path).exists(),
# Live-Mitschau (GET /ws/sessions/{id}/watch): wie 'killable' nur
# moeglich, wenn die Sitzung auf DIESEM Worker-Prozess laeuft --
# und bisher nur fuer SSH umgesetzt (RDP haette dafuer eine eigene
# Multiplexing-Loesung fuer den guacd-Binaer-Tunnel noetig).
"watchable": is_active and killable and r[6] == "ssh",
})
return result