diff --git a/server.py b/server.py index 572852c..97767c0 100644 --- a/server.py +++ b/server.py @@ -247,10 +247,7 @@ class App: if self.config_path.exists(): cfg = json.loads(self.config_path.read_text(encoding="utf-8")) else: - cfg = {"devices": [ - {"id": "dsp204", "name": "DSP 204", "host": "192.168.1.101", "model": "204", "autoconnect": False}, - {"id": "dsp408", "name": "DSP 408", "host": "192.168.1.102", "model": "408", "autoconnect": False}, - ]} + cfg = {"devices": []} now = time.time() self.sessions = {k: v for k, v in cfg.get("sessions", {}).items() if v > now} self.locked = bool(cfg.get("locked")) diff --git a/static/app.js b/static/app.js index bb74b9d..d7cd792 100644 --- a/static/app.js +++ b/static/app.js @@ -2409,6 +2409,17 @@ function viewSettings() { // ------------------------------------------------------------------ render const H_SCROLL = ".mixer, .bands, .geq, .routing"; +// first start: nothing added yet +function noDspView() { + return h("div", { class: "empty nodsp" }, svgIcon(''), + h("b", {}, t("No DSP added yet")), + h("p", {}, t("Add your DSP over the network or USB. To look around first, switch on demo mode in the settings.")), + h("button", { class: "on", "data-view-ok": "", onclick: () => { + S.settings = true; S.addDev = true; render(); + document.getElementById("set-devices")?.scrollIntoView({ block: "start" }); + } }, t("Add a DSP"))); +} + function render() { if (S.busy) { S.dirty = true; return; } if ($("#app").hidden) return; @@ -2429,10 +2440,11 @@ function render() { const d = dev(); const field = !S.settings && S.view === "soundfield"; // the room plan works without a connected DSP const dash = !S.settings && S.view === "dash"; // shows all DSPs, works without any - document.body.dataset.view = field ? "soundfield" : dash ? "dash" : S.settings || !d ? "settings" : S.view; + document.body.dataset.view = field ? "soundfield" : dash ? "dash" : S.settings ? "settings" : S.view; if (field) content = viewSoundField(); else if (dash) content = viewDash(); - else if (S.settings || !d) content = viewSettings(); + else if (S.settings) content = viewSettings(); + else if (!d) content = noDspView(); else if (d.status !== "online" || !d.state) content = h("div", { class: "empty" }, h("div", { class: "spinner" + (["loading", "connecting"].includes(d.status) ? "" : " off") }), d.status === "loading" ? t("Loading the configuration from the DSP…") diff --git a/static/dashboard.js b/static/dashboard.js index 46c82fe..8329f5a 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -388,6 +388,7 @@ function dashModule(m) { function viewDash() { if (viewOnly()) dashEdit = false; + if (!dashDevs().length) return noDspView(); const mods = dashMods(); return [ h("div", { class: "dhead" }, h("h2", {}, "Dashboard"), diff --git a/static/i18n.js b/static/i18n.js index 9f90588..425f47d 100644 --- a/static/i18n.js +++ b/static/i18n.js @@ -581,6 +581,8 @@ const DE = { "Read-only": "Nur ansehen", "Edit mode – changes go to the DSP": "Bearbeiten – Änderungen gehen an den DSP", "Read-only – switch to edit at the top": "Nur ansehen – oben auf Bearbeiten umschalten", + "No DSP added yet": "Noch kein DSP angelegt", + "Add your DSP over the network or USB. To look around first, switch on demo mode in the settings.": "Lege deinen DSP über Netzwerk oder USB an. Zum Ausprobieren gibt es in den Einstellungen den Demo-Modus.", }; const DE_PATTERNS = [ diff --git a/static/style.css b/static/style.css index 901d1c7..07b07a6 100644 --- a/static/style.css +++ b/static/style.css @@ -884,3 +884,7 @@ canvas.dcurve { display: block; width: 100%; flex: 1 1 0; min-height: 70px; back .guard.on .guardtrack { background: var(--accent); } .guard.on .guardtrack i { left: 14px; } body.locked #main input[type=range] { pointer-events: none; } +.nodsp { gap: 10px; } +.nodsp svg { width: 44px; height: 44px; fill: none; stroke: var(--dim); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; } +.nodsp b { color: var(--text); font-size: 18px; } +.nodsp p { max-width: 420px; margin: 0 0 6px; line-height: 1.45; }