Tablett zuornung update
Build und Push Docker Image / build-and-push (push) Successful in 11s

This commit is contained in:
2026-11-05 08:53:55 +01:00
parent 4f6a4952d9
commit c954696d56
9 changed files with 291 additions and 62 deletions
+1 -1
View File
@@ -23,6 +23,6 @@
</div>
{% if maschine_badge_id %}<div class="machine-id-badge">M{{ maschine_badge_id }}</div>{% endif %}
{% if tablet_code %}<div class="tablet-id-badge" title="Kennung dieses Tablets">{{ tablet_code }}</div>{% endif %}
{% if tablet_ziel %}<script src="{{ url_for('static', filename='tablet.js') }}" data-ziel="{{ tablet_ziel }}" data-abfrage="{{ url_for('tablet_ziel') }}" defer></script>{% endif %}
{% if tablet_ziel %}<script src="{{ url_for('static', filename='tablet.js') }}" data-ziel="{{ tablet_ziel }}" data-abfrage="{{ url_for('tablet_ziel') }}" data-intervall="{{ tablet_intervall }}" defer></script>{% endif %}
</body>
</html>
+2 -1
View File
@@ -129,6 +129,7 @@
setInterval(aktualisieren, 15000);
})();
</script>
{% if tablet_ziel %}<script src="{{ url_for('static', filename='tablet.js') }}" data-ziel="{{ tablet_ziel }}" data-abfrage="{{ url_for('tablet_ziel') }}" defer></script>{% endif %}
{% if tablet_code %}<div class="tablet-id-badge" title="Kennung dieses Tablets">{{ tablet_code }}</div>{% endif %}
{% if tablet_ziel %}<script src="{{ url_for('static', filename='tablet.js') }}" data-ziel="{{ tablet_ziel }}" data-abfrage="{{ url_for('tablet_ziel') }}" data-intervall="{{ tablet_intervall }}" defer></script>{% endif %}
</body>
</html>
+44
View File
@@ -0,0 +1,44 @@
{% extends "base.html" %}
{% block content %}
<div class="back-row top">
<a class="big-btn small neutral" href="{{ url_for('tablets_verwaltung') }}">&#8592; Zur&uuml;ck zu den Tablets</a>
{% if tablet_id %}<a class="big-btn small neutral" href="{{ url_for('tablets_verlauf') }}" style="margin-top:10px;">Alle Tablets anzeigen</a>{% endif %}
</div>
{% if tablet_id %}<div class="list-meta">Verlauf f&uuml;r: <strong>{{ filter_name }}</strong></div>{% endif %}
{% if not eintraege %}
<div class="empty-state">Noch keine Eintr&auml;ge.</div>
{% else %}
<div class="list-meta">{{ eintraege|length }} Eintr&auml;ge (neueste zuerst, max. 500; Aufbewahrung 400 Tage)</div>
<div class="table-wrap">
<table class="data-table">
<thead>
<tr><th>Zeit</th><th>Tablet</th><th>Aktion</th><th>Details</th><th>Von (IP)</th></tr>
</thead>
<tbody>
{% for e in eintraege %}
<tr>
<td><time data-ts="{{ e.zeitpunkt }}" title="{{ e.zeit_utc }}">{{ e.zeit_utc }}</time></td>
<td>{% if e.tablet_name %}{{ e.tablet_name }}<small class="tablet-seen">{{ e.kurz }}</small>{% else %}&ndash;{% endif %}</td>
<td>{{ e.aktion }}</td>
<td>{{ e.details or '' }}</td>
<td>{{ e.von_ip or '' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<p class="hint">&bdquo;Von (IP)&ldquo; ist die Adresse des Ger&auml;ts, das die &Auml;nderung ausgel&ouml;st hat (Admin-PC oder das Tablet selbst).
Die Admin-Seite hat ein gemeinsames Passwort, daher gibt es keine Benutzernamen.</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) + '.' + d.getFullYear() + ' ' + z2(d.getHours()) + ':' + z2(d.getMinutes()) + ':' + z2(d.getSeconds());
}
})();
</script>
{% endblock %}
+37 -6
View File
@@ -2,6 +2,7 @@
{% block content %}
<div class="back-row top">
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">&#8592; Zur&uuml;ck</a>
<a class="big-btn small neutral" href="{{ url_for('tablets_verlauf') }}" style="margin-top:10px;">&Auml;nderungsverlauf ansehen</a>
</div>
<div class="card">
@@ -9,11 +10,11 @@
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.
Nach dem Speichern wechselt das Tablet innerhalb von ca. {{ abfrage_sekunden }} Sekunden auf die gew&auml;hlte Seite (online = Meldung in den letzten {{ online_sekunden }} Sekunden).
</p>
</div>
<div class="card {{ 'learn-on' if lernmodus else '' }}">
<div class="card {{ 'learn-on' if lernmodus else '' }}" id="lernmodus">
<form method="post" action="{{ url_for('tablets_lernmodus') }}" class="learn-form">
<div>
<strong>Lernmodus: {{ 'AN' if lernmodus else 'AUS' }}</strong><br>
@@ -33,14 +34,14 @@
<div class="empty-state">Noch kein Tablet registriert.</div>
{% else %}
<div class="list-meta">{{ tablets|length }} Tablets</div>
<div class="table-wrap">
<div class="table-wrap" id="tablet-liste">
<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>
<tr id="tablet-{{ t.id }}" class="{{ 'tablet-unassigned' if not t.ziel_typ else '' }} {{ 'tablet-saved' if gespeichert_id == t.id else '' }}">
<td><span class="tablet-dot {{ 'on' if t.online else 'off' }}"></span>{{ 'online' if t.online else 'offline' }}</td>
<td>
{{ t.gesehen_relativ }}
@@ -48,7 +49,7 @@
</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 }}">
<form method="post" action="{{ url_for('tablets_speichern', tablet_id=t.id) }}#tablet-{{ 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>
@@ -71,23 +72,53 @@
</select>
{% endif %}
</form>
{% if fehler_id == t.id and zeilenfehler %}<div class="tablet-row-error">{{ zeilenfehler }}</div>{% endif %}
</td>
<td class="col-actions">
<div class="row-actions">
<button type="submit" form="tf{{ t.id }}" class="icon-btn">Speichern</button>
<a class="icon-btn" href="{{ url_for('tablets_verlauf', tablet=t.id) }}">Verlauf</a>
<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>
{% if gespeichert_id == t.id %}<div class="tablet-row-ok">&#10003; Gespeichert</div>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<p class="hint">Die Maschine wird nur bei &bdquo;Maschinenseite&ldquo; und &bdquo;Anzeige (Show)&ldquo; verwendet.</p>
<p class="hint"><span class="tablet-legend"></span> Gelb markiert: noch nicht zugeordnet. Die Maschine wird nur bei &bdquo;Maschinenseite&ldquo; und &bdquo;Anzeige (Show)&ldquo; verwendet.</p>
{% endif %}
<script>
(function () {
// Scroll-Position (Seite und Tabellenfenster) beim Speichern/Entfernen merken und
// danach exakt wiederherstellen, damit nichts springt (ohne JavaScript greift der
// Anker auf die Zeile).
var KEY = 'hbh_tablets_scroll';
try {
var liste = document.getElementById('tablet-liste');
var forms = document.querySelectorAll('form');
for (var f = 0; f < forms.length; f++) {
forms[f].addEventListener('submit', function () {
sessionStorage.setItem(KEY, JSON.stringify({ w: window.pageYOffset, t: liste ? liste.scrollTop : 0 }));
});
}
var roh = sessionStorage.getItem(KEY);
if (roh !== null) {
sessionStorage.removeItem(KEY);
var pos = JSON.parse(roh);
// erst nach dem Anker-Sprung des Browsers, damit die alte Position gewinnt
window.addEventListener('load', function () {
setTimeout(function () {
if (liste) liste.scrollTop = pos.t || 0;
window.scrollTo(0, pos.w || 0);
}, 0);
});
}
} catch (e) { /* Speicher gesperrt: Anker-Sprung genügt */ }
})();
(function () {
function z2(n) { return (n < 10 ? '0' : '') + n; }
var els = document.querySelectorAll('time[data-ts]');