Dashboard: modular read-only overview page, stored in the config; UI cleanup
Modules are added and moved by drag and drop. Cleanup: no sideways jump between pages, mixer strips stay together with few channels, equal card heights, compact limiter cards without an amplifier, wider test meters, scrollable bottom bar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5597fae3f3
commit
2ea9fa32bc
8 files changed
+502
-19
No files matched your search
+18
-9
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user