From e999eb68c25f267c9135db391cd606ad18bb8468 Mon Sep 17 00:00:00 2001 From: Debian Date: Sun, 31 May 2026 23:37:56 +0200 Subject: [PATCH] =?UTF-8?q?fix(firewall/ui):=20Card-Tabs=20+=20no-cache=20?= =?UTF-8?q?Header=20f=C3=BCr=20index.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Tabs type="card": jeder Tab hat eigene sichtbare Box statt Unterstrich - cardBg: #F1F5F9 für inaktive Card-Tabs - main.go: index.html + SPA-Fallback mit no-cache Header ausliefern (Vite hashed assets /assets/* bleiben immutable=1Jahr cached) - Verhindert dass der Browser veraltete index.html nach Updates cached Co-Authored-By: Claude Sonnet 4.6 --- VERSION | 2 +- cmd/edgeguard-api/main.go | 8 ++++++++ management-ui/src/App.tsx | 2 +- management-ui/src/pages/Firewall/index.tsx | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 62cc622..3e23e56 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.53 +1.2.54 diff --git a/cmd/edgeguard-api/main.go b/cmd/edgeguard-api/main.go index f692b3c..9827613 100644 --- a/cmd/edgeguard-api/main.go +++ b/cmd/edgeguard-api/main.go @@ -586,10 +586,18 @@ func mountUI(r *gin.Engine) { return } if info, err := os.Stat(full); err == nil && !info.IsDir() { + // Vite hashed assets are immutable — cache them forever. + // index.html must never be cached so updates take effect. + if strings.HasPrefix(clean, "/assets/") { + c.Header("Cache-Control", "public, max-age=31536000, immutable") + } else { + c.Header("Cache-Control", "no-cache, no-store, must-revalidate") + } c.File(full) return } // SPA fallback — React Router renders the right page. + c.Header("Cache-Control", "no-cache, no-store, must-revalidate") c.File(indexPath) }) } diff --git a/management-ui/src/App.tsx b/management-ui/src/App.tsx index cad1378..c7f8930 100644 --- a/management-ui/src/App.tsx +++ b/management-ui/src/App.tsx @@ -68,8 +68,8 @@ const antdTheme = { itemHoverColor: '#0F172A', itemSelectedColor: '#0EA5E9', inkBarColor: '#0EA5E9', + cardBg: '#F1F5F9', titleFontSize: 13, - horizontalItemPadding: '10px 18px', }, }, } diff --git a/management-ui/src/pages/Firewall/index.tsx b/management-ui/src/pages/Firewall/index.tsx index 8b9b484..7cb5c9b 100644 --- a/management-ui/src/pages/Firewall/index.tsx +++ b/management-ui/src/pages/Firewall/index.tsx @@ -125,7 +125,7 @@ export default function FirewallPage() { )} /> - + ) }