This commit is contained in:
+1126
File diff suppressed because it is too large
Load Diff
+91
@@ -0,0 +1,91 @@
|
||||
"""
|
||||
Datenbank-Anbindung für die WDM-Performance-Anwendung.
|
||||
|
||||
Verwendet einen Thread-sicheren Connection-Pool. Beim Start wird mehrfach
|
||||
versucht die Verbindung aufzubauen, da Postgres im Docker-Setup u.U. noch
|
||||
nicht bereit ist, wenn der App-Container startet.
|
||||
"""
|
||||
import os
|
||||
import time
|
||||
import logging
|
||||
from contextlib import contextmanager
|
||||
|
||||
import psycopg2
|
||||
import psycopg2.extras
|
||||
from psycopg2.pool import ThreadedConnectionPool
|
||||
|
||||
log = logging.getLogger("wdm-performance")
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
||||
|
||||
DB_HOST = os.environ.get("DB_HOST", "db")
|
||||
DB_PORT = os.environ.get("DB_PORT", "5432")
|
||||
DB_NAME = os.environ.get("DB_NAME", "wdm")
|
||||
DB_USER = os.environ.get("DB_USER", "wdm")
|
||||
DB_PASSWORD = os.environ.get("DB_PASSWORD", "wdm")
|
||||
|
||||
_pool = None
|
||||
|
||||
|
||||
def init_pool(max_versuche=30, wartezeit_sekunden=2):
|
||||
"""Baut den Connection-Pool auf. Versucht es mehrfach, falls die DB
|
||||
beim Containerstart noch nicht erreichbar ist (kein harter Absturz)."""
|
||||
global _pool
|
||||
for versuch in range(1, max_versuche + 1):
|
||||
try:
|
||||
_pool = ThreadedConnectionPool(
|
||||
minconn=1,
|
||||
maxconn=10,
|
||||
host=DB_HOST,
|
||||
port=DB_PORT,
|
||||
dbname=DB_NAME,
|
||||
user=DB_USER,
|
||||
password=DB_PASSWORD,
|
||||
connect_timeout=5,
|
||||
)
|
||||
log.info("Datenbankverbindung zu %s:%s/%s hergestellt.", DB_HOST, DB_PORT, DB_NAME)
|
||||
return
|
||||
except psycopg2.OperationalError as exc:
|
||||
if versuch == max_versuche:
|
||||
log.error("Konnte nach %d Versuchen keine DB-Verbindung herstellen: %s", max_versuche, exc)
|
||||
raise
|
||||
log.warning("DB noch nicht erreichbar (Versuch %d/%d), warte %ds ...", versuch, max_versuche, wartezeit_sekunden)
|
||||
time.sleep(wartezeit_sekunden)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def get_conn():
|
||||
"""Liefert eine Connection aus dem Pool. Bei Fehlern wird die
|
||||
Connection verworfen statt sie kaputt zurückzugeben (Stabilität bei
|
||||
Langzeitbetrieb)."""
|
||||
if _pool is None:
|
||||
init_pool()
|
||||
conn = _pool.getconn()
|
||||
try:
|
||||
yield conn
|
||||
conn.commit()
|
||||
except Exception:
|
||||
conn.rollback()
|
||||
raise
|
||||
finally:
|
||||
_pool.putconn(conn)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def get_cursor(dict_cursor=True):
|
||||
with get_conn() as conn:
|
||||
cursor_factory = psycopg2.extras.RealDictCursor if dict_cursor else None
|
||||
cur = conn.cursor(cursor_factory=cursor_factory)
|
||||
try:
|
||||
yield cur
|
||||
finally:
|
||||
cur.close()
|
||||
|
||||
|
||||
def migrate():
|
||||
"""Leichte, idempotente Schema-Migrationen für bereits laufende
|
||||
Installationen. `init.sql` wird nur beim allerersten Start (leeres
|
||||
Datenvolume) ausgeführt - bestehende Installationen bekommen neue Spalten
|
||||
stattdessen hier beim App-Start nachgerüstet."""
|
||||
with get_cursor() as cur:
|
||||
cur.execute('ALTER TABLE "Auftraege" ADD COLUMN IF NOT EXISTS "artikel" text')
|
||||
log.info("Schema-Migration geprüft/angewendet.")
|
||||
@@ -0,0 +1,98 @@
|
||||
-- Adminer 5.4.2 PostgreSQL 17.9 dump
|
||||
|
||||
DROP TABLE IF EXISTS "Auftraege";
|
||||
DROP SEQUENCE IF EXISTS "public"."Auftraege_id_seq";
|
||||
CREATE SEQUENCE "public"."Auftraege_id_seq" INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1;
|
||||
|
||||
CREATE TABLE "public"."Auftraege" (
|
||||
"id" integer DEFAULT nextval('"Auftraege_id_seq"') NOT NULL,
|
||||
"auftragsnummer" text,
|
||||
"einheiten" real,
|
||||
"soll_h" real,
|
||||
"status" text,
|
||||
"aktiv" boolean,
|
||||
"start" bigint,
|
||||
"ende" bigint,
|
||||
"created_at" bigint,
|
||||
"sid" real,
|
||||
"maschine_id" real,
|
||||
"artikel" text,
|
||||
CONSTRAINT "Auftraege_pkey" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (oids = false);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS "MDE";
|
||||
DROP SEQUENCE IF EXISTS "public"."MDE_id_seq1";
|
||||
CREATE SEQUENCE "public"."MDE_id_seq1" INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1;
|
||||
|
||||
CREATE TABLE "public"."MDE" (
|
||||
"id" integer DEFAULT nextval('"MDE_id_seq1"') NOT NULL,
|
||||
"maschine_id" real,
|
||||
"timestamp" bigint,
|
||||
"order" text,
|
||||
"produziert" real,
|
||||
"status" text,
|
||||
"h_date" timestamptz,
|
||||
"h_avg" real,
|
||||
"p_grund" text,
|
||||
CONSTRAINT "MDE_pkey1" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (oids = false);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS "Maschinen";
|
||||
DROP SEQUENCE IF EXISTS "public"."Maschinen_id_seq";
|
||||
CREATE SEQUENCE "public"."Maschinen_id_seq" INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1;
|
||||
|
||||
CREATE TABLE "public"."Maschinen" (
|
||||
"id" integer DEFAULT nextval('"Maschinen_id_seq"') NOT NULL,
|
||||
"name" text,
|
||||
"standort" text,
|
||||
CONSTRAINT "Maschinen_pkey" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (oids = false);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS "abweichung";
|
||||
DROP SEQUENCE IF EXISTS "public".abweichung_id_seq;
|
||||
CREATE SEQUENCE "public".abweichung_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1;
|
||||
|
||||
CREATE TABLE "public"."abweichung" (
|
||||
"id" integer DEFAULT nextval('abweichung_id_seq') NOT NULL,
|
||||
"sid" real,
|
||||
"beschreibung" text,
|
||||
CONSTRAINT "abweichung_pkey" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (oids = false);
|
||||
|
||||
|
||||
-- Abweichungsgründe (aus abweichung.sql übernommen)
|
||||
INSERT INTO "public"."abweichung" ("id", "sid", "beschreibung") VALUES
|
||||
(1, 1, 'Andere Anlagenunterstüzung'),
|
||||
(2, 2, 'Drahtführung / Bohrleiste defekt'),
|
||||
(3, 3, 'Einwurfbefüllung'),
|
||||
(4, 4, 'Elektr. / Mech. Störung'),
|
||||
(5, 5, 'Elektrodenwechsel bzw. Verschieben / Magnete'),
|
||||
(6, 6, 'Handabnahme ( Roboter defekt )'),
|
||||
(7, 7, 'Haspel Bestückung'),
|
||||
(8, 8, 'Kein Material'),
|
||||
(9, 9, 'Kein Schichtstapler'),
|
||||
(10, 10, 'Längsdrahteinwurf / Haspelablauf'),
|
||||
(11, 11, 'Maschine Feineinstellung / Nachjustierung'),
|
||||
(12, 12, 'Materialqualität'),
|
||||
(13, 13, 'Mitarbeiter fehlt'),
|
||||
(14, 14, 'Nacharbeit an Maschine ( z.B. ausklinken / beschneiden )'),
|
||||
(16, 16, 'Querdrahteinwurf'),
|
||||
(17, 17, 'Rosetten teilen'),
|
||||
(18, 18, 'Schichtwechsel'),
|
||||
(19, 19, 'Verpackung / Palettenwechsel'),
|
||||
(20, 20, 'Vorgabezeit unrealistisch'),
|
||||
(21, 21, 'Warten auf QS'),
|
||||
(22, 22, 'Warten auf Schichtstapler'),
|
||||
(23, 23, 'Warten auf Teamkoordinator'),
|
||||
(15, 15, 'Pause'),
|
||||
(24, 24, 'Mengenmeldung');
|
||||
SELECT setval('"public".abweichung_id_seq', 24);
|
||||
|
||||
-- 2026-07-17 07:27:25 UTC
|
||||
@@ -0,0 +1,4 @@
|
||||
flask==3.1.0
|
||||
psycopg2-binary==2.9.10
|
||||
gunicorn==23.0.0
|
||||
openpyxl==3.1.5
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 210.1 107" style="enable-background:new 0 0 210.1 107;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M22.9,36.9H31v36.4c-2.8-0.5-5.5-1.2-8.1-2.3V36.9z"/>
|
||||
<rect x="22.9" y="22.9" class="st0" width="8.1" height="8.1"/>
|
||||
<path class="st0" d="M73.3,31H36.9v-8.1H71C72,25.5,72.8,28.2,73.3,31z"/>
|
||||
<path class="st0" d="M17,17H5.8C8.7,12.5,12.5,8.7,17,5.8V17z"/>
|
||||
<path class="st0" d="M2.8,22.9H17V31H0.5C0.9,28.2,1.7,25.5,2.8,22.9z"/>
|
||||
<path class="st0" d="M36.9,36.9h36.9c0,20.4-16.5,36.9-36.9,36.9V36.9z"/>
|
||||
<path class="st0" d="M17,36.9v31C6.4,61.1,0,49.4,0,36.9H17z"/>
|
||||
<path class="st0" d="M36.9,17V0c12.6,0,24.2,6.4,31,17H36.9z"/>
|
||||
<path class="st0" d="M31,0.5V17h-8.1V2.8C25.5,1.7,28.2,0.9,31,0.5z"/>
|
||||
<path class="st0" d="M25.3,102.4h-2.7l-3.1-10.2l-3.1,10.2h-2.7L9.2,85.6h3.4l2.6,10.6l3.1-10.6h2.5l3.1,10.6l2.6-10.6h3.4
|
||||
L25.3,102.4z"/>
|
||||
<path class="st0" d="M42.7,100.8c-1.2,1.1-2.8,1.7-4.4,1.6h-6.1V85.6h6.1c1.6-0.1,3.3,0.5,4.5,1.6c1.9,1.9,1.7,4.2,1.7,6.7
|
||||
C44.4,96.4,44.6,98.9,42.7,100.8z M40.4,89.5c-0.6-0.7-1.5-1.1-2.5-1h-2.5v11H38c0.9,0.1,1.8-0.3,2.5-1c0.6-0.8,0.7-2,0.7-4.5
|
||||
C41.1,91.5,41,90.3,40.4,89.5z"/>
|
||||
<path class="st0" d="M59.5,102.4v-9.8l-3.2,6.4H54l-3.2-6.4v9.8h-3.3V85.6h3.2l4.4,9.1l4.4-9.1h3.2v16.8H59.5z"/>
|
||||
<path class="st0" d="M87.7,40.2h0.8c18.1,0.1,32.7,14.9,32.7,33v0.4h-3.9v-0.5c0.1-16-12.8-29-28.7-29.1h-0.8V40.2z"/>
|
||||
<path class="st0" d="M87.7,20.7H89c28.6,0,51.8,23,51.8,52.4v0.7h-5.9V73c0-25.7-20.6-46.5-45.8-46.5h-1.3L87.7,20.7z"/>
|
||||
<path class="st0" d="M87.7,0h1.8c39.7,0,71.9,32.6,71.9,72.8v1h-8v-1c0-35.7-28.6-64.6-63.8-64.7h-1.9L87.7,0z"/>
|
||||
<path class="st0" d="M98.2,100.8c-1.2,1.1-2.8,1.7-4.4,1.6h-6.1V85.6h6.1c1.6-0.1,3.2,0.5,4.4,1.6c1.9,1.9,1.7,4.2,1.7,6.7
|
||||
C99.9,96.4,100.1,98.9,98.2,100.8z M95.9,89.5c-0.6-0.7-1.5-1.1-2.5-1h-2.5v11h2.5c0.9,0.1,1.8-0.3,2.5-1c0.6-0.8,0.7-2,0.7-4.5
|
||||
C96.6,91.5,96.5,90.3,95.9,89.5L95.9,89.5z"/>
|
||||
<path class="st0" d="M105.4,97.2c-0.1,1.4,0.9,2.6,2.3,2.7c0.1,0,0.2,0,0.4,0c1.1,0.1,2.1-0.4,2.8-1.2l1.9,1.8
|
||||
c-1.2,1.3-2.9,2-4.7,1.9c-2.9,0-5.7-1.3-5.7-6.3c0-4,2.2-6.3,5.4-6.3c3.4,0,5.4,2.5,5.4,5.9v1.4H105.4z M109.8,93.7
|
||||
c-0.6-1.1-1.9-1.6-3.1-1c-0.5,0.2-0.8,0.6-1,1c-0.2,0.4-0.3,0.9-0.3,1.3h4.7C110.1,94.6,110,94.2,109.8,93.7L109.8,93.7z"/>
|
||||
<path class="st0" d="M123,102.4v-1.1c-0.8,0.8-1.9,1.3-3.1,1.3c-1.1,0-2.1-0.3-2.9-1.1c-0.9-0.9-1.3-2.2-1.2-3.5v-7.9h3.1v7.4
|
||||
c-0.1,1.1,0.8,2.1,1.9,2.2c1.1,0.1,2.1-0.8,2.2-1.9c0-0.1,0-0.2,0-0.3v-7.4h3.1v12.3H123z"/>
|
||||
<path class="st0" d="M133.3,102.4c-1.8,0.1-3.4-1.3-3.6-3.1c0-0.1,0-0.3,0-0.4v-6.1h-1.3v-2.3h1.3v-3.6h3.1v3.6h2.2v2.3h-2.2v5.9
|
||||
c-0.1,0.5,0.3,1,0.9,1.1c0.1,0,0.1,0,0.2,0h1.1v2.6H133.3z"/>
|
||||
<path class="st0" d="M140.5,97.2c-0.1,1.4,0.9,2.6,2.3,2.7c0.1,0,0.2,0,0.4,0c1.1,0.1,2.1-0.4,2.8-1.2l1.9,1.8
|
||||
c-1.2,1.3-2.9,2-4.7,1.9c-2.9,0-5.7-1.3-5.7-6.3c0-4,2.2-6.3,5.4-6.3c3.4,0,5.4,2.5,5.4,5.9v1.4H140.5z M144.9,93.7
|
||||
c-0.6-1.1-1.9-1.6-3.1-1c-0.5,0.2-0.8,0.6-1,1c-0.2,0.4-0.3,0.9-0.3,1.3h4.7C145.2,94.6,145.1,94.2,144.9,93.7L144.9,93.7z"/>
|
||||
<path class="st0" d="M158.3,102.4v-7.4c0.1-1.1-0.8-2.1-1.9-2.2c-1.1-0.1-2.1,0.8-2.2,1.9c0,0.1,0,0.2,0,0.3v7.4h-3.1V90.1h3v1.1
|
||||
c0.8-0.8,1.9-1.3,3.1-1.3c1.1,0,2.1,0.3,2.9,1.1c0.9,0.9,1.3,2.2,1.2,3.5v7.9L158.3,102.4z"/>
|
||||
<path class="st0" d="M173.3,101.4c-0.8,0.7-1.9,1.1-3,1.1c-1.2,0.1-2.3-0.4-3.1-1.3v1.2h-3V85.6h3.1v5.6c0.8-0.9,1.9-1.3,3-1.2
|
||||
c1.1,0,2.2,0.4,3,1.1c1.2,1.2,1.3,3.3,1.3,5.2C174.5,98.1,174.5,100.2,173.3,101.4z M169.4,92.7c-1.8,0-2.1,1.5-2.1,3.5
|
||||
s0.2,3.5,2.1,3.5s2.1-1.5,2.1-3.5C171.5,94.2,171.2,92.7,169.4,92.7z"/>
|
||||
<path class="st0" d="M180.1,97.2c-0.1,1.4,0.9,2.6,2.3,2.7c0.1,0,0.2,0,0.4,0c1.1,0.1,2.1-0.4,2.8-1.2l1.9,1.8
|
||||
c-1.2,1.3-2.9,2-4.7,1.9c-2.9,0-5.7-1.3-5.7-6.3c0-4,2.2-6.3,5.4-6.3c3.4,0,5.4,2.5,5.4,5.9v1.4H180.1z M184.5,93.7
|
||||
c-0.6-1.1-1.9-1.6-3.1-1c-0.4,0.2-0.8,0.6-1,1c-0.2,0.4-0.3,0.9-0.3,1.3h4.7C184.8,94.6,184.7,94.2,184.5,93.7L184.5,93.7z"/>
|
||||
<path class="st0" d="M197.2,93.4c-0.7-0.9-2-1-2.9-0.2c-0.5,0.4-0.8,1.1-0.7,1.8v7.4h-3.1V90.1h3v1.2c0.8-0.9,1.9-1.3,3.1-1.3
|
||||
c1.1-0.1,2.2,0.4,2.9,1.2L197.2,93.4z"/>
|
||||
<path class="st0" d="M204.7,107c-1.7,0.1-3.3-0.4-4.5-1.6l1.9-1.9c0.6,0.6,1.5,1,2.4,0.9c1.3,0.1,2.4-0.9,2.5-2.1c0-0.1,0-0.3,0-0.4
|
||||
v-1.2c-0.7,0.8-1.8,1.3-2.9,1.2c-1.1,0-2.1-0.4-2.9-1.1c-1.2-1.2-1.3-2.7-1.3-4.9c0-2.2,0.1-3.7,1.3-4.9c0.8-0.7,1.9-1.1,2.9-1.1
|
||||
c1.1-0.1,2.3,0.4,3,1.3v-1.2h3v11.9C210.2,104.9,208,107,204.7,107z M205,92.7c-1.8,0-2,1.6-2,3.2s0.2,3.2,2,3.2s2-1.6,2-3.2
|
||||
C207,94.2,206.8,92.7,205,92.7z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,484 @@
|
||||
:root {
|
||||
--bg: #12161c;
|
||||
--panel: #1c222b;
|
||||
--panel-2: #262e3a;
|
||||
--border: #333d4c;
|
||||
--text: #eef1f5;
|
||||
--text-dim: #9aa4b2;
|
||||
--primary: #2f7dff;
|
||||
--primary-dark: #1f5fd6;
|
||||
--green: #2fb872;
|
||||
--amber: #e0a629;
|
||||
--red: #e0433b;
|
||||
--radius: 16px;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: "Segoe UI", Roboto, Arial, sans-serif;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#app {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 28px 24px 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.header-logo {
|
||||
/* Logo ist von Haus aus breiter als hoch (kein Quadrat) - deshalb nur die
|
||||
Höhe vorgeben und die Breite automatisch im echten Seitenverhältnis
|
||||
mitskalieren lassen, statt es in ein Quadrat zu zwingen/zu verzerren. */
|
||||
height: 130px;
|
||||
width: auto;
|
||||
max-width: 90%;
|
||||
display: block;
|
||||
margin: 0 auto 10px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
margin: 0;
|
||||
font-size: 2.4em;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.header .subtitle {
|
||||
color: var(--text-dim);
|
||||
font-size: 1.1em;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 16px 24px 40px;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
.content.wide {
|
||||
max-width: 1400px;
|
||||
}
|
||||
|
||||
.btn-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||||
gap: 20px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.big-btn {
|
||||
background: var(--panel);
|
||||
border: 2px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
color: var(--text);
|
||||
padding: 32px 20px;
|
||||
font-size: 1.4em;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
|
||||
min-height: 120px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font-family: inherit;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
form.btn-form { display: contents; }
|
||||
.order-form { display: block; width: 100%; }
|
||||
.order-form .order-item { width: 100%; }
|
||||
|
||||
.big-btn:active { transform: scale(0.97); }
|
||||
|
||||
.big-btn.primary { background: var(--primary); border-color: var(--primary-dark); }
|
||||
.big-btn.green { background: var(--green); border-color: #1f8f57; }
|
||||
.big-btn.amber { background: var(--amber); border-color: #b98418; color: #23200f; }
|
||||
.big-btn.red { background: var(--red); border-color: #a92e28; }
|
||||
.big-btn.neutral { background: var(--panel-2); }
|
||||
.big-btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
|
||||
.big-btn.small {
|
||||
min-height: 70px;
|
||||
font-size: 1.1em;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.back-row {
|
||||
margin-top: 28px;
|
||||
}
|
||||
.back-row.top {
|
||||
margin-top: 0;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
.machine-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 14px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.machine-link {
|
||||
background: var(--panel-2);
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 18px 12px;
|
||||
text-decoration: none;
|
||||
color: var(--text);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 1.1em;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
.machine-link:active { transform: scale(0.97); }
|
||||
.machine-link .machine-link-status {
|
||||
font-size: 0.7em;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-dim);
|
||||
background: var(--bg);
|
||||
padding: 3px 10px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.machine-link.aktiv { border-color: var(--green); }
|
||||
.machine-link.aktiv .machine-link-status { color: var(--green); }
|
||||
.machine-link .machine-link-artikel {
|
||||
font-size: 0.65em;
|
||||
font-weight: 500;
|
||||
color: var(--text-dim);
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--panel);
|
||||
border: 2px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 24px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.card.compact { padding: 18px 20px; max-width: 480px; margin-left: auto; margin-right: auto; }
|
||||
|
||||
.compact-form { max-width: 480px; margin: 0 auto; }
|
||||
.compact-form .form-group { margin-top: 12px; }
|
||||
.compact-form .form-group label { font-size: 0.95em; margin-bottom: 5px; }
|
||||
.compact-form .form-group input, .compact-form .form-group select {
|
||||
padding: 11px 12px;
|
||||
font-size: 1.05em;
|
||||
}
|
||||
.form-row-2 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
.action-row.compact { max-width: 480px; margin: 20px auto 0; }
|
||||
.action-row.compact .big-btn { flex: none; width: 100%; }
|
||||
|
||||
.status-line {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 1.15em;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.status-line:last-child { border-bottom: none; }
|
||||
.status-line .label { color: var(--text-dim); }
|
||||
|
||||
.order-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
|
||||
|
||||
.order-item {
|
||||
background: var(--panel-2);
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 18px 22px;
|
||||
cursor: pointer;
|
||||
font-size: 1.2em;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-family: inherit;
|
||||
color: var(--text);
|
||||
text-align: left;
|
||||
border-left: 6px solid var(--primary);
|
||||
}
|
||||
button.order-item:active { transform: scale(0.98); }
|
||||
.order-item-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
.order-item-nummer {
|
||||
font-size: 1.3em;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
.order-item-menge {
|
||||
font-size: 0.75em;
|
||||
color: var(--text-dim);
|
||||
font-weight: 500;
|
||||
}
|
||||
.order-item .tag {
|
||||
font-size: 0.7em;
|
||||
padding: 4px 10px;
|
||||
border-radius: 20px;
|
||||
background: var(--amber);
|
||||
color: #23200f;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
margin-left: 14px;
|
||||
}
|
||||
|
||||
.form-group { margin-top: 18px; }
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 1.1em;
|
||||
color: var(--text-dim);
|
||||
}
|
||||
.form-group input, .form-group select {
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
font-size: 1.3em;
|
||||
border-radius: 10px;
|
||||
border: 2px solid var(--border);
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.error-box {
|
||||
background: rgba(224, 67, 59, 0.15);
|
||||
border: 2px solid var(--red);
|
||||
color: #ffb3af;
|
||||
padding: 14px 18px;
|
||||
border-radius: 10px;
|
||||
margin-top: 18px;
|
||||
font-size: 1.05em;
|
||||
}
|
||||
|
||||
.info-box {
|
||||
background: rgba(47, 125, 255, 0.12);
|
||||
border: 2px solid var(--primary);
|
||||
padding: 14px 18px;
|
||||
border-radius: 10px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.action-row {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
margin-top: 26px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.action-row .big-btn { flex: 1; min-width: 160px; }
|
||||
|
||||
table.data-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 16px;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
table.data-table th, table.data-table td {
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 9px 10px;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
table.data-table th {
|
||||
color: var(--text-dim);
|
||||
font-weight: 600;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: var(--bg);
|
||||
z-index: 1;
|
||||
}
|
||||
table.data-table tr:hover { background: var(--panel-2); }
|
||||
table.data-table td.col-actions { white-space: nowrap; }
|
||||
|
||||
.table-wrap {
|
||||
overflow: auto;
|
||||
max-height: 68vh;
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 12px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
.table-wrap table.data-table { margin-top: 0; }
|
||||
|
||||
.list-meta {
|
||||
color: var(--text-dim);
|
||||
font-size: 0.95em;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.row-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.filter-row { display: flex; gap: 14px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
|
||||
.filter-row select { padding: 10px; font-size: 1em; border-radius: 8px; border: 2px solid var(--border); background: var(--bg); color: var(--text); }
|
||||
.filter-row button { padding: 10px 18px; font-size: 1em; border-radius: 8px; border: 2px solid var(--border); background: var(--panel-2); color: var(--text); cursor: pointer; font-family: inherit; }
|
||||
|
||||
.confirm-box {
|
||||
background: var(--panel);
|
||||
border: 3px solid var(--red);
|
||||
border-radius: var(--radius);
|
||||
padding: 32px;
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.confirm-box h2 { font-size: 1.6em; margin-top: 0; }
|
||||
|
||||
.loading, .empty-state {
|
||||
text-align: center;
|
||||
color: var(--text-dim);
|
||||
padding: 40px 20px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.modal-overlay {
|
||||
position: fixed; inset: 0;
|
||||
background: rgba(0,0,0,0.7);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
z-index: 50;
|
||||
padding: 20px;
|
||||
}
|
||||
.modal-box {
|
||||
background: var(--panel);
|
||||
border: 3px solid var(--red);
|
||||
border-radius: var(--radius);
|
||||
padding: 32px;
|
||||
max-width: 480px;
|
||||
text-align: center;
|
||||
}
|
||||
.modal-box h2 { font-size: 1.6em; margin-top: 0; }
|
||||
.modal-actions { display: flex; gap: 16px; margin-top: 26px; }
|
||||
.modal-actions .big-btn { flex: 1; }
|
||||
|
||||
.priority-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
|
||||
.priority-item {
|
||||
background: var(--panel-2);
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 10px;
|
||||
padding: 14px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
font-size: 1.1em;
|
||||
cursor: grab;
|
||||
}
|
||||
.priority-item.dragging {
|
||||
opacity: 0.4;
|
||||
border-style: dashed;
|
||||
}
|
||||
.priority-item .drag-handle {
|
||||
font-size: 1.3em;
|
||||
color: var(--text-dim);
|
||||
line-height: 1;
|
||||
}
|
||||
.priority-item .priority-item-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
.priority-item .priority-item-artikel {
|
||||
font-size: 0.75em;
|
||||
color: var(--text-dim);
|
||||
font-weight: 500;
|
||||
}
|
||||
.priority-item .tag {
|
||||
margin-left: auto;
|
||||
font-size: 0.75em;
|
||||
padding: 4px 10px;
|
||||
border-radius: 20px;
|
||||
background: var(--amber);
|
||||
color: #23200f;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.priority-item .sid-badge {
|
||||
background: var(--primary);
|
||||
border-radius: 20px;
|
||||
padding: 4px 12px;
|
||||
font-size: 0.85em;
|
||||
font-weight: 700;
|
||||
}
|
||||
.hint {
|
||||
color: var(--text-dim);
|
||||
font-size: 0.95em;
|
||||
margin: 10px 0 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.save-indicator {
|
||||
margin-top: 12px;
|
||||
color: var(--text-dim);
|
||||
font-size: 0.9em;
|
||||
min-height: 1.3em;
|
||||
}
|
||||
.card details { margin-top: 14px; }
|
||||
.card summary { cursor: pointer; font-weight: 600; }
|
||||
.card ul { margin: 8px 0 0; padding-left: 20px; }
|
||||
.card li { margin-bottom: 5px; }
|
||||
|
||||
.dropzone {
|
||||
position: relative;
|
||||
border: 2px dashed var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 34px 16px;
|
||||
text-align: center;
|
||||
background: var(--bg);
|
||||
transition: border-color 0.15s ease, background 0.15s ease;
|
||||
}
|
||||
.dropzone.dragover {
|
||||
border-color: var(--primary);
|
||||
background: rgba(47, 125, 255, 0.1);
|
||||
}
|
||||
.dropzone input[type="file"] {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.dropzone-text {
|
||||
color: var(--text-dim);
|
||||
font-size: 1.02em;
|
||||
pointer-events: none;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.icon-btn {
|
||||
background: var(--panel-2);
|
||||
border: 2px solid var(--border);
|
||||
color: var(--text);
|
||||
border-radius: 8px;
|
||||
padding: 9px 16px;
|
||||
cursor: pointer;
|
||||
font-size: 0.95em;
|
||||
font-family: inherit;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
min-width: 92px;
|
||||
text-align: center;
|
||||
}
|
||||
.icon-btn.danger { border-color: var(--red); color: #ffb3af; }
|
||||
|
||||
@media (min-width: 700px) {
|
||||
.header h1 { font-size: 3em; }
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title>{{ title }} – WDM Performance</title>
|
||||
<link rel="icon" type="image/svg+xml" href="{{ url_for('static', filename='logo.svg') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="header">
|
||||
<img class="header-logo" src="{{ url_for('static', filename='logo.svg') }}" alt="Logo">
|
||||
<h1>{{ title }}</h1>
|
||||
{% if subtitle %}<div class="subtitle">{{ subtitle }}</div>{% endif %}
|
||||
</div>
|
||||
<div class="content {{ content_class or '' }}">
|
||||
{% if error %}<div class="error-box">{{ error }}</div>{% endif %}
|
||||
{% if info %}<div class="info-box">{{ info }}</div>{% endif %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
</div>
|
||||
<p class="hint" style="max-width:480px; margin-left:auto; margin-right:auto;">
|
||||
Priorität = Position in der Warteschlange dieser Maschine (1 = als
|
||||
nächstes dran). Bestehende offene/pausierte Aufträge dieser
|
||||
Maschine rücken automatisch nach. Leer lassen, um den Auftrag ans
|
||||
Ende einzureihen.
|
||||
</p>
|
||||
<form method="post" action="{{ url_for('leitstand_anlegen') }}" class="compact-form">
|
||||
<div class="card compact">
|
||||
<div class="form-group">
|
||||
<label for="maschine_id">Maschine</label>
|
||||
<select id="maschine_id" name="maschine_id" required>
|
||||
{% for m in maschinen %}
|
||||
<option value="{{ m.id }}" {% if eingabe.maschine_id|string == m.id|string %}selected{% endif %}>{{ m.name or ('Maschine ' ~ m.id) }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="auftragsnummer">Auftragsnummer</label>
|
||||
<input type="text" id="auftragsnummer" name="auftragsnummer" placeholder="z.B. AT-2026-001" value="{{ eingabe.auftragsnummer or '' }}" autofocus required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="artikel">Artikel (optional)</label>
|
||||
<input type="text" id="artikel" name="artikel" placeholder="z.B. 1000042144 HLB2" value="{{ eingabe.artikel or '' }}">
|
||||
</div>
|
||||
<div class="form-row-2">
|
||||
<div class="form-group">
|
||||
<label for="einheiten">Produktionsmenge (Stück)</label>
|
||||
<input type="number" min="1" step="any" inputmode="decimal" id="einheiten" name="einheiten" value="{{ eingabe.einheiten or '' }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="soll_h">Stück/Stunde (Soll)</label>
|
||||
<input type="number" min="1" step="any" inputmode="decimal" id="soll_h" name="soll_h" value="{{ eingabe.soll_h or '' }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="prioritaet">Priorität (optional)</label>
|
||||
<input type="number" min="1" step="1" inputmode="numeric" id="prioritaet" name="prioritaet" placeholder="Freilassen = ans Ende der Warteschlange" value="{{ eingabe.prioritaet or '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-row compact">
|
||||
<button type="submit" class="big-btn small primary">✓ Anlegen</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="btn-grid">
|
||||
<a class="big-btn primary" href="{{ url_for('leitstand_anlegen') }}">➕ Auftrag anlegen</a>
|
||||
<a class="big-btn" href="{{ url_for('leitstand_import') }}">↑ Aufträge importieren</a>
|
||||
<a class="big-btn green" href="{{ url_for('leitstand_uebersicht') }}">📋 Auftragsübersicht</a>
|
||||
<a class="big-btn amber" href="{{ url_for('leitstand_korrektur') }}">🔧 Buchungskorrektur</a>
|
||||
<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('maschinenverwaltung') }}">🔒 Maschinenverwaltung</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,105 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
</div>
|
||||
|
||||
<div class="card compact">
|
||||
<p class="hint">
|
||||
Excel- (.xlsx) oder CSV-Datei mit den Spalten <strong>Maschine</strong>, <strong>man. Prio</strong>,
|
||||
<strong>FA.-Nr.</strong>, <strong>Rest-Menge</strong>, <strong>Ist-Menge</strong>,
|
||||
<strong>Artikel</strong> und <strong>Soll-pro-Stunde</strong> hochladen (weitere Spalten
|
||||
wie Bezeichnung/Auftrag/Lieferdatum/Bemerkung werden ignoriert). Bei CSV werden
|
||||
Trennzeichen (Komma/Semikolon/Tab) und Zahlformat (1.234,56 oder 1234.56)
|
||||
automatisch erkannt.<br>
|
||||
Aufträge für unbekannte Maschinen werden verworfen, bereits vorhandene
|
||||
FA.-Nrn. bleiben unangetastet. Ist die Rest-Menge 0, wird der Auftrag direkt als
|
||||
abgeschlossen angelegt.
|
||||
</p>
|
||||
<form method="post" action="{{ url_for('leitstand_import') }}" enctype="multipart/form-data" class="compact-form">
|
||||
<div class="form-group">
|
||||
<label for="datei">Excel- oder CSV-Datei</label>
|
||||
<div class="dropzone" id="dropzone">
|
||||
<input type="file" id="datei" name="datei" accept=".xlsx,.csv" required>
|
||||
<div class="dropzone-text" id="dropzone-text">Datei hierher ziehen oder klicken zum Auswählen</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-row compact">
|
||||
<button type="submit" class="big-btn small primary">↑ Importieren</button>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
(function () {
|
||||
var zone = document.getElementById('dropzone');
|
||||
var input = document.getElementById('datei');
|
||||
var text = document.getElementById('dropzone-text');
|
||||
if (!zone || !input || !text) return;
|
||||
var standardtext = text.textContent;
|
||||
|
||||
['dragenter', 'dragover'].forEach(function (evtName) {
|
||||
zone.addEventListener(evtName, function (e) {
|
||||
e.preventDefault();
|
||||
zone.classList.add('dragover');
|
||||
});
|
||||
});
|
||||
zone.addEventListener('dragleave', function (e) {
|
||||
e.preventDefault();
|
||||
zone.classList.remove('dragover');
|
||||
});
|
||||
zone.addEventListener('drop', function (e) {
|
||||
e.preventDefault();
|
||||
zone.classList.remove('dragover');
|
||||
var dateien = e.dataTransfer && e.dataTransfer.files;
|
||||
if (dateien && dateien.length) {
|
||||
// Datei aktiv aus dem Drop-Ereignis übernehmen (statt uns auf das
|
||||
// native Standardverhalten des überlagerten <input> zu verlassen -
|
||||
// das greift nicht zuverlässig, weil wir dragover/drop hier ohnehin
|
||||
// abfangen müssen, um die Hervorhebung zu steuern).
|
||||
input.files = dateien;
|
||||
input.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
});
|
||||
input.addEventListener('change', function () {
|
||||
text.textContent = (input.files && input.files.length) ? input.files[0].name : standardtext;
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
|
||||
{% if ergebnis %}
|
||||
<div class="card">
|
||||
<h3>Ergebnis</h3>
|
||||
<p>
|
||||
{{ ergebnis.importiert|length }} importiert,
|
||||
{{ ergebnis.uebersprungen_vorhanden|length }} bereits vorhanden (übersprungen),
|
||||
{{ ergebnis.verworfen_maschine|length }} wegen unbekannter Maschine verworfen{% if ergebnis.fehlerhafte_zeilen %},
|
||||
{{ ergebnis.fehlerhafte_zeilen|length }} fehlerhaft{% endif %}.
|
||||
</p>
|
||||
|
||||
{% if ergebnis.importiert %}
|
||||
<details open>
|
||||
<summary>Importiert ({{ ergebnis.importiert|length }})</summary>
|
||||
<ul>{% for z in ergebnis.importiert %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
{% if ergebnis.uebersprungen_vorhanden %}
|
||||
<details>
|
||||
<summary>Bereits vorhanden – übersprungen ({{ ergebnis.uebersprungen_vorhanden|length }})</summary>
|
||||
<ul>{% for z in ergebnis.uebersprungen_vorhanden %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
{% if ergebnis.verworfen_maschine %}
|
||||
<details>
|
||||
<summary>Maschine unbekannt – verworfen ({{ ergebnis.verworfen_maschine|length }})</summary>
|
||||
<ul>{% for z in ergebnis.verworfen_maschine %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
{% if ergebnis.fehlerhafte_zeilen %}
|
||||
<details>
|
||||
<summary>Fehlerhafte Zeilen ({{ ergebnis.fehlerhafte_zeilen|length }})</summary>
|
||||
<ul>{% for z in ergebnis.fehlerhafte_zeilen %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,53 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
</div>
|
||||
|
||||
<form method="get" action="{{ url_for('leitstand_korrektur') }}" class="filter-row">
|
||||
<span>Maschine filtern:</span>
|
||||
<select name="maschine_id" onchange="this.form.submit()">
|
||||
<option value="">Alle Maschinen</option>
|
||||
{% for m in maschinen %}
|
||||
<option value="{{ m.id }}" {% if filter_maschine_id|string == m.id|string %}selected{% endif %}>{{ m.name or ('Maschine ' ~ m.id) }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button type="submit">Filtern</button>
|
||||
</form>
|
||||
|
||||
{% if not eintraege %}
|
||||
<div class="empty-state">Keine Einträge gefunden.</div>
|
||||
{% else %}
|
||||
<div class="list-meta">{{ eintraege|length }} Buchungen (neueste zuerst)</div>
|
||||
<div class="table-wrap">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr><th>ID</th><th>Maschine</th><th>Zeit</th><th>Auftrag</th><th>Produziert</th><th>Status</th><th>Ø/h</th><th>Grund</th><th class="col-actions"></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for m in eintraege %}
|
||||
<tr>
|
||||
<td>{{ m.id }}</td>
|
||||
<td>{{ m.maschine_id|int }}</td>
|
||||
<td>{{ m.zeit_fmt }}</td>
|
||||
<td>{{ m.order }}</td>
|
||||
<td>{{ m.produziert_fmt }}</td>
|
||||
<td>{{ m.status }}</td>
|
||||
<td>{{ m.h_avg_fmt }}</td>
|
||||
<td>{{ m.p_grund or '' }}</td>
|
||||
<td class="col-actions">
|
||||
<div class="row-actions">
|
||||
<a class="icon-btn" href="{{ url_for('leitstand_korrektur_bearbeiten', mde_id=m.id, maschine_id=filter_maschine_id) }}">Bearbeiten</a>
|
||||
<form method="post" action="{{ url_for('leitstand_korrektur_loeschen', mde_id=m.id) }}" class="order-form">
|
||||
<input type="hidden" name="maschine_id" value="{{ filter_maschine_id or '' }}">
|
||||
<button type="submit" class="icon-btn danger">Löschen</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,34 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_korrektur', maschine_id=filter_maschine_id) }}">← Zurück</a>
|
||||
</div>
|
||||
<form method="post" action="{{ url_for('leitstand_korrektur_bearbeiten', mde_id=eintrag.id) }}">
|
||||
<input type="hidden" name="maschine_id_filter" value="{{ filter_maschine_id or '' }}">
|
||||
<div class="card">
|
||||
<div class="form-group">
|
||||
<label for="order">Auftragsnummer</label>
|
||||
<input type="text" id="order" name="order" value="{{ eintrag.order }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="produziert">Produziert</label>
|
||||
<input type="number" step="any" id="produziert" name="produziert" value="{{ eintrag.produziert_fmt }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status">Status</label>
|
||||
<input type="text" id="status" name="status" value="{{ eintrag.status }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="h_avg">Ø Stück/Stunde</label>
|
||||
<input type="number" step="any" id="h_avg" name="h_avg" value="{{ eintrag.h_avg_fmt }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="p_grund">Abweichungsgrund</label>
|
||||
<input type="text" id="p_grund" name="p_grund" value="{{ eintrag.p_grund or '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-row">
|
||||
<button type="submit" class="big-btn primary">✓ Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,15 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
</div>
|
||||
<div class="machine-grid">
|
||||
{% for m in maschinen %}
|
||||
<a class="machine-link {{ 'aktiv' if m.hat_aktiven_auftrag else '' }}" href="{{ url_for('machine_main', maschine_id=m.id) }}">
|
||||
<span class="machine-link-name">{{ m.name or ('Maschine ' ~ m.id) }}</span>
|
||||
{% if m.aktiver_artikel %}<span class="machine-link-artikel">{{ m.aktiver_artikel }}</span>{% endif %}
|
||||
<span class="machine-link-status">{{ "l\u00e4uft" if m.hat_aktiven_auftrag else "frei" }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,109 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
</div>
|
||||
<form method="get" action="{{ url_for('leitstand_prioritaet') }}" class="filter-row">
|
||||
<span>Maschine:</span>
|
||||
<select name="maschine_id" onchange="this.form.submit()">
|
||||
{% for m in maschinen %}
|
||||
<option value="{{ m.id }}" {% if filter_maschine_id|string == m.id|string %}selected{% endif %}>{{ m.name or ('Maschine ' ~ m.id) }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button type="submit">Anzeigen</button>
|
||||
</form>
|
||||
|
||||
{% if filter_maschine_id and not auftraege %}
|
||||
<div class="empty-state">Keine offenen/pausierten Aufträge für diese Maschine.</div>
|
||||
{% elif auftraege %}
|
||||
<p class="hint">
|
||||
Reihenfolge per Drag & Drop ändern: Auftrag mit der Maus anfassen (Symbol
|
||||
☰) und an die gewünschte Position ziehen. Die neue Reihenfolge wird
|
||||
automatisch gespeichert. <em>Hinweis: funktioniert am PC/Laptop mit Maus; auf
|
||||
reinen Touch-Geräten ohne Maus ist Drag & Drop ggf. eingeschränkt.</em>
|
||||
</p>
|
||||
<noscript><div class="error-box">Für die Sortierung per Drag & Drop wird JavaScript benötigt.</div></noscript>
|
||||
<div class="priority-list" id="priority-list" data-maschine-id="{{ filter_maschine_id }}">
|
||||
{% for a in auftraege %}
|
||||
<div class="priority-item" draggable="true" data-id="{{ a.id }}">
|
||||
<span class="drag-handle">☰</span>
|
||||
<span class="sid-badge">#{{ loop.index }}</span>
|
||||
<span class="priority-item-info">
|
||||
<span>{{ a.auftragsnummer }}</span>
|
||||
{% if a.artikel %}<span class="priority-item-artikel">{{ a.artikel }}</span>{% endif %}
|
||||
</span>
|
||||
<span class="tag">{{ a.status_label }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="save-indicator" id="save-indicator" aria-live="polite"></div>
|
||||
<script>
|
||||
(function () {
|
||||
var list = document.getElementById('priority-list');
|
||||
if (!list) return;
|
||||
var indicator = document.getElementById('save-indicator');
|
||||
|
||||
function getDragAfterElement(container, y) {
|
||||
var items = Array.prototype.slice.call(container.querySelectorAll('.priority-item:not(.dragging)'));
|
||||
return items.reduce(function (closest, child) {
|
||||
var box = child.getBoundingClientRect();
|
||||
var offset = y - box.top - box.height / 2;
|
||||
if (offset < 0 && offset > closest.offset) {
|
||||
return { offset: offset, element: child };
|
||||
}
|
||||
return closest;
|
||||
}, { offset: -Infinity, element: null }).element;
|
||||
}
|
||||
|
||||
function updateBadges() {
|
||||
Array.prototype.forEach.call(list.querySelectorAll('.priority-item'), function (el, idx) {
|
||||
var badge = el.querySelector('.sid-badge');
|
||||
if (badge) badge.textContent = '#' + (idx + 1);
|
||||
});
|
||||
}
|
||||
|
||||
function persistOrder() {
|
||||
var ids = Array.prototype.map.call(list.querySelectorAll('.priority-item'), function (el) {
|
||||
return el.getAttribute('data-id');
|
||||
});
|
||||
updateBadges();
|
||||
if (indicator) indicator.textContent = 'Speichere…';
|
||||
fetch("{{ url_for('leitstand_prioritaet_reihenfolge') }}", {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ maschine_id: list.getAttribute('data-maschine-id'), ids: ids })
|
||||
}).then(function (resp) {
|
||||
if (indicator) indicator.textContent = resp.ok ? 'Gespeichert.' : 'Fehler beim Speichern.';
|
||||
}).catch(function () {
|
||||
if (indicator) indicator.textContent = 'Fehler beim Speichern.';
|
||||
});
|
||||
}
|
||||
|
||||
list.addEventListener('dragstart', function (e) {
|
||||
var item = e.target.closest('.priority-item');
|
||||
if (!item) return;
|
||||
item.classList.add('dragging');
|
||||
e.dataTransfer.effectAllowed = 'move';
|
||||
});
|
||||
|
||||
list.addEventListener('dragend', function (e) {
|
||||
var item = e.target.closest('.priority-item');
|
||||
if (item) item.classList.remove('dragging');
|
||||
persistOrder();
|
||||
});
|
||||
|
||||
list.addEventListener('dragover', function (e) {
|
||||
e.preventDefault();
|
||||
var dragging = list.querySelector('.dragging');
|
||||
if (!dragging) return;
|
||||
var after = getDragAfterElement(list, e.clientY);
|
||||
if (after == null) {
|
||||
list.appendChild(dragging);
|
||||
} else {
|
||||
list.insertBefore(dragging, after);
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,60 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
</div>
|
||||
|
||||
<form method="get" action="{{ url_for('leitstand_uebersicht') }}" class="filter-row">
|
||||
<span>Maschine:</span>
|
||||
<select name="maschine_id" onchange="this.form.submit()">
|
||||
<option value="">Alle Maschinen</option>
|
||||
{% for m in maschinen %}
|
||||
<option value="{{ m.id }}" {% if filter_maschine_id|string == m.id|string %}selected{% endif %}>{{ m.name or ('Maschine ' ~ m.id) }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<span>Status:</span>
|
||||
<select name="status" onchange="this.form.submit()">
|
||||
<option value="offen_pause" {% if filter_status == "offen_pause" %}selected{% endif %}>Offen/Pausiert</option>
|
||||
<option value="alle" {% if filter_status == "alle" %}selected{% endif %}>Alle</option>
|
||||
</select>
|
||||
<button type="submit">Filtern</button>
|
||||
</form>
|
||||
|
||||
{% if not auftraege %}
|
||||
<div class="empty-state">Keine Aufträge gefunden.</div>
|
||||
{% else %}
|
||||
<div class="list-meta">{{ auftraege|length }} Aufträge</div>
|
||||
<div class="table-wrap">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr><th>ID</th><th>Auftragsnr.</th><th>Artikel</th><th>Maschine</th><th>Menge</th><th>Stk/h</th><th>Status</th><th>Aktiv</th><th>SID</th><th class="col-actions"></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for a in auftraege %}
|
||||
<tr>
|
||||
<td>{{ a.id }}</td>
|
||||
<td>{{ a.auftragsnummer }}</td>
|
||||
<td>{{ a.artikel or "-" }}</td>
|
||||
<td>{{ a.maschine_name }}</td>
|
||||
<td>{{ a.einheiten_fmt }}</td>
|
||||
<td>{{ a.soll_h_fmt }}</td>
|
||||
<td>{{ a.status_label }}</td>
|
||||
<td>{{ "Ja" if a.aktiv else "Nein" }}</td>
|
||||
<td>{{ a.sid_fmt }}</td>
|
||||
<td class="col-actions">
|
||||
<div class="row-actions">
|
||||
<a class="icon-btn" href="{{ url_for('leitstand_uebersicht_bearbeiten', auftrag_id=a.id, maschine_id=filter_maschine_id, status=filter_status) }}">Bearbeiten</a>
|
||||
<form method="post" action="{{ url_for('leitstand_uebersicht_loeschen', auftrag_id=a.id) }}" class="order-form">
|
||||
<input type="hidden" name="maschine_id" value="{{ filter_maschine_id or '' }}">
|
||||
<input type="hidden" name="status" value="{{ filter_status }}">
|
||||
<button type="submit" class="icon-btn danger">Löschen</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,46 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_uebersicht', maschine_id=filter_maschine_id, status=filter_status) }}">← Zurück</a>
|
||||
</div>
|
||||
<form method="post" action="{{ url_for('leitstand_uebersicht_bearbeiten', auftrag_id=auftrag.id) }}">
|
||||
<input type="hidden" name="maschine_id_filter" value="{{ filter_maschine_id or '' }}">
|
||||
<input type="hidden" name="status_filter" value="{{ filter_status or '' }}">
|
||||
<div class="card">
|
||||
<div class="form-group">
|
||||
<label for="maschine_id">Maschine</label>
|
||||
<select id="maschine_id" name="maschine_id" {{ 'disabled' if gesperrt }} required>
|
||||
{% for m in maschinen %}
|
||||
<option value="{{ m.id }}" {% if auftrag.maschine_id|int == m.id %}selected{% endif %}>{{ m.name or ('Maschine ' ~ m.id) }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="auftragsnummer">Auftragsnummer</label>
|
||||
<input type="text" id="auftragsnummer" name="auftragsnummer" value="{{ auftrag.auftragsnummer }}" {{ 'readonly' if gesperrt }} required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="artikel">Artikel</label>
|
||||
<input type="text" id="artikel" name="artikel" value="{{ auftrag.artikel or '' }}" {{ 'readonly' if gesperrt }}>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="einheiten">Produktionsmenge</label>
|
||||
<input type="number" step="any" id="einheiten" name="einheiten" value="{{ auftrag.einheiten_fmt }}" {{ 'readonly' if gesperrt }} required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="soll_h">Stück pro Stunde</label>
|
||||
<input type="number" step="any" id="soll_h" name="soll_h" value="{{ auftrag.soll_h_fmt }}" {{ 'readonly' if gesperrt }} required>
|
||||
</div>
|
||||
<div class="status-line"><span class="label">Status</span><span>{{ status_anzeige }}</span></div>
|
||||
<div class="status-line">
|
||||
<span class="label">Priorität</span>
|
||||
<span>{{ auftrag.sid_fmt }} <span style="color:var(--text-dim); font-size:0.85em;">(änderbar unter "Auftragspriorität")</span></span>
|
||||
</div>
|
||||
</div>
|
||||
{% if not gesperrt %}
|
||||
<div class="action-row">
|
||||
<button type="submit" class="big-btn primary">✓ Speichern</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('machine_main', maschine_id=maschine.id) }}">← Zurück</a>
|
||||
</div>
|
||||
{% if not auftraege %}
|
||||
<div class="empty-state">Keine offenen oder pausierten Aufträge für diese Maschine.</div>
|
||||
{% else %}
|
||||
<div class="order-list">
|
||||
{% for a in auftraege %}
|
||||
<form method="post" action="{{ url_for('machine_auswahl_waehlen', maschine_id=maschine.id) }}" class="order-form">
|
||||
<input type="hidden" name="auftrag_id" value="{{ a.id }}">
|
||||
<button type="submit" class="order-item">
|
||||
<span class="order-item-main">
|
||||
<span class="order-item-nummer">{{ a.auftragsnummer }}</span>
|
||||
{% if a.artikel %}<span class="order-item-menge">{{ a.artikel }}</span>{% endif %}
|
||||
<span class="order-item-menge">{{ a.einheiten_fmt }} Stk.</span>
|
||||
</span>
|
||||
<span class="tag">{{ a.status_label }}</span>
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="confirm-box">
|
||||
<h2>Wirklich beenden?</h2>
|
||||
<p>Die Sollmenge ({{ soll_fmt }}) wurde noch nicht erreicht.<br>Bisher gemeldet: {{ bisherige_fmt }}.</p>
|
||||
<div class="modal-actions">
|
||||
<a class="big-btn neutral" href="{{ url_for('machine_main', maschine_id=maschine.id) }}">Abbrechen</a>
|
||||
<form method="post" action="{{ url_for('machine_beenden', maschine_id=maschine.id) }}" class="order-form">
|
||||
<button type="submit" class="big-btn red">Ja, beenden</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,31 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
{% if not auftrag %}
|
||||
<div class="card">
|
||||
<div class="empty-state">Kein aktiver Auftrag.</div>
|
||||
</div>
|
||||
<div class="btn-grid">
|
||||
<a class="big-btn primary" href="{{ url_for('machine_auswahl', maschine_id=maschine.id) }}">▶ Start</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card">
|
||||
<div class="status-line"><span class="label">Auftragsnummer</span><span>{{ auftrag.auftragsnummer }}</span></div>
|
||||
{% if auftrag.artikel %}<div class="status-line"><span class="label">Artikel</span><span>{{ auftrag.artikel }}</span></div>{% endif %}
|
||||
<div class="status-line"><span class="label">Status</span><span>{{ status_label }}</span></div>
|
||||
<div class="status-line"><span class="label">Soll-Menge</span><span>{{ soll_fmt }}</span></div>
|
||||
<div class="status-line"><span class="label">Stück/Stunde (Soll)</span><span>{{ rate_fmt }}</span></div>
|
||||
<div class="status-line"><span class="label">Bisher gemeldet</span><span>{{ bisherige_fmt }} ({{ fortschritt }}%)</span></div>
|
||||
</div>
|
||||
<div class="btn-grid">
|
||||
<a class="big-btn green" href="{{ url_for('machine_erfassen', maschine_id=maschine.id) }}">📝 Prod. erfassen</a>
|
||||
<a class="big-btn amber" href="{{ url_for('machine_pause', maschine_id=maschine.id) }}">⏸ Auftrag pausieren</a>
|
||||
{% if unter_soll %}
|
||||
<a class="big-btn red" href="{{ url_for('machine_beenden_confirm', maschine_id=maschine.id) }}">⏹ Auftrag beenden</a>
|
||||
{% else %}
|
||||
<form method="post" action="{{ url_for('machine_beenden', maschine_id=maschine.id) }}" class="order-form">
|
||||
<button type="submit" class="big-btn red">⏹ Auftrag beenden</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('machine_main', maschine_id=maschine.id) }}">← Zurück</a>
|
||||
</div>
|
||||
<div class="info-box">Bisher gemeldet: {{ bisherige_fmt }} / Soll: {{ soll_fmt }}</div>
|
||||
<form method="post" action="{{ form_action }}">
|
||||
<div class="card">
|
||||
<div class="form-group">
|
||||
<label for="einheiten">Bisher hergestellte Einheiten</label>
|
||||
<input type="number" min="0" step="any" inputmode="decimal" id="einheiten" name="einheiten"
|
||||
value="{{ eingabe_einheiten }}" autofocus required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="abweichung_id">Abweichungsgrund</label>
|
||||
<select id="abweichung_id" name="abweichung_id" required>
|
||||
<option value="">-- bitte wählen --</option>
|
||||
{% for ab in abweichungen %}
|
||||
<option value="{{ ab.id }}" {% if eingabe_abweichung_id|string == ab.id|string %}selected{% endif %}>{{ ab.beschreibung }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-row">
|
||||
<button type="submit" class="big-btn primary">✓ Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,43 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="btn-grid" style="margin-bottom:10px;">
|
||||
<a class="big-btn small primary" href="{{ url_for('maschinenverwaltung_neu') }}">➕ Neue Maschine anlegen</a>
|
||||
</div>
|
||||
|
||||
{% if not maschinen %}
|
||||
<div class="empty-state">Keine Maschinen vorhanden.</div>
|
||||
{% else %}
|
||||
<div class="list-meta">{{ maschinen|length }} Maschinen</div>
|
||||
<div class="table-wrap">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr><th>ID</th><th>Name</th><th>Standort</th><th class="col-actions"></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for m in maschinen %}
|
||||
<tr>
|
||||
<td>{{ m.id }}</td>
|
||||
<td>{{ m.name or '' }}</td>
|
||||
<td>{{ m.standort or '' }}</td>
|
||||
<td class="col-actions">
|
||||
<div class="row-actions">
|
||||
<a class="icon-btn" href="{{ url_for('maschinenverwaltung_bearbeiten', maschine_id=m.id) }}">Bearbeiten</a>
|
||||
<form method="post" action="{{ url_for('maschinenverwaltung_loeschen', maschine_id=m.id) }}" class="order-form">
|
||||
<button type="submit" class="icon-btn danger">Löschen</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,21 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('maschinenverwaltung') }}">← Zurück</a>
|
||||
</div>
|
||||
<form method="post" action="{{ url_for('maschinenverwaltung_neu') if neu else url_for('maschinenverwaltung_bearbeiten', maschine_id=maschine.id) }}" class="compact-form">
|
||||
<div class="card compact">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" id="name" name="name" value="{{ maschine.name or '' }}" autofocus required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="standort">Standort</label>
|
||||
<input type="text" id="standort" name="standort" value="{{ maschine.standort or '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-row compact">
|
||||
<button type="submit" class="big-btn small primary">✓ Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,18 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
</div>
|
||||
<form method="post" action="{{ url_for('maschinenverwaltung_login') }}" class="compact-form">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<div class="card compact">
|
||||
<div class="form-group">
|
||||
<label for="passwort">Passwort</label>
|
||||
<input type="password" id="passwort" name="passwort" autofocus required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-row compact">
|
||||
<button type="submit" class="big-btn small primary">🔒 Anmelden</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user