feat: Zentrale per Durchwahl selbst besetzen
Das Busylight im Empfangsbereich wird wechselnd besetzt. Mitarbeiter
koennen sich jetzt selbst darauf setzen, ohne Admin-Passwort.
- Neue Seite /zentrale (Durchwahl eingeben) und /zentrale/{durchwahl}
als Direktlink fuer QR-Codes. Der Direktlink zeigt nur an und aendert
nichts, damit Link-Vorschau und Prefetch niemanden versetzen.
- Neue Tabelle home_assignments merkt das eigene Tuerschild, solange der
Mitarbeiter in der Zentrale sitzt. Beim Verlassen wird es
wiederhergestellt, das Zentral-Segment wird freigegeben.
- Der Vorgaenger bleibt ohne Zuordnung - er ist nicht da. Sein gemerkter
Heimatplatz bleibt erhalten, er kann jederzeit zurueckkehren.
- Ist der Heimatplatz inzwischen belegt, wird die Rueckkehr abgelehnt
und nichts geaendert.
- Eine ausdrueckliche Admin-Zuordnung verwirft den gemerkten Heimatplatz.
Ein reines Loeschen der Zuordnung nicht, sonst kaeme niemand mehr von
der Zentrale zurueck.
- Farbe wird sofort ans Geraet geschickt (scheduler.push_user_light).
Das Polling allein reicht nicht: _process_user sendet nur bei einer
Statusaenderung, und beim Platzwechsel bleibt der Status gleich.
- Neue Settings selfservice_device_id und selfservice_segment,
einstellbar unter Einstellungen.
- Jeder Wechsel landet im Protokoll (zentrale / zentrale_frei).
Die Durchwahl ist eine Kennung, kein Geheimnis - im README dokumentiert.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Zentrale - Busylight</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center mt-4 mb-5">
|
||||
<div class="col-md-5">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body p-4">
|
||||
<div class="text-center mb-4">
|
||||
<img src="/static/logo.png" alt="cynfo" style="height: 40px;" class="mb-2">
|
||||
<h5 class="mb-0">Zentrale besetzen</h5>
|
||||
</div>
|
||||
|
||||
{% if message %}
|
||||
<div class="alert alert-success py-2">
|
||||
<small><i class="bi bi-check-circle"></i> {{ message }}</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger py-2">
|
||||
<small><i class="bi bi-exclamation-triangle"></i> {{ error }}</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not target %}
|
||||
<div class="alert alert-warning py-2 mb-0">
|
||||
<small>
|
||||
<i class="bi bi-gear"></i>
|
||||
Die Zentrale ist noch nicht eingerichtet. Unter
|
||||
<strong>Einstellungen > Zentrale</strong> muss ein Busylight
|
||||
und ein Segment ausgewaehlt werden.
|
||||
</small>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
<div class="border rounded p-3 mb-4 bg-white">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<small class="text-muted d-block">Busylight der Zentrale</small>
|
||||
<strong>{{ target.name }}</strong>
|
||||
<small class="text-muted">(Segment {{ target.segment }})</small>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<small class="text-muted d-block">Aktuell besetzt von</small>
|
||||
{% if occupant %}
|
||||
<strong class="text-success"><i class="bi bi-person-fill"></i> {{ occupant }}</strong>
|
||||
{% else %}
|
||||
<span class="text-muted"><i class="bi bi-person-dash"></i> niemand</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if user %}
|
||||
<div class="text-center mb-3">
|
||||
<small class="text-muted d-block">Durchwahl {{ user.phone_extension }}</small>
|
||||
<strong>{{ user.display_name }}</strong>
|
||||
</div>
|
||||
|
||||
{% if is_here %}
|
||||
<div class="alert alert-info py-2">
|
||||
<small><i class="bi bi-info-circle"></i> Du sitzt derzeit auf der Zentrale.</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="/api/zentrale/uebernehmen" class="mb-2">
|
||||
<input type="hidden" name="extension" value="{{ user.phone_extension }}">
|
||||
<button type="submit" class="btn btn-primary w-100" {% if is_here %}disabled{% endif %}>
|
||||
<i class="bi bi-box-arrow-in-right"></i> Zentrale uebernehmen
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/api/zentrale/verlassen">
|
||||
<input type="hidden" name="extension" value="{{ user.phone_extension }}">
|
||||
<button type="submit" class="btn btn-outline-secondary w-100">
|
||||
<i class="bi bi-box-arrow-left"></i> Zurueck auf mein Tuerschild
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{% if home %}
|
||||
<div class="text-center mt-3">
|
||||
<small class="text-muted">
|
||||
Gemerktes Tuerschild: {{ home.name or home.hostname }} (Segment {{ home.segment }})
|
||||
</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="text-center mt-3">
|
||||
<a href="/zentrale" class="text-muted small">Andere Durchwahl</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<form method="post" action="/api/zentrale/uebernehmen">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Eigene Telefon-Durchwahl</label>
|
||||
<input type="text" name="extension" class="form-control form-control-lg text-center"
|
||||
inputmode="numeric" autocomplete="off" autofocus required
|
||||
value="{{ extension }}" placeholder="z.B. 123">
|
||||
<small class="text-muted">
|
||||
Damit wird die eigene Person auf das Busylight der Zentrale gesetzt.
|
||||
</small>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
<i class="bi bi-box-arrow-in-right"></i> Zentrale uebernehmen
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="text-center mt-4">
|
||||
<small class="text-secondary" style="font-size:0.65rem">© cynfo GmbH</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user