Administrator Views verbessert
This commit is contained in:
1 parent
ffdb399f9e
commit
0a2070fcf5
12 files changed
+247
-12
No files matched your search
@@ -370,6 +370,38 @@ def import_streets(**kwargs):
|
||||
return jsonify({'success': True, 'count': count})
|
||||
|
||||
|
||||
@admin_api_bp.route('/broker/status')
|
||||
@role_required('Administrator')
|
||||
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(
|
||||
'SELECT id, name, role FROM accounts WHERE id = ? AND tenant_id = ?',
|
||||
(account_id, g.tenant_id)
|
||||
).fetchone()
|
||||
if not account:
|
||||
continue
|
||||
entry = {
|
||||
'account_id': account['id'],
|
||||
'account_name': account['name'],
|
||||
'role': account['role'],
|
||||
'group_id': None,
|
||||
'group_alias': None
|
||||
}
|
||||
if account['role'] == 'Gruppe':
|
||||
group = get_db().execute(
|
||||
'SELECT id, aliasname FROM groups WHERE account_id = ? AND tenant_id = ?',
|
||||
(account['id'], g.tenant_id)
|
||||
).fetchone()
|
||||
if group:
|
||||
entry['group_id'] = group['id']
|
||||
entry['group_alias'] = group['aliasname']
|
||||
result.append(entry)
|
||||
return jsonify({'connections': result})
|
||||
|
||||
|
||||
@admin_api_bp.route('/hausnummern/import', methods=['POST'])
|
||||
@role_required('Administrator')
|
||||
def import_house_numbers(**kwargs):
|
||||
|
||||
Reference in new issue
Block a user