DJ Brake settings move next to remote access
In the apps the page is only reachable through remote access, so it can only be switched on while that runs. All its addresses are listed there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
910cf3fc17
commit
28624caead
4 files changed
+16
-13
No files matched your search
+12
-12
@@ -2370,24 +2370,24 @@ function logoCard() {
|
||||
function djBrakeCard() {
|
||||
// the app's own address only works on this computer: other devices come through remote access
|
||||
const r = S.remote || {};
|
||||
const base = S.isApp ? (r.enabled && r.urls && r.urls[0]) || "" : location.origin;
|
||||
const url = base ? `${base}/djbrake` : "";
|
||||
const box = h("input", { type: "checkbox", checked: !!S.djbrake, onchange: async () => {
|
||||
const reachable = !S.isApp || !!r.running;
|
||||
const urls = (S.isApp ? r.urls || [] : [location.origin]).map(u => `${u}/djbrake`);
|
||||
const box = h("input", { type: "checkbox", checked: !!S.djbrake, disabled: !reachable, onchange: async () => {
|
||||
try { S.djbrake = (await api("PUT", "/api/djbrake", { enabled: box.checked })).enabled; render(); }
|
||||
catch (e) { box.checked = !!S.djbrake; toast(t("Error: ") + trMsg(e.message)); }
|
||||
} });
|
||||
return h("div", { class: "card" }, h("h3", {}, "DJ Brake"),
|
||||
h("p", { class: "info" }, t("A page for a tablet at the DJ booth: a big red light comes on when a limiter is working, so turning up more won't help.")),
|
||||
h("label", { class: "chk" }, box, t("Share the page /djbrake")),
|
||||
S.djbrake && url ? h("div", { class: "row djurl" }, h("code", {}, url),
|
||||
!reachable ? h("p", { class: "info djwarn" }, t("Only reachable while remote access is on.")) : null,
|
||||
S.djbrake && reachable ? urls.map(url => h("div", { class: "row djurl" }, h("code", {}, url),
|
||||
h("button", { class: "small", "data-view-ok": "", onclick: async () => {
|
||||
try { await navigator.clipboard.writeText(url); toast(t("Address copied")); } catch { toast(url); }
|
||||
} }, 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 ? djMarginOption() : 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);
|
||||
} }, t("Copy")))) : null,
|
||||
S.djbrake && reachable ? djLimiters() : null,
|
||||
S.djbrake && reachable ? djMarginOption() : null,
|
||||
S.djbrake && reachable ? djHintOptions() : null,
|
||||
S.djbrake && reachable ? 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 djMarginOption() {
|
||||
@@ -2488,11 +2488,11 @@ function scanCard() {
|
||||
|
||||
function viewSettings() {
|
||||
const sections = [
|
||||
["general", t("General"), t("Language, demo mode and your logo."), "", [langCard(), demoCard(), logoCard(), djBrakeCard()]],
|
||||
["general", t("General"), t("Language, demo mode and your logo."), "", [langCard(), demoCard(), logoCard()]],
|
||||
["devices", t("Devices"), t("Several DSPs can be connected at the same time – pick one at the top. A DSP accepts only one connection: close the Thomann editor first."),
|
||||
"wide", [...S.order.filter(id => !S.devices[id].demo).map(id => deviceForm(S.devices[id])), scanCard(), addDeviceCard()]],
|
||||
["access", S.isApp ? t("Remote access") : t("Security"), S.isApp ? t("Let phones and tablets in your network control this computer – they log in with the PIN.") : t("Who may use this web interface."),
|
||||
"wide", [S.isApp ? remoteCard() : null, pinCard()]],
|
||||
"wide", [S.isApp ? remoteCard() : null, djBrakeCard(), pinCard()]],
|
||||
["backup", t("Backup"), t("Save and restore the settings of this app."), "wide", [backupCard()]],
|
||||
];
|
||||
const nav = h("nav", { class: "setnav", "aria-label": t("Settings") }, sections.map(([id, title]) =>
|
||||
|
||||
Reference in new issue
Block a user