From a977cf78a5bae9f2e6bb5afaee592b7b34e5d1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Mon, 16 Nov 2026 21:06:27 +0100 Subject: [PATCH] v0.38.6 --- AGENTS.md | 2 +- CHANGELOG.md | 10 ++++ Cargo.lock | 2 +- Cargo.toml | 2 +- docker-agent/model.go | 2 +- docs/HEADLESS.md | 2 +- integrations/routeros-oci-build/README.md | 4 +- langs/en_US.json | 2 +- langs/pl_pl.json | 2 +- src/admin/openapi.json | 2 +- src/admin/web/app/chart-scales.js | 40 ++++++++++++++ src/admin/web/css/10-base.css | 7 +++ src/admin/web/css/30-overview.css | 65 +++++++++++++++++++++++ src/admin/web/css/40-editors.css | 41 ++++++++++++++ src/admin/web/docker.js | 2 +- src/admin/web/vhosts/core.js | 4 +- src/admin/web/vhosts/editor.js | 10 ++-- tests/panel_refresh_contract.js | 2 +- 18 files changed, 182 insertions(+), 19 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5c5a7ae..cbbacc6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # RustProxy source and documentation maintenance -Current source version: **0.38.5**. The Cargo package and binary are named `rust-proxy`. +Current source version: **0.38.6**. The Cargo package and binary are named `rust-proxy`. Before editing, read [README.md](README.md), the relevant [documentation guide](docs/README.md) and the actual code and tests. Historical release experiments are not current specifications. Use the bundled `src/admin/openapi.json` for API routes and payloads; the source implementation is authoritative for runtime behavior. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8696b50..11232b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ Release history focused on **features, settings, default behavior, compatibility and fixes**. Changes to internal code structure and preliminary performance experiments are intentionally omitted. Historical descriptions reflect their respective releases; consult the current documentation for the settings available in the latest release. +## 0.38.6 — chart crosshair and editor layout + +Panel-only release: no configuration, API or proxy behavior changes. + +- **Chart crosshair:** with **Settings → Appearance → Show X/Y scales on charts** on, pointing at a chart (or touching it) shows dashed guide lines through the pointer with the Y value in the chart's unit and the X sample number; charts with one scale per series show each series' value. It follows the interface scale and corner style and is hidden when axes are off. +- **Switches never share a row with fields:** in the vhost, stream, redirect and Web Service editors a switch that enables fields now takes its own row and a switch after fields starts a new row, so the fields below line up (for example HSTS, security headers, per-client IP rate limit, response identity and diagnostics, WebSocket, retries, keep-alive, passive health, .htaccess). **Override global TLS policy** has its own row above the TLS versions. +- **Aligned fields:** fields in one row of an editor or settings form now start their inputs and drop-downs on the same line even when one caption wraps to more lines (for example Tinyauth URL / public login URL, passive health thresholds, Prometheus address / path); multi-line text areas take the whole row. Stacked switches no longer leave large gaps between them, most visible on phones. +- **Server-Timing metric names:** the option for the pre-0.38.2 names is now labelled **Legacy (proxy, origin, cache)**; the stored value `legacy` is unchanged. +- **Risk settings as switches:** **Force an incompatible certificate**, **Allow private origin IP** (backends and authentication providers) and **Allow local RustProxy listener as backend** are switches like the other settings, also in the Docker app editor. One-off confirmations before an action (ACME terms, production issuance, cache cleanup option) stay checkboxes. + ## 0.38.5 — instant panel Panel-only release: no configuration, API or proxy behavior changes. Measured on a replay of a production installation with 50 Docker apps (same data before and after): page elements 116 000 → 20 000, tab switches typically 110–310 ms → 12–50 ms, opening **Docker vhosts** about 1.6 s of blocked page → under 100 ms, work per live update 50–135 ms → 10–45 ms. diff --git a/Cargo.lock b/Cargo.lock index 2dcb236..b92e207 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1943,7 +1943,7 @@ dependencies = [ [[package]] name = "rust-proxy" -version = "0.38.5" +version = "0.38.6" dependencies = [ "anyhow", "arc-swap", diff --git a/Cargo.toml b/Cargo.toml index f827563..7b0b76d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust-proxy" -version = "0.38.5" +version = "0.38.6" edition = "2021" rust-version = "1.99.1" description = "RustProxy - independent reverse proxy with local administration" diff --git a/docker-agent/model.go b/docker-agent/model.go index b8cb398..9fbfa79 100644 --- a/docker-agent/model.go +++ b/docker-agent/model.go @@ -1,6 +1,6 @@ package main -var version = "0.38.5" // overridden by the package builder using -ldflags -X main.version +var version = "0.38.6" // overridden by the package builder using -ldflags -X main.version type config struct { Listen string diff --git a/docs/HEADLESS.md b/docs/HEADLESS.md index 8d23d0f..2384842 100644 --- a/docs/HEADLESS.md +++ b/docs/HEADLESS.md @@ -196,7 +196,7 @@ In a container, mount the file read-only (RustProxy never writes it) and keep `/ `GET /healthz` on `--health-listen` answers `200` while every vhost with backends has at least one healthy backend and `503` otherwise: ```json -{"status":"ok","mode":"headless","version":"0.38.5","revision":4,"uptime_seconds":120, +{"status":"ok","mode":"headless","version":"0.38.6","revision":4,"uptime_seconds":120, "last_reload":{"ok":true,"at_unix":1794743660,"error":null}, "vhosts_without_healthy_backends":[], "pools":[{"vhost":"app","healthy":3,"backends":3}]} diff --git a/integrations/routeros-oci-build/README.md b/integrations/routeros-oci-build/README.md index 0742abe..b6ca469 100644 --- a/integrations/routeros-oci-build/README.md +++ b/integrations/routeros-oci-build/README.md @@ -77,10 +77,10 @@ ENV_FILE=integrations/routeros-oci-build/.env \ bash integrations/routeros-oci-build/build-routeros-oci.sh push ``` -For example, with RustProxy version `0.38.5` and the defaults this publishes: +For example, with RustProxy version `0.38.6` and the defaults this publishes: ```text -oci.example.net/network/rustproxy:0.38.5 +oci.example.net/network/rustproxy:0.38.6 oci.example.net/network/rustproxy:latest oci.example.net/network/rustproxy:routeros ``` diff --git a/langs/en_US.json b/langs/en_US.json index 2e7461d..017caa7 100644 --- a/langs/en_US.json +++ b/langs/en_US.json @@ -983,7 +983,7 @@ "vhTimingHeaderNames": "Server-Timing metric names", "vhTimingHeaderNamesStandard": "Reverse proxy (proxy, upstream, proxy-cache)", "vhTimingHeaderNamesCdn": "CDN edge (edge, origin, cdn-cache)", - "vhTimingHeaderNamesLegacy": "Before 0.38.2 (proxy, origin, cache)", + "vhTimingHeaderNamesLegacy": "Legacy (proxy, origin, cache)", "vhTimingAllowOrigin": "Timing-Allow-Origin (origins that may read the timings, or *)", "vhRateEnabled": "Enable per-client IP rate limit", "vhRateRequests": "Requests per window", diff --git a/langs/pl_pl.json b/langs/pl_pl.json index 8e6c1d8..8a89389 100644 --- a/langs/pl_pl.json +++ b/langs/pl_pl.json @@ -983,7 +983,7 @@ "vhTimingHeaderNames": "Nazwy metryk Server-Timing", "vhTimingHeaderNamesStandard": "Reverse proxy (proxy, upstream, proxy-cache)", "vhTimingHeaderNamesCdn": "Brzeg CDN (edge, origin, cdn-cache)", - "vhTimingHeaderNamesLegacy": "Sprzed 0.38.2 (proxy, origin, cache)", + "vhTimingHeaderNamesLegacy": "Tryb zgodności (proxy, origin, cache)", "vhTimingAllowOrigin": "Timing-Allow-Origin (originy, które mogą czytać czasy, albo *)", "vhRateEnabled": "Włącz limit żądań per IP klienta", "vhRateRequests": "Żądania na okno", diff --git a/src/admin/openapi.json b/src/admin/openapi.json index 6f9ab44..658f3b0 100644 --- a/src/admin/openapi.json +++ b/src/admin/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.3", "info": { "title": "RustProxy Administration API", - "version": "0.38.5", + "version": "0.38.6", "description": "Administration API for the active panel origin. Sign in through the panel; the same-origin HttpOnly cookie authenticates all private operations. Mutations also require the exact Origin, X-RustProxy-Request: 1 and a session-bound X-CSRF-Token. Loopback HTTP is the default; Settings can enable HTTPS before using a non-loopback administration bind. This document contains no live configuration or credentials. Object schemas marked extensible are summaries: full configuration validation is authoritative in Rust. The API also permits explicitly scoped GeneralApiBearer tokens on a narrow route allowlist, with RO/RW and source CIDR checks; API-token management and Prometheus-token management are browser-session-only." }, "servers": [ diff --git a/src/admin/web/app/chart-scales.js b/src/admin/web/app/chart-scales.js index 998aa42..4686ab8 100644 --- a/src/admin/web/app/chart-scales.js +++ b/src/admin/web/app/chart-scales.js @@ -50,6 +50,45 @@ window.rustProxyChartScale = (() => { } return `${format(n)}${unit === "percent" ? "%" : unit === "ms" ? " ms" : unit === "rate" ? "/s" : ""}`; } + // Crosshair: with axes enabled, dashed guide lines follow the pointer and + // label the Y value and X sample under it. Values come from the same + // axis data the overlay uses, so they match the drawn scale. + function crosshairValues(svg, event) { + const data = svg.rustProxyAxisData, box = svg.getBoundingClientRect(); + if (!data || !box.width || !box.height) return null; + const fx = Math.min(1, Math.max(0, (event.clientX - box.left) / box.width)); + const fy = Math.min(1, Math.max(0, (event.clientY - box.top) / box.height)); + const span = data.bottom - data.top || 1, ratio = Math.max(0, (data.bottom - fy) / span); + const sample = data.count > 1 ? Math.round(fx * (data.count - 1)) + 1 : data.count; + const scales = Array.isArray(data.seriesScales) && data.seriesScales.length ? data.seriesScales : null; + const y = scales ? scales.map(([name, peak]) => `${name}: ${axisValue(peak * ratio, data.unit)}`).join(" · ") : `Y ${axisValue(data.peak * ratio, data.unit)}`; + return { box, fx, fy, y, x: data.count ? `X ${sample}/${data.count}` : "X –" }; + } + function attachCrosshair(host, svg) { + const cross = document.createElement("div"); cross.className = "rp-chart-crosshair"; cross.hidden = true; cross.setAttribute("aria-hidden", "true"); + const vertical = document.createElement("i"), horizontal = document.createElement("i"), yLabel = document.createElement("span"), xLabel = document.createElement("span"); + vertical.className = "rp-chart-crosshair-v"; horizontal.className = "rp-chart-crosshair-h"; yLabel.className = "rp-chart-crosshair-y"; xLabel.className = "rp-chart-crosshair-x"; + cross.append(vertical, horizontal, yLabel, xLabel); host.append(cross); + let frame = 0, last = null; + const draw = () => { + frame = 0; if (!last || !host.isConnected) return; + const values = crosshairValues(svg, last); if (!values) { cross.hidden = true; return; } + // Client rectangles include the interface-scale transform; the + // overlay is positioned in the host's own (unscaled) pixels. + const hostBox = host.getBoundingClientRect(), scale = host.offsetWidth ? hostBox.width / host.offsetWidth : 1; + const left = (values.box.left - hostBox.left) / scale, top = (values.box.top - hostBox.top) / scale, width = values.box.width / scale, height = values.box.height / scale; + const x = left + values.fx * width, y = top + values.fy * height; + cross.style.setProperty("--rp-cross-left", `${left}px`); cross.style.setProperty("--rp-cross-top", `${top}px`); + cross.style.setProperty("--rp-cross-width", `${width}px`); cross.style.setProperty("--rp-cross-height", `${height}px`); + cross.style.setProperty("--rp-cross-x", `${x}px`); cross.style.setProperty("--rp-cross-y", `${y}px`); + cross.classList.toggle("is-right", values.fx > .6); cross.classList.toggle("is-low", values.fy > .7); + yLabel.textContent = values.y; xLabel.textContent = values.x; cross.hidden = false; + }; + const move = event => { if (event.target.closest?.(".rp-chart-axis-x, .rp-chart-axis-series")) { cross.hidden = true; return; } last = event; if (!frame) frame = requestAnimationFrame(draw); }; + const leave = () => { last = null; cross.hidden = true; }; + host.addEventListener("pointermove", move); host.addEventListener("pointerdown", move); + host.addEventListener("pointerleave", leave); host.addEventListener("pointercancel", leave); + } function setAxisText(node, value) { if (node.textContent !== value) node.textContent = value; } @@ -81,6 +120,7 @@ window.rustProxyChartScale = (() => { x.append(tick); } host.append(overlay, perSeries, x); + attachCrosshair(host, svg); } const { peak: maximum, unit, count, top, bottom, clipped, seriesScales } = svg.rustProxyAxisData; const compact = svg.closest(".stat-chart") !== null; diff --git a/src/admin/web/css/10-base.css b/src/admin/web/css/10-base.css index 275776b..51c09aa 100644 --- a/src/admin/web/css/10-base.css +++ b/src/admin/web/css/10-base.css @@ -494,6 +494,13 @@ button.is-saving { font-size: 11px; } +/* The 13px top margin lines a single toggle up with labelled fields above + it; stacked toggles only need a small step, and toggles laid out in rows + or editor grids use the container gap instead. */ +.check+.check { + margin-top: 6px !important; +} + .form-actions { display: flex; align-items: center; diff --git a/src/admin/web/css/30-overview.css b/src/admin/web/css/30-overview.css index cd17fcf..846972f 100644 --- a/src/admin/web/css/30-overview.css +++ b/src/admin/web/css/30-overview.css @@ -169,6 +169,71 @@ html[data-theme=cream] :is(.card, .stat, dialog) { gap: 2px; } +.rp-chart-crosshair { + position: absolute; + inset: 0; + pointer-events: none; + z-index: 2; + font: 9px/1.15 var(--mono); + font-variant-numeric: tabular-nums; +} + +.rp-chart-crosshair[hidden] { + display: none; +} + +.rp-chart-crosshair-v, +.rp-chart-crosshair-h { + position: absolute; + display: block; + border: 0 dashed color-mix(in srgb, var(--text) 55%, transparent); +} + +.rp-chart-crosshair-v { + top: var(--rp-cross-top); + left: var(--rp-cross-x); + height: var(--rp-cross-height); + border-left-width: 1px; +} + +.rp-chart-crosshair-h { + top: var(--rp-cross-y); + left: var(--rp-cross-left); + width: var(--rp-cross-width); + border-top-width: 1px; +} + +.rp-chart-crosshair-y, +.rp-chart-crosshair-x { + position: absolute; + padding: 1px 4px; + border: 1px solid var(--line); + border-radius: min(3px, var(--rp-radius-control, 3px)); + background: var(--panel); + color: var(--text); + white-space: nowrap; +} + +.rp-chart-crosshair-y { + top: var(--rp-cross-y); + left: calc(var(--rp-cross-left) + 3px); + transform: translateY(-120%); +} + +.rp-chart-crosshair.is-low .rp-chart-crosshair-y { + transform: translateY(20%); +} + +.rp-chart-crosshair-x { + top: calc(var(--rp-cross-top) + var(--rp-cross-height) - 2px); + left: var(--rp-cross-x); + transform: translate(6px, -100%); +} + +.rp-chart-crosshair.is-right .rp-chart-crosshair-x { + transform: translate(calc(-100% - 6px), -100%); +} + .rp-chart-axis-series { display: flex; flex-wrap: wrap; diff --git a/src/admin/web/css/40-editors.css b/src/admin/web/css/40-editors.css index 523d630..a0579e6 100644 --- a/src/admin/web/css/40-editors.css +++ b/src/admin/web/css/40-editors.css @@ -80,6 +80,47 @@ gap: 7px; } +/* Switches never share a row with ordinary fields: a field after a switch + and a switch after a field each start a new row. Consecutive switches + still sit side by side (for example TLS 1.2 / TLS 1.3). */ +.vh-grid>.check+:not(.check), +.vh-grid>:not(.check)+.check { + grid-column-start: 1; +} + +.vh-grid>.check, +.vh-backend-switches>.check { + margin-top: 0 !important; +} + +.vh-grid>:not(.check)+.check { + margin-top: 6px !important; +} + +/* Fields in one row line up: each field spans a caption row and a control + row of the editor grid, and a plain caption + control field uses those + rows as a subgrid, so a caption that wraps to more lines makes the whole + caption row taller and every control in the row still starts on the same + line. Multi-line text areas take the whole row instead of a narrow column. */ +:is(.vh-grid>.vh-field, .cache-rules-tester-grid>.cache-rule-field, .field-grid>label:not([class])) { + grid-row: span 2; +} + +:is(.vh-grid>.vh-field, .cache-rules-tester-grid>.cache-rule-field, .field-grid>label:not([class])):has(>:nth-child(2):last-child) { + display: grid; + grid-template-rows: subgrid; + row-gap: 4px; + align-content: start; +} + +:is(.vh-grid>.vh-field, .cache-rules-tester-grid>.cache-rule-field, .field-grid>label:not([class])):has(>:nth-child(2):last-child)>:first-child { + align-self: end; +} + +.vh-grid>.vh-field:has(>textarea) { + grid-column: 1 / -1; +} + .vh-field input, .vh-field select { width: 100%; diff --git a/src/admin/web/docker.js b/src/admin/web/docker.js index 5b0e441..18e7491 100644 --- a/src/admin/web/docker.js +++ b/src/admin/web/docker.js @@ -1030,7 +1030,7 @@ const transformEnabled = input("", "checkbox", "docker-transform-enabled switch"); transformEnabled.checked = assignment?.transform_enabled === true; const transformField = checkboxField("dockerTransform", transformEnabled); const compressionEnabled = input("", "checkbox", "docker-compression-enabled switch"); compressionEnabled.checked = assignment?.compression_enabled !== false; const compressionField = checkboxField("dockerCompression", compressionEnabled); compressionField.title = t("dockerCompressionHelp"); const switches = el("div", undefined, "docker-switch-row"); switches.append(preserveLabel, forceSslField, websocketField, cacheField, compressionField, transformField); - const certMismatch = input("", "checkbox", "docker-cert-mismatch"); certMismatch.checked = assignment?.allow_certificate_mismatch === true; + const certMismatch = input("", "checkbox", "docker-cert-mismatch switch"); certMismatch.checked = assignment?.allow_certificate_mismatch === true; certMismatch.disabled = !agentCertificates(agent).length; if (certMismatch.disabled) certMismatch.checked = false; const mismatchLabel = el("label", undefined, "check"); diff --git a/src/admin/web/vhosts/core.js b/src/admin/web/vhosts/core.js index f2149c4..0f5c68c 100644 --- a/src/admin/web/vhosts/core.js +++ b/src/admin/web/vhosts/core.js @@ -217,13 +217,13 @@ function memberRow(parent, value = { id: `origin-${parent.children.length + 1}`, for (const [name, key, checked] of [["member-enabled", "vhEnabled", value.enabled !== false], ["member-pool", "locationPoolEligible", value.pool_eligible !== false], ["member-backup", "vhBackup", value.backup], ["member-drain", "vhDrain", value.drain], ["member-health-enabled", "backendHealthEnabled", value.health_check_enabled !== false]]) controls[name] = field(routing, name, key, checked, "checkbox"); const connection = el("div", undefined, "vh-wide vh-backend-switches vh-backend-connection"); main.append(connection); for (const name of ["member-enabled", "member-pool", "member-backup", "member-drain", "member-health-enabled"]) controls[name].classList.add("switch"); - controls["member-private"] = field(connection, "member-private", "vhPrivate", value.allow_private, "checkbox"); + controls["member-private"] = field(connection, "member-private", "vhPrivate", value.allow_private, "checkbox", { switch: true }); const preserve = field(connection, "member-host", "vhPreserveHost", value.preserve_host === true, "checkbox", { switch: true }); const advanced = el("details", undefined, "vh-wide vh-backend-advanced"), extra = el("div", undefined, "vh-grid"); advanced.append(text("summary", "advanced"), extra); field(extra, "member-allowlist", "vhAddressAllowlist", (value.address_allowlist || []).join("\n"), "textarea", { rows: 2, maxLength: 8192 }); const riskGate = el("div", undefined, "vh-wide vh-local-risk-gate"); extra.append(riskGate); - const localRisk = field(riskGate, "member-local-risk", "vhLocalListenerRisk", value.accept_local_listener_risk === true, "checkbox"); + const localRisk = field(riskGate, "member-local-risk", "vhLocalListenerRisk", value.accept_local_listener_risk === true, "checkbox", { switch: true }); localRisk.addEventListener("change", async () => { if (localRisk.checked && !(await appConfirm(t("vhLocalListenerRiskConfirm"), { danger: true }))) localRisk.checked = false; }); note(riskGate, "vhLocalListenerRiskHelp"); field(extra, "member-tls-name", "vhTlsServerName", value.tls_server_name || "", "text", { maxLength: 253, placeholder: "backend.example.internal" }); diff --git a/src/admin/web/vhosts/editor.js b/src/admin/web/vhosts/editor.js index a12e247..ecc6783 100644 --- a/src/admin/web/vhosts/editor.js +++ b/src/admin/web/vhosts/editor.js @@ -354,14 +354,14 @@ function load(value = defaults(), migrationIds = [], show = true) { vhostAutoCertificate = window.rustProxyAutoCertificate.attach(selector, { auto: !editing, anchor: certificateRow, hosts: () => { try { return readHosts(); } catch { return []; } }, certificates: () => [...(envelope?.config.tls?.certificates || []), ...stagedCertificates] }); vhostAutoCertificate.refresh(); certificateRow.append(button("certManage", async () => { if (!(await closeEditor())) return; setPanel("tls"); })); note(g, "certSelectHint"); - const mismatch = field(g, "allow-certificate-mismatch", "vhCertificateMismatchForce", value.allow_certificate_mismatch === true, "checkbox"); + const mismatch = field(g, "allow-certificate-mismatch", "vhCertificateMismatchForce", value.allow_certificate_mismatch === true, "checkbox", { switch: true }); const mismatchHint = note(g, "vhCertificateMismatchWarning"); const syncMismatch = () => { mismatch.disabled = !selector.value; if (!selector.value) mismatch.checked = false; mismatchHint.hidden = !mismatch.checked; }; selector.addEventListener("change", syncMismatch); mismatch.addEventListener("change", syncMismatch); syncMismatch(); g = group("vhSslSettings"); const inheritedTlsPolicy = envelope?.config.tls?.policy || { tls12: true, tls13: true, cipher_suites: [] }; const tlsPolicy = value.tls_policy || inheritedTlsPolicy; - const customTlsPolicy = field(g, "tls-policy-custom", "vhTlsOverride", value.tls_policy != null, "checkbox", { switch: true }); + const customTlsPolicy = field(g, "tls-policy-custom", "vhTlsOverride", value.tls_policy != null, "checkbox", { switch: true }); customTlsPolicy.closest("label")?.classList.add("vh-wide"); const tls12 = field(g, "tls-policy-12", "tls12", tlsPolicy.tls12 !== false, "checkbox", { switch: true }); const tls13 = field(g, "tls-policy-13", "tls13", tlsPolicy.tls13 !== false, "checkbox", { switch: true }); const tlsCiphers = field(g, "tls-policy-ciphers", "tlsCiphers", (tlsPolicy.cipher_suites || []).join("\n"), "textarea", { rows: 7, maxLength: 8192 }); @@ -381,7 +381,7 @@ function load(value = defaults(), migrationIds = [], show = true) { const loginUrl = field(taPrimary, "auth-login", "taLogin", auth.login_url || "", "url", { maxLength: 2048 }); authUrl.placeholder = "http://10.87.7.99:3000"; loginUrl.placeholder = "https://auth.example.com/login"; const taOptions = el("div", undefined, "vh-wide auth-provider-options"); taPrimary.append(taOptions); - field(taOptions, "auth-private", "vhPrivate", auth.allow_private, "checkbox"); + field(taOptions, "auth-private", "vhPrivate", auth.allow_private, "checkbox", { switch: true }); field(taOptions, "auth-redirect-forbidden", "taRedirectForbidden", auth.redirect_forbidden !== false, "checkbox", { switch: true }); note(taBody, "taHelp"); @@ -408,7 +408,7 @@ function load(value = defaults(), migrationIds = [], show = true) { login.placeholder = "https://auth.example.com"; } const options = el("div", undefined, "vh-wide auth-provider-options"); primary.append(options); - field(options, `${id}-private`, "vhPrivate", current.allow_private, "checkbox"); + field(options, `${id}-private`, "vhPrivate", current.allow_private, "checkbox", { switch: true }); field(options, `${id}-redirect-forbidden`, "taRedirectForbidden", current.redirect_forbidden === true, "checkbox", { switch: true }); note(body, id === "authelia" ? "autheliaHelp" : "authentikHelp"); const advanced = el("details", undefined, "vh-wide auth-advanced"); advanced.append(text("summary", "forwardAuthAdvanced")); @@ -441,7 +441,7 @@ function load(value = defaults(), migrationIds = [], show = true) { oidcSession.autocomplete = "new-password"; const oidcScopes = field(oidcPrimary, "oidc-scopes", "oidcScopes", oidc.scopes || "openid profile email", "text", { maxLength: 1024 }); const oidcOptions = el("div", undefined, "vh-wide auth-provider-options"); oidcPrimary.append(oidcOptions); - field(oidcOptions, "oidc-private", "vhPrivate", oidc.allow_private === true, "checkbox"); + field(oidcOptions, "oidc-private", "vhPrivate", oidc.allow_private === true, "checkbox", { switch: true }); note(oidcBody, "oidcHelp"); const oidcAdvanced = el("details", undefined, "vh-wide auth-advanced"); oidcAdvanced.append(text("summary", "forwardAuthAdvanced")); const oidcAdvancedGrid = el("div", undefined, "vh-grid"); oidcAdvanced.append(oidcAdvancedGrid); oidcBody.append(oidcAdvanced); diff --git a/tests/panel_refresh_contract.js b/tests/panel_refresh_contract.js index 5718cb3..dc51841 100644 --- a/tests/panel_refresh_contract.js +++ b/tests/panel_refresh_contract.js @@ -51,5 +51,5 @@ const events = openapi.paths["/api/events"].get; const logsFlag = (events.parameters || []).find(parameter => parameter.name === "logs"); assert.equal(logsFlag?.schema?.type, "boolean"); assert.equal(logsFlag?.schema?.default, true); -assert.equal(openapi.info.version, "0.38.5"); +assert.equal(openapi.info.version, "0.38.6"); console.log("Panel refresh/API contract checks: OK");