Test one link
Build und Push Docker Image / build-and-push (push) Successful in 11s

This commit is contained in:
2026-11-04 14:42:16 +01:00
parent df0ffa2e73
commit 779e1832ac
11 changed files with 623 additions and 11 deletions
+100
View File
@@ -0,0 +1,100 @@
{% extends "base.html" %}
{% block content %}
<div class="back-row top">
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">&#8592; Zur&uuml;ck</a>
</div>
<div class="card">
<p class="hint">
Auf allen Tablets diese Adresse &ouml;ffnen: <strong>{{ tablet_url }}</strong><br>
Neue Tablets erscheinen hier automatisch als &bdquo;nicht zugeordnet&ldquo; (die Kennung steht auch auf dem Tablet).
Ein Link f&uuml;r alle Ger&auml;te gen&uuml;gt &ndash; jedes Tablet merkt sich seine Kennung selbst.
Nach dem Speichern wechselt das Tablet innerhalb von ca. 20 Sekunden auf die gew&auml;hlte Seite.
</p>
</div>
<div class="card {{ 'learn-on' if lernmodus else '' }}">
<form method="post" action="{{ url_for('tablets_lernmodus') }}" class="learn-form">
<div>
<strong>Lernmodus: {{ 'AN' if lernmodus else 'AUS' }}</strong><br>
<span class="hint">
Solange er an ist, werden Ger&auml;te, die noch &uuml;ber einen einzelnen Link (<code>/m&lt;N&gt;</code> oder
<code>/m&lt;N&gt;_show</code>) kommen, automatisch gespeichert und genau dieser Seite zugeordnet.
Beim n&auml;chsten Besuch &uuml;ber <code>/tablet</code> werden sie erkannt. Nach der Umstellung bitte ausschalten,
sonst wird auch z.&nbsp;B. ein PC registriert, der eine Maschinenseite &ouml;ffnet.
</span>
</div>
<input type="hidden" name="an" value="{{ '0' if lernmodus else '1' }}">
<button type="submit" class="big-btn small {{ 'neutral' if lernmodus else 'primary' }}">{{ 'Lernmodus ausschalten' if lernmodus else 'Lernmodus einschalten' }}</button>
</form>
</div>
{% if not tablets %}
<div class="empty-state">Noch kein Tablet registriert.</div>
{% else %}
<div class="list-meta">{{ tablets|length }} Tablets</div>
<div class="table-wrap">
<table class="data-table tablet-table">
<thead>
<tr><th>Status</th><th>Zuletzt gemeldet</th><th>Kennung</th><th colspan="3">Name &nbsp;/&nbsp; Ziel &nbsp;/&nbsp; Maschine</th><th class="col-actions"></th></tr>
</thead>
<tbody>
{% for t in tablets %}
<tr>
<td><span class="tablet-dot {{ 'on' if t.online else 'off' }}"></span>{{ 'online' if t.online else 'offline' }}</td>
<td>
{{ t.gesehen_relativ }}
<small class="tablet-seen">{% if t.gesehen_ts %}<time data-ts="{{ t.gesehen_ts }}"></time>{% else %}&nbsp;{% endif %}</small>
</td>
<td>{{ t.kurz }}</td>
<td colspan="3">
<form method="post" action="{{ url_for('tablets_speichern', tablet_id=t.id) }}" class="tablet-form" id="tf{{ t.id }}">
<input type="text" name="name" value="{{ t.name or '' }}" maxlength="60" aria-label="Name">
<select name="ziel_typ" aria-label="Ziel">
<option value="" {% if not t.ziel_typ %}selected{% endif %}>&ndash; nicht zugeordnet &ndash;</option>
{% for wert, label in ziele.items() %}
<option value="{{ wert }}" {% if t.ziel_typ == wert %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
<select name="maschine_id" aria-label="Maschine">
<option value="">&ndash;</option>
{% for m in maschinen %}
<option value="{{ m.id }}" {% if t.maschine_id == m.id %}selected{% endif %}>{{ m.name or ('Maschine ' ~ m.id) }}</option>
{% endfor %}
</select>
{% if not t.ziel_typ and tablets|length > 1 %}
<select name="ersetzt_id" aria-label="Zuordnung übernehmen von" title="Ersetzt dieses Tablet ein altes (z. B. nach gelöschten Browserdaten)? Dann dessen Zuordnung übernehmen.">
<option value="">Ersetzt Tablet &hellip; (optional)</option>
{% for o in tablets if o.id != t.id and not o.online %}
<option value="{{ o.id }}">{{ o.name }} ({{ o.kurz }})</option>
{% endfor %}
</select>
{% endif %}
</form>
</td>
<td class="col-actions">
<div class="row-actions">
<button type="submit" form="tf{{ t.id }}" class="icon-btn">Speichern</button>
<form method="post" action="{{ url_for('tablets_loeschen', tablet_id=t.id) }}" class="order-form">
<button type="submit" class="icon-btn danger">Entfernen</button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<p class="hint">Die Maschine wird nur bei &bdquo;Maschinenseite&ldquo; und &bdquo;Anzeige (Show)&ldquo; verwendet.</p>
{% endif %}
<script>
(function () {
function z2(n) { return (n < 10 ? '0' : '') + n; }
var els = document.querySelectorAll('time[data-ts]');
for (var i = 0; i < els.length; i++) {
var d = new Date(parseInt(els[i].getAttribute('data-ts'), 10) * 1000);
els[i].textContent = z2(d.getDate()) + '.' + z2(d.getMonth() + 1) + '. ' + z2(d.getHours()) + ':' + z2(d.getMinutes()) + ':' + z2(d.getSeconds());
}
})();
</script>
{% endblock %}