Lizenzserver - Integration Admin Panel

Dieser Commit ist enthalten in:
2025-06-18 22:03:46 +02:00
Ursprung ab3db0ab0d
Commit 86d805c392
21 geänderte Dateien mit 3110 neuen und 26 gelöschten Zeilen

Datei anzeigen

@@ -338,6 +338,11 @@ def api_customer_licenses(customer_id):
WHEN l.is_active = false THEN 'inaktiv'
ELSE 'aktiv'
END as status,
-- License Server Status
(SELECT COUNT(*) FROM license_heartbeats lh WHERE lh.license_id = l.id AND lh.timestamp > NOW() - INTERVAL '5 minutes') as recent_heartbeats,
(SELECT MAX(timestamp) FROM license_heartbeats lh WHERE lh.license_id = l.id) as last_heartbeat,
(SELECT COUNT(DISTINCT hardware_id) FROM license_heartbeats lh WHERE lh.license_id = l.id AND lh.timestamp > NOW() - INTERVAL '15 minutes') as active_server_devices,
(SELECT COUNT(*) FROM anomaly_detections ad WHERE ad.license_id = l.id AND ad.resolved = false) as unresolved_anomalies,
l.domain_count,
l.ipv4_count,
l.phone_count,
@@ -408,14 +413,19 @@ def api_customer_licenses(customer_id):
'active_sessions': row[9],
'registered_devices': row[10],
'status': row[11],
'domain_count': row[12],
'ipv4_count': row[13],
'phone_count': row[14],
'active_devices': row[15],
'actual_domain_count': row[16],
'actual_ipv4_count': row[17],
'actual_phone_count': row[18],
'resources': resources
'domain_count': row[16],
'ipv4_count': row[17],
'phone_count': row[18],
'active_devices': row[19],
'actual_domain_count': row[20],
'actual_ipv4_count': row[21],
'actual_phone_count': row[22],
'resources': resources,
# License Server Data
'recent_heartbeats': row[12],
'last_heartbeat': row[13].strftime('%Y-%m-%d %H:%M:%S') if row[13] else None,
'active_server_devices': row[14],
'unresolved_anomalies': row[15]
})
return jsonify({