This commit is contained in:
+9
-6
@@ -2025,9 +2025,9 @@ def _vor_zeit(sekunden):
|
||||
|
||||
|
||||
def _tablet_anzeige(cur):
|
||||
"""Tablets für die Admin-Liste. Feste Reihenfolge (Registrierung), damit
|
||||
Zeilen beim Speichern nicht herumspringen."""
|
||||
cur.execute('SELECT * FROM "Tablets" ORDER BY id ASC')
|
||||
"""Tablets für die Admin-Liste: nicht zugeordnete immer zuerst, jeweils in
|
||||
fester Reihenfolge (Registrierung)."""
|
||||
cur.execute('SELECT * FROM "Tablets" ORDER BY (ziel_typ IS NULL) DESC, id ASC')
|
||||
jetzt = now_ts()
|
||||
tablets = cur.fetchall()
|
||||
for t in tablets:
|
||||
@@ -2042,7 +2042,7 @@ def _tablet_anzeige(cur):
|
||||
def _tablets_seite(error=None, gespeichert_id=None, fehler_id=None):
|
||||
with db.get_cursor() as cur:
|
||||
return render_template(
|
||||
"tablets_verwaltung.html", title="Tablets", subtitle="Geräten eine Seite zuordnen",
|
||||
"tablets_verwaltung.html", title="Tablets", subtitle="Geräten eine Seite zuordnen", content_class="wide",
|
||||
tablets=_tablet_anzeige(cur), maschinen=get_maschinen_liste(cur), ziele=TABLET_ZIELE,
|
||||
lernmodus=tablet_lernmodus_aktiv(cur), abfrage_sekunden=TABLET_ABFRAGE_SEKUNDEN,
|
||||
online_sekunden=TABLET_ONLINE_SEKUNDEN,
|
||||
@@ -2107,7 +2107,10 @@ def tablets_speichern(tablet_id):
|
||||
else:
|
||||
aktion = "Umbenannt"
|
||||
tablet_log(cur, aktion, "; ".join(aenderungen), neu)
|
||||
return _zur_tablet_zeile(tablet_id)
|
||||
# Wechselt die Zeile zwischen "nicht zugeordnet" (oben) und zugeordnet, ändert sich
|
||||
# ihre Position: dann zur Zeile springen statt die alte Scroll-Position zu halten.
|
||||
umsortiert = (alt["ziel_typ"] not in TABLET_ZIELE) != (neues_ziel is None)
|
||||
return _zur_tablet_zeile(tablet_id, **({"umsortiert": 1} if umsortiert else {}))
|
||||
|
||||
|
||||
@app.route("/start_tablets/lernmodus", methods=["POST"])
|
||||
@@ -2160,7 +2163,7 @@ def tablets_verlauf():
|
||||
t = cur.fetchone()
|
||||
filter_name = t["name"] if t else (eintraege[0]["tablet_name"] if eintraege else f"#{tablet_id}")
|
||||
return render_template(
|
||||
"tablets_verlauf.html", title="Änderungsverlauf", subtitle="Tablet-Zuordnungen",
|
||||
"tablets_verlauf.html", title="Änderungsverlauf", subtitle="Tablet-Zuordnungen", content_class="wide",
|
||||
eintraege=eintraege, filter_name=filter_name, tablet_id=tablet_id,
|
||||
)
|
||||
|
||||
|
||||
+19
-2
@@ -125,6 +125,18 @@ form.btn-form { display: contents; }
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
/* Kopfzeile der Admin-Seiten: Zurück (links, breit) ... weitere Aktionen ... Abmelden (rechts) */
|
||||
.top-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
align-items: stretch;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
.top-actions > a.big-btn { width: auto; flex: 1 1 200px; }
|
||||
.top-actions > form { margin: 0; flex: 0 0 auto; display: flex; width: auto; }
|
||||
.top-actions > form .big-btn { width: auto; min-width: 170px; }
|
||||
|
||||
.machine-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
@@ -558,9 +570,14 @@ table.data-table td.col-actions { white-space: nowrap; }
|
||||
.tablet-wait { text-align: center; padding: 30px 20px; }
|
||||
.tablet-wait-title { font-size: 1.6em; font-weight: 700; }
|
||||
.tablet-code { font-size: 3.2em; font-weight: 800; letter-spacing: 0.12em; margin: 18px 0 6px; color: var(--amber); }
|
||||
.tablet-form { display: flex; gap: 8px; flex-wrap: wrap; }
|
||||
/* Tablet-Verwaltung wird nur am PC benutzt: breiter Bereich, größere Schrift */
|
||||
.tablet-table { font-size: 1.15rem; }
|
||||
.tablet-table th { font-size: 1rem; }
|
||||
.tablet-table td { padding-top: 14px; padding-bottom: 14px; }
|
||||
.tablet-table .icon-btn { font-size: 1.05rem; padding: 9px 16px; }
|
||||
.tablet-form { display: flex; gap: 10px; flex-wrap: nowrap; }
|
||||
.tablet-form input, .tablet-form select {
|
||||
flex: 1; min-width: 150px; padding: 8px 10px; font-size: 1em;
|
||||
flex: 1; min-width: 150px; padding: 10px 12px; font-size: 1em;
|
||||
background: var(--bg); color: var(--text); border: 2px solid var(--border); border-radius: 8px;
|
||||
}
|
||||
.tablet-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; }
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<a class="big-btn neutral" href="{{ url_for('leitstand_prioritaet') }}">↕ Auftragspriorität</a>
|
||||
<a class="big-btn" href="{{ url_for('leitstand_maschinen') }}">🛠 Zu Maschine springen</a>
|
||||
<a class="big-btn" href="{{ url_for('leitstand_maschinen', ziel='show') }}">Zur Anzeige springen</a>
|
||||
<a class="big-btn" href="{{ url_for('tablets_verwaltung') }}">Tablets zuordnen</a>
|
||||
<a class="big-btn" href="{{ url_for('tablets_verwaltung') }}">🔒 Tablets zuordnen</a>
|
||||
<a class="big-btn" href="{{ url_for('maschinenverwaltung') }}">🔒 Maschinenverwaltung</a>
|
||||
</div>
|
||||
<p class="version-info">Hour by Hour – Version {{ app_version }}</p>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<div class="top-actions">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
<form method="post" action="{{ url_for('maschinenverwaltung_logout') }}" class="order-form" style="display:inline-block;width:auto;margin-left:12px;">
|
||||
<button type="submit" class="icon-btn">Abmelden</button>
|
||||
<form method="post" action="{{ url_for('maschinenverwaltung_logout') }}">
|
||||
<button type="submit" class="big-btn small neutral">🔒 Abmelden</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<div class="top-actions">
|
||||
<a class="big-btn small neutral" href="{{ url_for('tablets_verwaltung') }}">← Zurü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 %}
|
||||
{% if tablet_id %}<a class="big-btn small neutral" href="{{ url_for('tablets_verlauf') }}">Alle Tablets anzeigen</a>{% endif %}
|
||||
<form method="post" action="{{ url_for('maschinenverwaltung_logout') }}">
|
||||
<button type="submit" class="big-btn small neutral">🔒 Abmelden</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if tablet_id %}<div class="list-meta">Verlauf für: <strong>{{ filter_name }}</strong></div>{% endif %}
|
||||
@@ -11,7 +14,7 @@
|
||||
{% else %}
|
||||
<div class="list-meta">{{ eintraege|length }} Einträge (neueste zuerst, max. 500; Aufbewahrung 400 Tage)</div>
|
||||
<div class="table-wrap">
|
||||
<table class="data-table">
|
||||
<table class="data-table tablet-table">
|
||||
<thead>
|
||||
<tr><th>Zeit</th><th>Tablet</th><th>Aktion</th><th>Details</th><th>Von (IP)</th></tr>
|
||||
</thead>
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<div class="top-actions">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
<a class="big-btn small neutral" href="{{ url_for('tablets_verlauf') }}" style="margin-top:10px;">Änderungsverlauf ansehen</a>
|
||||
<a class="big-btn small neutral" href="{{ url_for('tablets_verlauf') }}">Änderungsverlauf ansehen</a>
|
||||
<form method="post" action="{{ url_for('maschinenverwaltung_logout') }}">
|
||||
<button type="submit" class="big-btn small neutral">🔒 Abmelden</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
@@ -102,6 +105,10 @@
|
||||
var roh = sessionStorage.getItem(KEY);
|
||||
if (roh !== null) {
|
||||
sessionStorage.removeItem(KEY);
|
||||
// Zeile hat die Gruppe gewechselt (nicht zugeordnet <-> zugeordnet): Anker-Sprung zur Zeile gilt
|
||||
if (window.location.search.indexOf('umsortiert=1') !== -1) roh = null;
|
||||
}
|
||||
if (roh !== null) {
|
||||
var pos = JSON.parse(roh);
|
||||
// erst nach dem Anker-Sprung des Browsers, damit die alte Position gewinnt
|
||||
window.addEventListener('load', function () {
|
||||
|
||||
Reference in New Issue
Block a user