Initial Kaffeekasse SaaS restart
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
<?php require __DIR__ . '/../partials/layout-top.php'; ?>
|
||||
|
||||
<section class="page-head">
|
||||
<span class="eyebrow">Integration</span>
|
||||
<h1>RFID-Roadmap und Event-Inbox</h1>
|
||||
<p>Das MVP speichert Geraete, Karten und rohe Events bereits produktionsnah, ohne die spaetere Hardwareentscheidung vorwegzunehmen.</p>
|
||||
</section>
|
||||
|
||||
<div class="grid-three">
|
||||
<form class="card form-card" method="post" action="<?= e(tenant_url($tenant['slug'], 'rfid')) ?>">
|
||||
<?= csrf_field($csrf) ?>
|
||||
<input type="hidden" name="action" value="create_device">
|
||||
<label>
|
||||
<span>Geraetename</span>
|
||||
<input type="text" name="name" value="<?= e((string) old('name')) ?>" required>
|
||||
</label>
|
||||
<label>
|
||||
<span>Standort</span>
|
||||
<input type="text" name="location_label" value="<?= e((string) old('location_label')) ?>">
|
||||
</label>
|
||||
<button class="button button-primary" type="submit">RFID-Geraet vorbereiten</button>
|
||||
</form>
|
||||
|
||||
<form class="card form-card" method="post" action="<?= e(tenant_url($tenant['slug'], 'rfid')) ?>">
|
||||
<?= csrf_field($csrf) ?>
|
||||
<input type="hidden" name="action" value="assign_tag">
|
||||
<label>
|
||||
<span>Mitglied</span>
|
||||
<select name="member_id" required>
|
||||
<?php foreach ($members as $member): ?>
|
||||
<option value="<?= e((string) $member['id']) ?>"><?= e($member['display_name']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Karten-UID</span>
|
||||
<input type="text" name="uid" value="<?= e((string) old('uid')) ?>" required>
|
||||
</label>
|
||||
<label>
|
||||
<span>Label</span>
|
||||
<input type="text" name="label" value="<?= e((string) old('label')) ?>">
|
||||
</label>
|
||||
<button class="button button-primary" type="submit">Karte zuweisen</button>
|
||||
</form>
|
||||
|
||||
<section class="card">
|
||||
<span class="eyebrow">API</span>
|
||||
<p class="muted">POST `/api/rfid/intake` mit JSON-Body:</p>
|
||||
<pre class="code-block">{
|
||||
"device_token": "...",
|
||||
"uid": "04AABBCCDD",
|
||||
"event_id": "reader-0001",
|
||||
"ts": "2026-06-15T09:30:00Z"
|
||||
}</pre>
|
||||
<p class="muted">Events werden tenant-scharf gespeichert und spaeter in Buchungsregeln ueberfuehrt.</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="two-column">
|
||||
<section class="table-card">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Geraet</th>
|
||||
<th>Standort</th>
|
||||
<th>Status</th>
|
||||
<th>Token</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($devices as $device): ?>
|
||||
<tr>
|
||||
<td><?= e($device['name']) ?></td>
|
||||
<td><?= e((string) $device['location_label']) ?></td>
|
||||
<td><?= e($device['status']) ?></td>
|
||||
<td><code><?= e(substr($device['device_token'], 0, 16)) ?>...</code></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section class="table-card">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Karte</th>
|
||||
<th>Mitglied</th>
|
||||
<th>Status</th>
|
||||
<th>Zuletzt</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tags as $tag): ?>
|
||||
<tr>
|
||||
<td><?= e((string) ($tag['label'] ?: 'ohne Label')) ?></td>
|
||||
<td><?= e((string) $tag['member_name']) ?></td>
|
||||
<td><?= e($tag['status']) ?></td>
|
||||
<td><?= e((string) ($tag['last_seen_at'] ?? 'noch nie')) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section class="table-card">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Zeit</th>
|
||||
<th>Geraet</th>
|
||||
<th>Status</th>
|
||||
<th>Event-ID</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($events as $event): ?>
|
||||
<tr>
|
||||
<td><?= e($event['received_at']) ?></td>
|
||||
<td><?= e((string) $event['device_name']) ?></td>
|
||||
<td><?= e($event['status']) ?></td>
|
||||
<td><?= e((string) $event['external_event_id']) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<?php require __DIR__ . '/../partials/layout-bottom.php'; ?>
|
||||
Reference in New Issue
Block a user