Web-Push mit VAPID und Erinnerungs-Endpoint

This commit is contained in:
OpenCode 2026-11-13 01:03:54 +01:00
parent 67a1614081
commit b50267e4f0
24 changed files with 1703 additions and 50 deletions

View file

@ -1,5 +1,8 @@
<?php
/** @var array $users */
/** @var array $pushCounts */
/** @var array $pushLastUpdate */
/** @var bool $pushConfigured */
?>
<div class="page-head page-head--compact">
<div>
@ -30,6 +33,7 @@
<th>Rolle</th>
<th>Mitarbeiterkonto</th>
<th>Status</th>
<th>App-Erinnerungen</th>
<th>Letzte Anmeldung</th>
<th class="ta-right">Aktionen</th>
</tr>
@ -47,6 +51,19 @@
<td><span class="pill <?= $row['role'] === 'admin' ? 'pill--blue' : 'pill--grey' ?>"><?= $row['role'] === 'admin' ? 'Administrator' : 'Mitarbeiter' ?></span></td>
<td><?= e($row['employee_name'] ?: '–') ?></td>
<td><span class="pill <?= $row['status'] === 'active' ? 'pill--green' : 'pill--red' ?>"><?= $row['status'] === 'active' ? 'aktiv' : 'deaktiviert' ?></span></td>
<td>
<?php $devices = (int) ($pushCounts[(int) $row['id']] ?? 0); ?>
<?php if ($devices > 0): ?>
<span class="pill pill--green" title="Zuletzt aktualisiert: <?= e(fmt_datetime($pushLastUpdate[(int) $row['id']] ?? null)) ?>">
<svg class="ico" aria-hidden="true"><use href="#i-bell"/></svg>
<?= $devices ?> Gerät<?= $devices === 1 ? '' : 'e' ?>
</span>
<?php elseif ($pushConfigured): ?>
<span class="muted small">nicht aktiviert</span>
<?php else: ?>
<span class="muted small">–</span>
<?php endif; ?>
</td>
<td><?= e(fmt_datetime($row['last_login_at'])) ?></td>
<td class="ta-right">
<a class="btn small" href="<?= e(url('/admin/users/' . (int) $row['id'])) ?>"><svg class="ico" aria-hidden="true"><use href="#i-edit"/></svg> Bearbeiten</a>