diff --git a/CHANGELOG.md b/CHANGELOG.md index 256b920..4576bb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Release history focused on **features, settings, default behavior, compatibility ## 0.38.4 — on/off switches in the panel - **Switches for on/off settings:** a setting that turns a feature or a whole section on or off is now a switch instead of a checkbox, with the same rule in every editor: **Enabled** of vhosts, backends, locations, streams, listeners, redirect and 404 hosts, cache rules and PHP profiles; per-host features (WebSockets, Force HTTPS, www redirect, HTTP/2, HTTP/3, keep-alive, client IP forwarding, Cloudflare client IP, diagnostic headers, passive health checks, Content-Type denylist, rate limit, HSTS, User-Agent blocking, cache, transformations, compression, PQC key exchange) in the vhost and Docker app editors alike; the "custom"/"inherit" overrides; and global features (ACL countries, cache and its subsystems, Varnish-compatible policy, Via header, transformations, logging outputs and captured fields, GeoIP, Prometheus, alerts, trusted X-Forwarded-Proto, admin TLS, Web Server directory listing, .htaccess, precompressed files, PHP and hardening, default certificate), plus live refresh, appearance and layout preferences. -- **Checkboxes stay where they fit:** choices from a set (TLS versions, compression algorithms, cache headers, cache stale-if-error and COLD triggers, passive health error types, metric groups, alert types, transformation types, precompressed formats), row and column selection, cache-rule modifiers and risk confirmations (terms of service, production issuance, private or local destinations, certificate mismatch). Every other standalone on/off setting, including options inside a section (for example HSTS includeSubDomains/preload, legacy WebSocket support, retry conditions, preserve Host, backend TLS verification, backup/drain, listener protocols, .htaccess and PHP options), is a switch. +- **Option sets too:** TLS versions and cipher suites, compression algorithms (proxy and panel), precompressed formats, cache headers, stale-if-error and COLD triggers, passive health error types, Prometheus metric groups, alert types (including Docker alerts), transformation types, listener selection of vhosts and Docker agents, cache-rule stop/keep-only and every other standalone on/off setting are switches. Checkboxes remain only for column pickers, selecting items for a bulk action (certificate assignment, log fields, ACL profiles), the cache-rule condition negation and risk confirmations (terms of service, production issuance, private or local destinations, certificate mismatch, cache cleanup). - **Appearance preference:** **Settings → Appearance → Interface → Show on/off settings as switches** (on by default) brings back ordinary checkboxes everywhere when turned off. Preferences API: additive `switch_controls` boolean (default `true`) in `/api/preferences`; no migration is required. - The Docker **Publish** switch uses the same shared style; switches follow the selected corner style, show a keyboard focus ring and respect reduced motion. Saved configuration and the API are unchanged. diff --git a/docs/DASHBOARD.md b/docs/DASHBOARD.md index 3f2c8f6..37f0201 100644 --- a/docs/DASHBOARD.md +++ b/docs/DASHBOARD.md @@ -100,7 +100,7 @@ Under **Settings → Appearance → Interface**, **Keep dialogs at a stable top ### Switches for on/off settings -Under **Settings → Appearance → Interface**, **Show on/off settings as switches** is **on by default**. Settings that turn a feature or a whole section on or off (for example a vhost's **Enabled**, HSTS, rate limit, cache, Prometheus or alerts) are drawn as switches. Every standalone on/off setting, including options inside a section, is a switch. Choices from a set (TLS versions, compression algorithms, alert types, metric groups), row and column selection, cache-rule modifiers and risk confirmations stay checkboxes. Turning the preference off draws every control as an ordinary checkbox. The account preference is `switch_controls: true|false` in `/api/preferences`; it changes only panel presentation. +Under **Settings → Appearance → Interface**, **Show on/off settings as switches** is **on by default**. Settings that turn a feature or a whole section on or off (for example a vhost's **Enabled**, HSTS, rate limit, cache, Prometheus or alerts) are drawn as switches. Every on/off setting is a switch, including options inside a section and option sets such as TLS versions, cipher suites, compression algorithms, alert types and listener selection. Column pickers, selecting items for a bulk action, the cache-rule condition negation and risk confirmations stay checkboxes. Turning the preference off draws every control as an ordinary checkbox. The account preference is `switch_controls: true|false` in `/api/preferences`; it changes only panel presentation. ## Editing configuration safely diff --git a/langs/en_US.json b/langs/en_US.json index 7d0b266..2e7461d 100644 --- a/langs/en_US.json +++ b/langs/en_US.json @@ -2524,7 +2524,7 @@ "stableDialogPosition": "Keep dialogs at a stable top position", "stableDialogPositionHelp": "Keeps editor dialogs anchored near the top of the viewport so switching between tabs with different content heights does not move the dialog.", "switchControls": "Show on/off settings as switches", - "switchControlsHelp": "Draws settings that turn a feature or section on or off as switches instead of checkboxes. Option lists keep checkboxes.", + "switchControlsHelp": "Draws settings that turn a feature or section on or off as switches instead of checkboxes. Column pickers, bulk selection and risk confirmations keep checkboxes.", "entityEnableHint": "Controls whether this item is active.", "setupCommandExample": "Standard service installation example:", "certificateRuntimeTitle": "ACME runtime", diff --git a/langs/pl_pl.json b/langs/pl_pl.json index 5b189ea..8e6c1d8 100644 --- a/langs/pl_pl.json +++ b/langs/pl_pl.json @@ -2524,7 +2524,7 @@ "stableDialogPosition": "Stabilna pozycja okien dialogowych", "stableDialogPositionHelp": "Utrzymuje edytory blisko górnej krawędzi widoku, dzięki czemu przełączanie między kartami o różnej wysokości nie przesuwa okna.", "switchControls": "Przełączniki zamiast pól wyboru", - "switchControlsHelp": "Ustawienia włączające lub wyłączające funkcję albo sekcję są pokazywane jako przełączniki zamiast pól wyboru. Listy opcji zostają polami wyboru.", + "switchControlsHelp": "Ustawienia włączające lub wyłączające funkcję albo sekcję są pokazywane jako przełączniki zamiast pól wyboru. Wybór kolumn, zaznaczanie elementów i potwierdzenia ryzyka zostają polami wyboru.", "entityEnableHint": "Określa, czy ten element jest aktywny.", "setupCommandExample": "Przykład dla standardowej instalacji usługi:", "certificateRuntimeTitle": "Środowisko ACME", diff --git a/src/admin/web/cache-rules.js b/src/admin/web/cache-rules.js index 283475a..f0a3181 100644 --- a/src/admin/web/cache-rules.js +++ b/src/admin/web/cache-rules.js @@ -315,7 +315,7 @@ window.rustProxyCacheRules = (() => { stage.addEventListener("change", () => { rule.stage = stage.value; rule.actions = rule.actions.filter(a => ACTIONS[rule.stage].includes(a.type)); if (!rule.actions.length) rule.actions = [{ type: ACTIONS[rule.stage][0] }]; rule.conditions = rule.conditions.filter(c => FIELDS[c.field].stages.includes(rule.stage)); render(); changed(); }); const match = select([["all", t("cacheRuleMatchAll")], ["any", t("cacheRuleMatchAny")]], rule.match, t("cacheRuleMatch")); match.addEventListener("change", () => { rule.match = match.value; changed(); syncPreview(); }); - const stop = el("input"); stop.type = "checkbox"; stop.checked = rule.stop; stop.addEventListener("change", () => { rule.stop = stop.checked; changed(); }); + const stop = el("input", undefined, "switch"); stop.type = "checkbox"; stop.checked = rule.stop; stop.addEventListener("change", () => { rule.stop = stop.checked; changed(); }); const labeled = (key, control, help) => { const label = el("label", undefined, "cache-rule-field"); label.append(el("span", t(key)), control); if (help) label.append(el("small", t(help), "fine")); return label; }; const stopLabel = el("label", undefined, "check cache-rule-stop"); stopLabel.append(stop, el("span", t("cacheRuleStop"))); grid.append(labeled("cacheRuleName", name), labeled("cacheRuleId", id), labeled("cacheRuleStage", stage, `cacheRuleStageHelp${rule.stage[0].toUpperCase()}${rule.stage.slice(1)}`), labeled("cacheRuleMatch", match), stopLabel); @@ -386,7 +386,7 @@ window.rustProxyCacheRules = (() => { switch (action.type) { case "strip_cookies": params.append(listInput("keep", t("cacheRuleKeepCookies"))); break; case "strip_query": { - const keepOnly = el("label", undefined, "check"), box = el("input"); box.type = "checkbox"; box.checked = !!action.keep_only; keepOnly.append(box, el("span", t("cacheRuleKeepOnly"))); + const keepOnly = el("label", undefined, "check"), box = el("input", undefined, "switch"); box.type = "checkbox"; box.checked = !!action.keep_only; keepOnly.append(box, el("span", t("cacheRuleKeepOnly"))); box.addEventListener("change", () => { action.keep_only = box.checked; changed(); }); params.append(listInput("params", t("cacheRuleQueryParams")), keepOnly); break; } diff --git a/src/admin/web/docker.js b/src/admin/web/docker.js index db23fda..126150b 100644 --- a/src/admin/web/docker.js +++ b/src/admin/web/docker.js @@ -532,8 +532,8 @@ labeled("dockerAlertDisk", num("docker-alert-disk", value.disk_percent, 50, 100)), labeled("dockerAlertMemory", num("docker-alert-memory", value.memory_percent, 50, 100)), labeled("dockerAlertLoad", num("docker-alert-load", value.load_per_cpu, 0.1, 64, 0.1)), - checkboxField("dockerAlertServiceMissing", check("docker-alert-missing", value.service_missing !== false)), - checkboxField("dockerAlertUnhealthy", check("docker-alert-unhealthy", value.container_unhealthy !== false))); + checkboxField("dockerAlertServiceMissing", check("docker-alert-missing switch", value.service_missing !== false)), + checkboxField("dockerAlertUnhealthy", check("docker-alert-unhealthy switch", value.container_unhealthy !== false))); box.append(grid); holder.replaceChildren(box); } function collectAlertSettings() { @@ -676,11 +676,11 @@ summary.append(el("span", t("dockerPassiveHealth")), el("small", t("dockerPassiveHealthSummary"), "fine")); details.append(summary); const grid = el("div", undefined, "field-grid docker-health-grid"); const enabled = input("", "checkbox", "docker-passive-enabled switch"); enabled.checked = passive.enabled === true; - const connect = input("", "checkbox", "docker-passive-connect"); connect.checked = passive.count_connect_errors !== false; - const timeouts = input("", "checkbox", "docker-passive-timeouts"); timeouts.checked = passive.count_timeouts !== false; - const io = input("", "checkbox", "docker-passive-io"); io.checked = passive.count_io_errors !== false; - const http5xx = input("", "checkbox", "docker-passive-5xx"); http5xx.checked = passive.count_http_5xx !== false; - const slow = input("", "checkbox", "docker-passive-slow"); slow.checked = passive.count_slow_responses === true; + const connect = input("", "checkbox", "docker-passive-connect switch"); connect.checked = passive.count_connect_errors !== false; + const timeouts = input("", "checkbox", "docker-passive-timeouts switch"); timeouts.checked = passive.count_timeouts !== false; + const io = input("", "checkbox", "docker-passive-io switch"); io.checked = passive.count_io_errors !== false; + const http5xx = input("", "checkbox", "docker-passive-5xx switch"); http5xx.checked = passive.count_http_5xx !== false; + const slow = input("", "checkbox", "docker-passive-slow switch"); slow.checked = passive.count_slow_responses === true; const fall = numberInput(passive.fall, "docker-passive-fall", 1, 20, true), rise = numberInput(passive.rise, "docker-passive-rise", 1, 20, true); const optional = [connect, timeouts, io, http5xx, slow, fall, rise]; const optionalFields = [checkboxField("vhPassiveConnect", connect), checkboxField("vhPassiveTimeouts", timeouts), checkboxField("vhPassiveIo", io), checkboxField("vhPassive5xx", http5xx), checkboxField("vhPassiveSlow", slow), labeled("vhPassiveFall", fall), labeled("vhPassiveRise", rise)]; diff --git a/src/admin/web/index.html b/src/admin/web/index.html index 0d0f85b..62db646 100644 --- a/src/admin/web/index.html +++ b/src/admin/web/index.html @@ -2152,7 +2152,7 @@ data-i18n="switchControls">Show on/off settings as switchesDraws settings that turn a feature or section on or off as switches instead of - checkboxes. Option lists keep checkboxes. + checkboxes. Column pickers, bulk selection and risk confirmations keep checkboxes.
Idle and LRU hot objects are demoted to disk. A cold hit is read asynchronously and promoted back to RAM. Metadata is readable JSON; bodies are stored as raw .body files.
-Docker alerts are configured in @@ -3554,11 +3554,11 @@ absolute 7–30 day lifetime.
The browser negotiates the best @@ -3914,8 +3914,8 @@
Global defaults for TLS frontends. Per-vhost overrides can narrow versions/ciphers. HTTP/3 requires TLS 1.3.
-