🚧 Web UI

This commit is contained in:
Jonas Bengtsson
2026-10-03 23:48:16 +02:00
parent 43c4c287a0
commit 87c1c8db7b
22 changed files with 2558 additions and 15 deletions
+188
View File
@@ -0,0 +1,188 @@
/* WAGO simulator web UI — DIN-rail node graphics (no build step). */
* { box-sizing: border-box; }
body {
margin: 0;
font-family: "Segoe UI", Arial, sans-serif;
background: #e9ecef;
color: #1c2733;
}
/* ---------- login ---------- */
.login-body {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: linear-gradient(160deg, #003a7a, #0062c4);
}
.login-card {
background: #fff;
border-radius: 8px;
padding: 34px 40px;
width: 320px;
text-align: center;
box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}
.login-card h1 { font-size: 1.25rem; margin: 10px 0 0; }
.login-sub { color: #6b7684; margin-top: 2px; font-size: 0.85rem; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; text-align: left; }
.login-card label { font-size: 0.85rem; color: #3c4653; }
.login-card input {
width: 100%; padding: 9px 10px; border: 1px solid #c5ccd4;
border-radius: 4px; font-size: 1rem; margin-top: 4px;
}
.login-card button {
padding: 10px; border: 0; border-radius: 4px; background: #0062c4;
color: #fff; font-size: 1rem; cursor: pointer;
}
.login-card button:hover { background: #004a99; }
.error { color: #b3261e; font-size: 0.85rem; }
.hidden { display: none; }
/* ---------- top bar ---------- */
.topbar {
display: flex; align-items: center; gap: 22px;
background: #003a7a; color: #fff;
padding: 8px 18px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tabs { display: flex; gap: 4px; }
.tab {
border: 0; background: transparent; color: #cfe0f5;
padding: 7px 14px; border-radius: 4px; cursor: pointer; font-size: 0.95rem;
}
.tab.active { background: #0062c4; color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.logout { color: #cfe0f5; text-decoration: none; font-size: 0.9rem; }
.conn-dot {
width: 10px; height: 10px; border-radius: 50%;
background: #d9534f; display: inline-block;
}
.conn-dot.on { background: #4caf50; box-shadow: 0 0 6px #4caf50; }
main { padding: 18px; max-width: 1280px; margin: 0 auto; }
h2 { margin: 4px 0 14px; }
.tab-page { display: none; }
.tab-page.active { display: block; }
/* ---------- DIN rail ---------- */
.rail {
display: flex; align-items: stretch; gap: 6px;
background: linear-gradient(#d7dde3, #b7c0c9);
border-radius: 4px;
padding: 26px 12px 12px;
min-height: 130px;
overflow-x: auto;
box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.18);
}
.coupler, .module {
background: linear-gradient(#fdfdfd, #dfe3e8);
border: 1px solid #9aa4ae;
border-radius: 3px;
min-height: 92px;
position: relative;
padding-top: 16px;
}
.mod-head {
position: absolute; top: 2px; left: 5px;
font-size: 0.62rem; color: #33414f; font-weight: 600;
letter-spacing: 0.02em; white-space: nowrap;
}
.coupler { min-width: 96px; background: linear-gradient(#0d5db4, #003a7a); }
.coupler .mod-head { color: #fff; font-size: 0.75rem; }
.coupler-leds { display: flex; gap: 7px; padding: 42px 10px 0; }
.cled {
width: 8px; height: 8px; border-radius: 50%;
background: #123; box-shadow: none;
}
.cled.on {
background: #4caf50;
box-shadow: 0 0 7px 2px rgba(76, 175, 80, 0.85);
}
.module { display: flex; flex-direction: column; justify-content: flex-end; }
.mod-channels {
display: flex; gap: 5px; flex-wrap: wrap; align-items: flex-end;
padding: 8px 6px 8px;
}
/* channel LEDs */
.led {
width: 12px; height: 12px; border-radius: 50%;
background: #2c3742;
border: 1px solid #1b232c;
cursor: pointer;
transition: box-shadow 0.12s, background 0.12s;
}
.led.on {
background: #37e04d;
border-color: #2ab63a;
box-shadow: 0 0 9px 2px rgba(70, 230, 80, 0.8);
}
/* analog bars */
.abar {
position: relative;
width: 16px; height: 48px;
background: #232c36;
border-radius: 3px;
overflow: hidden;
cursor: pointer;
display: inline-block;
}
.abar-fill {
position: absolute; bottom: 0; left: 0; right: 0; height: 0;
background: linear-gradient(#4db6ff, #0d6eb4);
}
.abar-num {
position: absolute; top: 50px; left: 50%;
transform: translateX(-50%);
font-size: 0.55rem; color: #33414f;
}
.rail-detail { margin-top: 10px; font-size: 0.8rem; color: #55606c; }
/* ---------- diagnostics ---------- */
.diag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.diag-card {
background: #fff; border-radius: 6px; padding: 14px 18px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.diag-card h3 { margin: 0 0 10px; font-size: 1rem; }
.diag-card table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.diag-card td { padding: 4px 6px; border-bottom: 1px solid #eef1f4; }
.diag-card td:last-child { text-align: right; font-family: Consolas, monospace; }
.diag-card button {
margin-top: 12px; padding: 7px 14px; border: 0; border-radius: 4px;
background: #0062c4; color: #fff; cursor: pointer;
}
.diag-card button:hover { background: #004a99; }
.fault-buttons { display: flex; gap: 8px; }
/* ---------- configuration ---------- */
.config-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.4fr); gap: 16px; align-items: start; }
.cfg-note { color: #6b7684; font-size: 0.8rem; margin: 0 0 12px; }
#coupler-form { display: flex; flex-direction: column; gap: 10px; }
.cfg-field { font-size: 0.85rem; color: #3c4653; display: flex; flex-direction: column; gap: 3px; }
.cfg-field input, .cfg-field select {
padding: 7px 8px; border: 1px solid #c5ccd4; border-radius: 4px;
font-size: 0.9rem; width: 100%;
}
.cfg-check { font-size: 0.85rem; display: flex; gap: 8px; align-items: center; }
.ok { color: #2e7d32; font-size: 0.85rem; }
#module-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; margin-bottom: 10px; }
.module-row {
display: flex; align-items: center; gap: 8px;
padding: 5px 8px; border: 1px solid #d8dee5; border-radius: 4px;
font-size: 0.85rem; cursor: pointer; background: #f7f9fb;
}
.module-row:hover { background: #eaf1f8; }
.mod-io { color: #55606c; margin-left: auto; font-size: 0.78rem; white-space: nowrap; }
#catalog-pick { padding: 6px; border: 1px solid #c5ccd4; border-radius: 4px; flex: 1; }
.cfg-path { font-size: 0.75rem; color: #6b7684; align-self: center; }
button.primary { background: #2e7d32; }
button.primary:hover { background: #1b5e20; }