From bb1721640d1f0ceda42d6930b72cea1ee2667cb5 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:09:45 +0200 Subject: [PATCH] www/caddy: Fix add handler command causing all domain and subdomain selections being cleared sometimes (#4748) --- www/caddy/Makefile | 2 +- www/caddy/pkg-descr | 5 +++++ .../app/views/OPNsense/Caddy/reverse_proxy.volt | 17 +++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/www/caddy/Makefile b/www/caddy/Makefile index a96b00369..08f8f247a 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= caddy -PLUGIN_VERSION= 2.0.0 +PLUGIN_VERSION= 2.0.1 PLUGIN_DEPENDS= caddy-custom PLUGIN_COMMENT= Modern Reverse Proxy with Automatic HTTPS, Dynamic DNS and Layer4 Routing PLUGIN_MAINTAINER= cedrik@pischem.com diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 5675bdbf0..6eb887b28 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -6,6 +6,11 @@ DOC: https://docs.opnsense.org/manual/how-tos/caddy.html Plugin Changelog ================ +2.0.1 + +Add: Active health checks to handlers (contributed by zaben903) (opnsense/plugins/pull/4721) +Fix: Add handler command sometimes clearing domain selection in open dialogue (opnsense/plugins/pull/4748) + 2.0.0 * Attention - Breaking Change: All DNS Providers except Cloudflare have been removed and will not come back (opnsense/plugins/pull/4691) diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt index f7d9bbe62..63c32b268 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt @@ -394,17 +394,14 @@ // When subdomain is selected in handler show only wildcard domains $("#handle\\.subdomain").on("change", function () { - const subdomainSelected = $("#handle\\.subdomain").val() !== ""; + if (!$(this).val()) { + $("#handle\\.reverse option").show(); + } else { + $("#handle\\.reverse option").each(function () { + $(this).toggle($(this).text().includes("*.")); + }); - $("#handle\\.reverse").find("option").each(function () { - const isWildcard = $(this).text().includes("*."); - $(this).toggle(!subdomainSelected || isWildcard); - }); - - if (subdomainSelected) { - const selectedText = $("#handle\\.reverse").find("option:selected").text(); - if (!selectedText.includes("*.")) { - // Clear selection if not a wildcard + if (!$("#handle\\.reverse option:selected").text().includes("*.")) { $("#handle\\.reverse").val("").change(); } }