fix(firewall/ui): Card-Tabs + no-cache Header für index.html

- 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 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-05-31 23:37:56 +02:00
parent a84b9ae10a
commit e999eb68c2
4 changed files with 11 additions and 3 deletions

View File

@@ -1 +1 @@
1.2.53 1.2.54

View File

@@ -586,10 +586,18 @@ func mountUI(r *gin.Engine) {
return return
} }
if info, err := os.Stat(full); err == nil && !info.IsDir() { 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) c.File(full)
return return
} }
// SPA fallback — React Router renders the right page. // SPA fallback — React Router renders the right page.
c.Header("Cache-Control", "no-cache, no-store, must-revalidate")
c.File(indexPath) c.File(indexPath)
}) })
} }

View File

@@ -68,8 +68,8 @@ const antdTheme = {
itemHoverColor: '#0F172A', itemHoverColor: '#0F172A',
itemSelectedColor: '#0EA5E9', itemSelectedColor: '#0EA5E9',
inkBarColor: '#0EA5E9', inkBarColor: '#0EA5E9',
cardBg: '#F1F5F9',
titleFontSize: 13, titleFontSize: 13,
horizontalItemPadding: '10px 18px',
}, },
}, },
} }

View File

@@ -125,7 +125,7 @@ export default function FirewallPage() {
)} )}
/> />
<FirewallKPIStrip nftablesActive={nftables?.active} /> <FirewallKPIStrip nftablesActive={nftables?.active} />
<Tabs items={tabs} defaultActiveKey="rules" /> <Tabs items={tabs} defaultActiveKey="rules" type="card" />
</div> </div>
) )
} }