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]) =>
|
||||
|
||||
+1
-1
@@ -677,7 +677,7 @@ const DE = {
|
||||
"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.": "Eine Seite für ein Tablet am DJ-Pult: Ein großes rotes Licht geht an, wenn ein Limiter arbeitet, mehr Gas also nichts mehr bringt.",
|
||||
"Share the page /djbrake": "Seite /djbrake freigeben",
|
||||
"Address copied": "Adresse kopiert",
|
||||
"Switch on remote access below so other devices can reach it.": "Schalte unten den Fernzugriff ein, damit andere Geräte sie erreichen.",
|
||||
"Only reachable while remote access is on.": "Nur erreichbar, solange der Fernzugriff an ist.",
|
||||
"Anyone in your network can open it without a PIN. It shows only the light and the distance to the limiter and changes nothing.": "Jeder in deinem Netzwerk kann sie ohne PIN öffnen. Sie zeigt nur das Licht und den Abstand zum Limiter und ändert nichts.",
|
||||
"Limiters that count": "Diese Limiter zählen",
|
||||
"Connect a DSP to choose.": "Verbinde einen DSP, um auszuwählen.",
|
||||
|
||||
@@ -994,3 +994,5 @@ body.dashonly .dlink { cursor: default; }
|
||||
.djlim label.chk { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
|
||||
.djlim label.chk input { flex: none; margin: 3px 0 0; }
|
||||
.djlim input[type=range] { width: 100%; margin: 8px 0 4px; }
|
||||
.row.djurl button.small { flex: 0 0 auto; width: auto; padding-inline: 14px; }
|
||||
.row.djurl code { flex: 1 1 auto; }
|
||||
Reference in new issue
Block a user