Umbau broekr auf client-id

This commit is contained in:
concierge committed 2026-11-01 21:59:11 +01:00
1 parent 268e150f2b
commit a95204b8d6
17 files changed
+649 -388

No files matched your search

+5 -2
View File
@@ -359,17 +359,20 @@ def broker_status(**kwargs):
"""Status aktiver WebSocket-Verbindungen"""
connections = broker.connections.get(g.tenant_id, {}) if hasattr(broker, 'connections') else {}
result = []
for account_id, conn in connections.items():
account = db = get_db().execute(
for client_id, conn in connections.items():
account_id = conn.get('account_id')
account = get_db().execute(
'SELECT id, name, role FROM accounts WHERE id = ? AND tenant_id = ?',
(account_id, g.tenant_id)
).fetchone()
if not account:
continue
entry = {
'client_id': client_id,
'account_id': account['id'],
'account_name': account['name'],
'role': account['role'],
'authenticated': broker.is_authenticated(g.tenant_id, client_id),
'group_id': None,
'group_alias': None
}