diff --git a/CLAUDE.md b/CLAUDE.md
index f740c07..8b37508 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -50,6 +50,9 @@ pi_writer.py → pi_image.py (cloud-init SD card, installs server.py as a system
* **FIR tab** (`viewFir`, only `d.fir`) – outputs: `0x4B` type/window/cut-offs/taps index, the DSP calculates the filter;
the curve is the app's own windowed sinc. Files: `Device.upload_fir` (`0x5B` name, `0x4E` packets of 12 floats). The DSP
can't send coefficients back, so the curve of a file only exists in the session (`S.firCoef`).
+* **Dashboard** (`static/dashboard.js`, stored as `dashboard` in `config.json`, API `/api/dashboard`, `clean_dashboard`) –
+ grid of 12 columns, modules in `DASH_MODULES` with `body(m, d)`. Must stay read-only: no `setParam` or POST to a device
+ there, browsing (channel, band) is session state (`dashBrowse`). A new module type also goes into `DASH_TYPES` in `server.py`.
* **Network search** – `App.scan_network` probes the local /24 networks on TCP 9761 (handshake + device info),
skipping DSPs this app is connected to.
* **Copy settings / mute all** – `App.copy_settings` (`POST /api/copy`, groups level/filters/eq/dynamics/routing) and
diff --git a/README.md b/README.md
index 469dfeb..b8edbe1 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,9 @@ Control both devices at the same time from your phone, tablet or computer – ov
* **Several devices at once** – pick the DSP from the drop-down at the top (small dots show the status of the others);
the model is detected automatically
+* **Dashboard** – your own overview page: drag modules onto it (DSP overview, levels, faders, frequency response with
+ clickable EQ bands, channel, limiter, routing, delay, FIR, notes), choose their width and DSP. It only looks and never
+ changes a DSP; the layout is stored in the config
* **Mixer** – faders, mute and live meters for all inputs and outputs, limiter LED on every output (status read
from the DSP)
* **Channel** – name, gain, delay, polarity, high/low pass, 8/9-band PEQ with a draggable curve; the curve shows
@@ -198,7 +201,7 @@ python tests/test_protocol.py
| `sim.py` | Simulated DSP 204/408 |
| `desktop.py` | Desktop app (Windows/macOS): server + own window (pywebview) |
| `pi_writer.py`, `pi_image.py`, `win_disk.py` | Raspberry Pi SD card writer: GUI, OS image + cloud-init, raw disk writes |
-| `static/` | Web UI (`app.js`, `style.css`, `index.html`), SoundField in `static/soundfield.js`, translations in `static/i18n.js` |
+| `static/` | Web UI (`app.js`, `style.css`, `index.html`), dashboard in `static/dashboard.js`, SoundField in `static/soundfield.js`, translations in `static/i18n.js` |
| `packaging/` | Build script and icons |
| `tests/` | Protocol tests |
| `PROTOCOL.md` | Protocol documentation |
diff --git a/server.py b/server.py
index b982719..c965a23 100644
--- a/server.py
+++ b/server.py
@@ -144,6 +144,27 @@ def clean_soundfield(data) -> dict:
}
+DASH_TYPES = ("status", "meters", "mixer", "curve", "channel", "limiter", "routing", "delays", "fir", "notes")
+
+
+def clean_dashboard(data) -> dict | None:
+ """Modules of the dashboard page; None = never edited (the app shows a default page)."""
+ if not isinstance(data, dict) or not isinstance(data.get("modules"), list):
+ return None
+ modules = []
+ for m in data["modules"][:40]:
+ if not isinstance(m, dict) or m.get("type") not in DASH_TYPES:
+ continue
+ src = m.get("cfg") if isinstance(m.get("cfg"), dict) else {}
+ cfg = {"device": str(src.get("device") or "")[:64], "title": str(src.get("title") or "")[:40],
+ "kind": "out" if src.get("kind") == "out" else "in", "idx": int(_num(src.get("idx"), 0, 15, 0)),
+ "text": str(src.get("text") or "")[:2000]}
+ w = int(_num(m.get("w"), 3, 12, 4))
+ modules.append({"id": re.sub(r"[^\w-]", "", str(m.get("id") or ""))[:32] or uuid.uuid4().hex[:8], "type": m["type"],
+ "w": w if w in (3, 4, 6, 8, 12) else 4, "cfg": cfg})
+ return {"modules": modules}
+
+
def clean_colors(v) -> dict:
"""Channel colours: {"in0": "#rrggbb", "out3": ...}. Linked channels carry their group's colour; that a colour
belongs to one channel/group only is ensured by the colour picker (it knows the link groups)."""
@@ -202,6 +223,7 @@ class App:
self.failures: dict[str, tuple[int, float]] = {} # ip -> (failed attempts, locked until)
self.limiter: dict = clean_limiter({})
self.soundfield: dict = clean_soundfield({})
+ self.dashboard: dict | None = None
self.logo = ""
# desktop app: its own window logs in with a one-time token, other devices need the PIN
self.app_token: str | None = None
@@ -249,6 +271,8 @@ class App:
self.limiter = clean_limiter(cfg.get("limiter") or {})
if "soundfield" in cfg:
self.soundfield = clean_soundfield(cfg.get("soundfield"))
+ if "dashboard" in cfg:
+ self.dashboard = clean_dashboard(cfg.get("dashboard"))
if "logo" in cfg:
self.logo = clean_logo(cfg.get("logo"))
r = cfg.get("remote") or {}
@@ -264,7 +288,8 @@ class App:
"""App backup: devices, PIN (hashed), amplifiers/limiter data, remote access - no logins."""
return {"format": CONFIG_FORMAT, "version": 1, "exported": time.strftime("%Y-%m-%dT%H:%M:%S"),
"devices": [d.config() for d in self.real_devices()], "auth": self.auth,
- "limiter": self.limiter, "remote": self.remote, "soundfield": self.soundfield, "logo": self.logo}
+ "limiter": self.limiter, "remote": self.remote, "soundfield": self.soundfield, "logo": self.logo,
+ "dashboard": self.dashboard}
async def restore_config(self, doc: dict, session: str):
if not isinstance(doc, dict) or doc.get("format") != CONFIG_FORMAT:
@@ -322,7 +347,7 @@ class App:
sessions = {k: v for k, v in self.sessions.items() if k not in self.app_sessions}
cfg = {"devices": [d.config() for d in self.real_devices()], "auth": self.auth,
"sessions": sessions, "limiter": self.limiter, "remote": self.remote, "locked": self.locked,
- "soundfield": self.soundfield, "logo": self.logo,
+ "soundfield": self.soundfield, "logo": self.logo, "dashboard": self.dashboard,
"mute_all": {"active": self.mute_all["active"],
"restore": {k: v for k, v in self.mute_all["restore"].items() if k != "demo"}}}
if self.lang:
@@ -801,6 +826,13 @@ class App:
return {"logo": self.logo}
if path == "/api/logo":
return {"logo": self.logo}
+ if path == "/api/dashboard" and method == "PUT":
+ self.dashboard = clean_dashboard(body)
+ self.save()
+ self.broadcast({"type": "dashboard", "data": self.dashboard})
+ return self.dashboard
+ if path == "/api/dashboard":
+ return self.dashboard
if path == "/api/soundfield" and method == "PUT":
self.soundfield = clean_soundfield(body)
self.save()
@@ -1108,7 +1140,8 @@ class App:
self.clients.add(q)
try:
hello = {"type": "hello", "devices": [d.snapshot() for d in self.devices.values()], "limiter": self.limiter,
- "demo": self.demo_info(), "muteall": self.mute_all_info(), "soundfield": self.soundfield, "logo": self.logo}
+ "demo": self.demo_info(), "muteall": self.mute_all_info(), "soundfield": self.soundfield, "logo": self.logo,
+ "dashboard": self.dashboard}
writer.write(f"data: {json.dumps(hello)}\n\n".encode())
await writer.drain()
while True:
diff --git a/static/app.js b/static/app.js
index cac8096..ce26064 100644
--- a/static/app.js
+++ b/static/app.js
@@ -56,7 +56,7 @@ const store = {
};
const S = {
devices: {}, order: [], cur: store.get("dsp.cur"),
- view: store.get("dsp.view") || "mixer", settings: false,
+ view: store.get("dsp.view") || "dash", settings: false, dash: null,
sel: { kind: "in", idx: 0 }, band: 0, busy: false, dirty: false,
routeOpen: null, es: null, linkSel: { in: [], out: [] }, linkEdit: { in: null, out: null }, firSel: { kind: "out", idx: 0 }, firDraft: null, firCoef: {},
lim: { amps: [], assign: {}, ref: {} },
@@ -630,6 +630,8 @@ function renderTabs() {
b.disabled = testLock && b.dataset.view !== "test";
});
fitNav(); // the DSP button's width changes with the name
+ if (renderTabs.view !== S.view && window.innerWidth < 760) $("#viewtabs .active")?.scrollIntoView({ inline: "center", block: "nearest" }); // scrollable bottom bar
+ renderTabs.view = S.view;
}
// close the DSP menu on a click elsewhere or Escape
document.addEventListener("pointerdown", e => { if (S.devMenu && !e.target.closest("#devtabs")) { S.devMenu = false; renderTabs(); } });
@@ -848,7 +850,7 @@ function reportImport(res, okMsg) {
function renderStatus() {
const bar = $("#statusbar");
const d = dev();
- if (S.settings || !d) { bar.replaceChildren(); return; }
+ if (S.settings || !d || S.view === "dash") { bar.replaceChildren(); return; }
if (d.status !== "online" || !d.state) {
bar.replaceChildren(
h("div", { class: "preset" }, h("small", {}, `${STATUS_TEXT[d.status] || d.status} · ${d.transport === "usb" ? "USB" : d.host + ":" + d.port}`), h("b", {}, d.name),
@@ -1696,7 +1698,7 @@ function maxLevelCard(d) {
function viewLink(d) {
return [h("h2", { class: "section" }, t("Links")),
h("div", { class: "cards" }, linkCard(d, "in"), linkCard(d, "out")),
- h("p", { class: "info hint" }, t("Linked channels share all settings (gain, delay, filters, EQ, dynamics, mute) – ") +
+ h("p", { class: "info" }, t("Linked channels share all settings (gain, delay, filters, EQ, dynamics, mute) – ") +
t("a change on one channel applies to the whole group. Name, routing and mix levels stay per channel. ") +
t("The link is stored in the DSP and also applies in the Thomann editor.")),
h("h2", { class: "section" }, t("Colours")),
@@ -1900,8 +1902,8 @@ function limiterCard(d, o) {
res,
h("div", { class: "limgrid" },
h("label", { class: "full" }, t("Amplifier"), ampSel),
- h("label", {}, t("Load on channel"), ohmSel),
- h("label", {}, t("Speaker RMS (W)"), spkIn)),
+ as ? h("label", {}, t("Load on channel"), ohmSel) : null,
+ as ? h("label", {}, t("Speaker RMS (W)"), spkIn) : null),
paramSlider("Threshold", "out", o, "limit.threshold", "thresh", update),
as ? h("div", { class: "target" },
h("div", { class: "row" }, h("span", { class: "sub" }, t("Limit to")), target,
@@ -1949,9 +1951,10 @@ function timingBox(d, o) {
h("b", {}, p.name), h("small", {}, p.range));
const box = h("details", { class: "more", open: limOpen.has(key),
ontoggle: () => box.open ? limOpen.add(key) : limOpen.delete(key) },
- h("summary", {}, `Attack ${lim.attack + 1} ms · Release ${lim.release + 1} ms · Knee ${lim.knee} dB`,
+ h("summary", {}, `${"ratio" in lim ? `Ratio ${RATIOS[lim.ratio]} · ` : ""}Attack ${lim.attack + 1} ms · Release ${lim.release + 1} ms · Knee ${lim.knee} dB`,
active ? h("span", { class: "tag" }, active.name) : null),
h("div", { class: "chips presets" }, chip(auto), LIM_PRESETS.map(chip)),
+ "ratio" in lim ? paramSlider("Ratio", "out", o, "limit.ratio", "ratio") : null,
paramSlider("Attack", "out", o, "limit.attack", "attack"),
paramSlider("Release", "out", o, "limit.release", "release"),
paramSlider("Knee", "out", o, "limit.knee", "knee"),
@@ -2425,8 +2428,10 @@ function render() {
let content;
const d = dev();
const field = !S.settings && S.view === "soundfield"; // the room plan works without a connected DSP
- document.body.dataset.view = field ? "soundfield" : S.settings || !d ? "settings" : S.view;
+ 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;
if (field) content = viewSoundField();
+ else if (dash) content = viewDash();
else if (S.settings || !d) content = viewSettings();
else if (d.status !== "online" || !d.state)
content = h("div", { class: "empty" }, h("div", { class: "spinner" + (["loading", "connecting"].includes(d.status) ? "" : " off") }),
@@ -2461,7 +2466,7 @@ function fitNav() {
const kids = [...top.children].filter(el => !el.hidden && getComputedStyle(el).display !== "none");
const cs = getComputedStyle(top), gap = parseFloat(cs.columnGap) || 0;
// natural widths: the DSP button may be squeezed by flexbox, so take its content width
- const need = kids.reduce((w, el) => w + (el.id === "devtabs" ? el.scrollWidth : el.getBoundingClientRect().width), 0)
+ const need = kids.reduce((w, el) => w + (el.id === "devtabs" ? Math.max(el.scrollWidth, 210) : el.getBoundingClientRect().width), 0)
+ gap * (kids.length - 1) + parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);
if (need > top.clientWidth + 1) b.classList.add("navside");
}
@@ -2541,6 +2546,7 @@ function connectEvents() {
if (ev.demo) S.demo = ev.demo;
if (ev.muteall) { S.muteAll = ev.muteall.active; showMuteAll(); }
if (ev.soundfield) S.sf = ev.soundfield;
+ if ("dashboard" in ev) S.dash = ev.dashboard && ev.dashboard.modules;
if ("logo" in ev) { S.logo = ev.logo; showLogo(); }
if (S.demo.enabled && S.devices.demo && !S.devices[S.cur]?.demo) S.cur = "demo";
S.order.forEach(id => maybeAskUnlock(S.devices[id]));
@@ -2573,6 +2579,8 @@ function connectEvents() {
}
case "soundfield":
sfOnRemote(ev.data); break;
+ case "dashboard":
+ dashRemote(ev.data); break;
case "logo":
S.logo = ev.data; showLogo(); if (S.settings) render(); break;
case "muteall":
@@ -2589,6 +2597,7 @@ function connectEvents() {
if (JSON.stringify(getPath(ch, ev.param)) === JSON.stringify(ev.value)) break;
setPath(ch, ev.param, ev.value);
showLive(`${ev.device}|${ev.kind}|${ev.idx}|${ev.param}`, ev.value); // even while a fader is held
+ if (S.view === "dash") dashSoon();
// the test fader moves every output: the audio test view only shows meters, no need to redraw
if (ev.device === S.cur && !S.settings && !(S.view === "test" && ev.param === "gain")) render();
break;
@@ -2600,7 +2609,7 @@ function connectEvents() {
updateMeters(ev); break;
case "limiter":
S.lim = ev.data;
- if (!S.busy && (S.view === "limiter" || S.view === "channel")) render();
+ if (!S.busy && (S.view === "limiter" || S.view === "channel" || S.view === "dash")) render();
break;
}
};
diff --git a/static/dashboard.js b/static/dashboard.js
new file mode 100644
index 0000000..f0297bf
--- /dev/null
+++ b/static/dashboard.js
@@ -0,0 +1,323 @@
+"use strict";
+
+// Dashboard: an overview page built from modules, stored by the server as `dashboard` in config.json.
+// Every module only looks: nothing here changes a DSP. Browsing (channel, EQ band) stays in this session.
+
+const DASH_WIDTHS = [3, 4, 6, 8, 12];
+const DASH_DEFAULT = () => [
+ { type: "status", w: 4 }, { type: "meters", w: 8 },
+ { type: "curve", w: 8 }, { type: "mixer", w: 4 },
+].map((m, i) => ({ id: `m${i}`, cfg: {}, ...m }));
+
+let dashEdit = false, dashTimer = 0, dashSaveTimer = 0;
+const dashBrowse = new Map(); // module id -> { kind, idx, band }
+
+const dashMods = () => S.dash || (S.dash = DASH_DEFAULT());
+const dashDevs = () => S.order.map(id => S.devices[id]).filter(d => d && (!d.demo || S.demo.enabled));
+// the chosen DSP, or the first one if it is gone (e.g. while demo mode is on)
+const dashDev = m => S.devices[m.cfg.device] && dashDevs().includes(S.devices[m.cfg.device]) ? S.devices[m.cfg.device] : dashDevs()[0];
+const offline = d => h("p", { class: "info dempty" }, d ? t("{name} is not connected.", { name: d.name }) : t("No DSP added yet."));
+
+function dashSave() {
+ clearTimeout(dashSaveTimer);
+ dashSaveTimer = setTimeout(() => api("PUT", "/api/dashboard", { modules: dashMods() }).catch(e => toast(t("Error: ") + trMsg(e.message))), 300);
+}
+// parameter changes redraw the page, but not for every single step of a fader
+function dashSoon() {
+ clearTimeout(dashTimer);
+ dashTimer = setTimeout(() => { if (S.view === "dash" && !S.settings) render(); }, 250);
+}
+function dashRemote(data) {
+ S.dash = data && data.modules ? data.modules : null;
+ if (S.view === "dash" && !S.settings && !S.busy) render();
+}
+
+// ------------------------------------------------------------------ modules
+
+const dashKv = (k, v, cls = "") => h("div", { class: "dkv " + cls }, h("span", {}, k), h("b", {}, v));
+const dashChannels = d => [...chans(d, "in").map((_, i) => ["in", i]), ...chans(d, "out").map((_, i) => ["out", i])];
+
+// a channel of a module, browsed with the arrows
+function dashSel(m, d) {
+ const all = dashChannels(d);
+ let s = dashBrowse.get(m.id);
+ if (!s) { s = { kind: m.cfg.kind || "in", idx: m.cfg.idx || 0, band: 0 }; dashBrowse.set(m.id, s); }
+ if (!all.some(([k, i]) => k === s.kind && i === s.idx)) { s.kind = all[0][0]; s.idx = all[0][1]; }
+ return s;
+}
+function dashChannelNav(m, d, s) {
+ const all = dashChannels(d), at = all.findIndex(([k, i]) => k === s.kind && i === s.idx);
+ const go = dir => { const [k, i] = all[(at + dir + all.length) % all.length]; s.kind = k; s.idx = i; s.band = 0; render(); };
+ const ch = chans(d, s.kind)[s.idx];
+ return h("div", { class: "dnav" },
+ h("button", { class: "small", "data-view-ok": "", "aria-label": t("Previous channel"), onclick: () => go(-1) }, "‹"),
+ h("span", { class: "dnavname" }, h("b", {}, chLabel(s.kind, s.idx)), " ", ch.name),
+ h("button", { class: "small", "data-view-ok": "", "aria-label": t("Next channel"), onclick: () => go(1) }, "›"));
+}
+
+const DASH_MODULES = {
+ status: {
+ title: () => t("DSP overview"), w: 4, global: true,
+ icon: '