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:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ const antdTheme = {
|
||||
itemHoverColor: '#0F172A',
|
||||
itemSelectedColor: '#0EA5E9',
|
||||
inkBarColor: '#0EA5E9',
|
||||
cardBg: '#F1F5F9',
|
||||
titleFontSize: 13,
|
||||
horizontalItemPadding: '10px 18px',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ export default function FirewallPage() {
|
||||
)}
|
||||
/>
|
||||
<FirewallKPIStrip nftablesActive={nftables?.active} />
|
||||
<Tabs items={tabs} defaultActiveKey="rules" />
|
||||
<Tabs items={tabs} defaultActiveKey="rules" type="card" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user