package traefikllmgateway import ( "encoding/json" "fmt" "net/http" "net/url" "strconv" "strings" "time" ) // The admin dashboard's routes (spec §4, v0.2; adminUsageHistoryPath added // by the v0.2 data-layer task; adminAssetsPathPrefix added by the Vue // admin-panel task), matched only when adminEnabled(g.cfg) — see // llmgateway.go's ServeHTTP dispatch. adminAssetsPathPrefix is a prefix, // not one fixed path: every hashed filename the Vite build emits // (admin_assets_gen.go) is served under it. const ( adminPagePath = "/admin" adminAssetsPathPrefix = "/admin/assets/" adminOverviewPath = "/admin/api/overview" adminUsagePath = "/admin/api/usage" adminUsageHistoryPath = "/admin/api/usage/history" ) // adminCSP is the Content-Security-Policy header served with GET /admin // and the three /admin/api/* JSON routes (spec §4, v0.2; extended to the // JSON routes by a folded review item, 2026-08-20 review). It was // widened with `script-src 'unsafe-inline'`/`style-src 'unsafe-inline'` // for the original vanilla-JS single-file page; the baked Vue build (Vue // admin-panel task) needs neither: `vite build` emits index.html with // only an external `