Files
nexus/modules/kea/partials/dashboard.php
Lars Gebhardt-Kusche 0b555e7dd4
All checks were successful
Deploy / deploy-staging (push) Successful in 5s
Deploy / deploy-production (push) Has been skipped
adads
2026-04-15 02:02:42 +02:00

92 lines
3.5 KiB
PHP

<?php
/**
* @var array $hosts Die Liste der KEA-Hosts.
* @var string|null $error Eine Fehlermeldung, falls vorhanden.
* @var array $warnings Hinweise, falls Zusatzdaten nicht geladen werden konnten.
*/
?>
<section class="kea-page">
<div class="section-head">
<div>
<h2 class="section-title">KEA DHCP Hosts</h2>
<p>Reservierungen und aktuelle Leases aus der KEA-Datenbank.</p>
</div>
<a class="cta-button" href="/modules/setup/kea">Setup</a>
</div>
<?php if ($error): ?>
<div class="kea-message kea-message--error" role="alert">
<strong>Fehler</strong>
<p><?= e($error) ?></p>
</div>
<?php endif; ?>
<?php foreach (($warnings ?? []) as $warning): ?>
<div class="kea-message kea-message--warning" role="alert">
<p><?= e((string)$warning) ?></p>
</div>
<?php endforeach; ?>
<div class="kea-panel">
<div class="kea-panel__head">
<div>
<span class="pill">Inventar</span>
<h3>Registrierte Geräte</h3>
<p class="muted">Zusatzdaten werden in der separaten Nexus-DHCP-Datenbank gespeichert.</p>
</div>
</div>
<div class="kea-table-wrap">
<table class="kea-table">
<thead>
<tr>
<th>Quelle</th>
<th>Hostname</th>
<th>IP Adresse</th>
<th>MAC Adresse</th>
<th>Echter Name</th>
<th>Standort</th>
<th>Aktion</th>
</tr>
</thead>
<tbody>
<?php if (empty($hosts)): ?>
<tr>
<td colspan="7" class="kea-empty">
Keine Reservierungen oder aktiven Leases gefunden.
</td>
</tr>
<?php else: ?>
<?php foreach ($hosts as $host): ?>
<tr>
<td>
<span class="pill"><?= ($host['source'] ?? '') === 'lease' ? 'Lease' : 'Reservierung' ?></span>
</td>
<td>
<?= e($host['hostname'] ?: 'Unbekannt') ?>
</td>
<td class="mono">
<?= e($host['ipv4_address']) ?>
</td>
<td class="mono">
<?= e($host['dhcp_identifier']) ?>
</td>
<td>
<?= e((string)($host['metadata']['real_name'] ?? '-')) ?>
</td>
<td>
<?= e((string)($host['metadata']['location'] ?? '-')) ?>
</td>
<td>
<a class="nav-link" href="/module/kea/edit?source=<?= e((string)($host['source'] ?? 'reservation')) ?>&id=<?= e((string)($host['host_id'] ?? '0')) ?>">
Bearbeiten
</a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</section>