Add latest changes

Dieser Commit ist enthalten in:
2025-07-03 20:38:33 +00:00
Ursprung 63f3d92724
Commit 6f6cde65db
129 geänderte Dateien mit 3998 neuen und 1199 gelöschten Zeilen

Datei anzeigen

@@ -338,7 +338,9 @@ def api_customer_licenses(customer_id):
END as status,
COALESCE(l.domain_count, 0) as domain_count,
COALESCE(l.ipv4_count, 0) as ipv4_count,
COALESCE(l.phone_count, 0) as phone_count
COALESCE(l.phone_count, 0) as phone_count,
l.max_concurrent_sessions,
(SELECT COUNT(*) FROM license_sessions ls WHERE ls.license_id = l.id) as active_sessions
FROM licenses l
WHERE l.customer_id = %s
ORDER BY l.created_at DESC, l.id DESC
@@ -379,6 +381,13 @@ def api_customer_licenses(customer_id):
elif res_row[1] == 'phone':
resources['phones'].append(resource_data)
# Count active devices from activations table
cur2.execute("""
SELECT COUNT(*) FROM activations
WHERE license_id = %s AND is_active = true
""", (license_id,))
active_device_count = cur2.fetchone()[0]
cur2.close()
conn2.close()
@@ -396,9 +405,10 @@ def api_customer_licenses(customer_id):
'domain_count': row[10],
'ipv4_count': row[11],
'phone_count': row[12],
'active_sessions': 0, # Platzhalter
'registered_devices': 0, # Platzhalter
'active_devices': 0, # Platzhalter
'max_concurrent_sessions': row[13],
'active_sessions': row[14],
'registered_devices': active_device_count,
'active_devices': active_device_count,
'actual_domain_count': len(resources['domains']),
'actual_ipv4_count': len(resources['ipv4s']),
'actual_phone_count': len(resources['phones']),