adasd
All checks were successful
Deploy / deploy-staging (push) Successful in 5s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-15 02:41:09 +02:00
parent 0b555e7dd4
commit 7157c98dcb
13 changed files with 614 additions and 20 deletions

View File

@@ -15,6 +15,12 @@ $metadataRepo = null;
$hosts = [];
$error = null;
$warnings = [];
$stats = [
'total' => 0,
'reservations' => 0,
'leases' => 0,
'groups' => [],
];
try {
$pdo = modules()->modulePdo('kea', $fallback);
@@ -30,8 +36,20 @@ try {
$repo = new KeaHostRepository($pdo, $metadataRepo);
$hosts = $repo->findAll(50);
$stats['total'] = count($hosts);
foreach ($hosts as $host) {
if (($host['source'] ?? '') === 'lease') {
$stats['leases']++;
} else {
$stats['reservations']++;
}
$group = trim((string)($host['metadata']['group_name'] ?? ''));
if ($group !== '') {
$stats['groups'][$group] = ($stats['groups'][$group] ?? 0) + 1;
}
}
} catch (\Exception $e) {
$error = "Datenbankfehler: " . $e->getMessage();
}
module_tpl('kea', 'dashboard', compact('hosts', 'error', 'warnings'));
module_tpl('kea', 'dashboard', compact('hosts', 'error', 'warnings', 'stats'));