DJ Brake: note that the limiter is not the goal, with its own settings

Shown by default and always in English by default; both can be switched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-02 18:45:38 +01:00
1 parent 8919f0016c
commit d6be627f32
6 files changed
+43 -9

No files matched your search

+17 -2
View File
@@ -2385,9 +2385,24 @@ function djBrakeCard() {
} }, t("Copy"))) : null,
S.djbrake && !url ? h("p", { class: "info djwarn" }, t("Switch on remote access below so other devices can reach it.")) : null,
S.djbrake ? djLimiters() : null,
S.djbrake ? djHintOptions() : null,
S.djbrake ? h("p", { class: "info" }, t("Anyone in your network can open it without a PIN. It shows only the light and the distance to the limiter and changes nothing.")) : null);
}
function djHintOptions() {
const save = async (key, on) => {
try {
const r = await api("PUT", "/api/djbrake", { [key]: on });
S.djHint = r.hint; S.djHintEn = r.hint_en; render();
} catch (e) { toast(t("Error: ") + trMsg(e.message)); render(); }
};
return h("div", { class: "djlim" },
h("label", { class: "chk" }, h("input", { type: "checkbox", checked: S.djHint, onchange: e => save("hint", e.target.checked) }),
t("Show a short note that the limiter is not the goal")),
S.djHint ? h("label", { class: "chk" }, h("input", { type: "checkbox", checked: S.djHintEn, onchange: e => save("hint_en", e.target.checked) }),
t("Note always in English")) : null);
}
function djLimiters() {
const devs = S.order.map(id => S.devices[id]).filter(d => d.state && !d.demo);
const toggle = async (id, i) => {
@@ -2655,7 +2670,7 @@ function connectEvents() {
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;
S.djbrake = !!ev.djbrake; S.djIgnore = ev.dj_ignore || {};
S.djbrake = !!ev.djbrake; S.djIgnore = ev.dj_ignore || {}; S.djHint = ev.dj_hint !== false; S.djHintEn = ev.dj_hint_en !== false;
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]));
@@ -2691,7 +2706,7 @@ function connectEvents() {
case "dashboard":
dashRemote(ev.data); break;
case "djbrake":
S.djbrake = ev.enabled; S.djIgnore = ev.ignore; if (S.settings && !S.busy) render(); break;
S.djbrake = ev.enabled; S.djIgnore = ev.ignore; S.djHint = ev.hint; S.djHintEn = ev.hint_en; if (S.settings && !S.busy) render(); break;
case "logo":
S.logo = ev.data; showLogo(); if (S.settings) render(); break;
case "muteall":