asdasd
This commit is contained in:
@@ -36,14 +36,11 @@ try {
|
||||
}
|
||||
|
||||
$repo = new KeaHostRepository($pdo, $metadataRepo);
|
||||
$hosts = $repo->findAll(50);
|
||||
$stats['total'] = count($hosts);
|
||||
$hosts = $repo->findAll(200);
|
||||
$stats['reservations'] = $repo->countReservations();
|
||||
$stats['leases'] = $repo->countLeases();
|
||||
$stats['total'] = $stats['reservations'] + $stats['leases'];
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user