chore(backend): comment out swagger related assets and redundant css keys

This commit is contained in:
Jack Westbrook
2025-03-03 09:49:21 +01:00
parent 54b4cbf3f1
commit caaa1fe62f
3 changed files with 16 additions and 26 deletions
+14 -14
View File
@@ -40,11 +40,11 @@ type IndexViewData struct {
type EntryPointAssets struct {
ContentDeliveryURL string `json:"cdn,omitempty"`
JSFiles []EntryPointAsset `json:"jsFiles"`
CSSFiles []EntryPointAsset `json:"cssFiles"`
Dark string `json:"dark"`
Light string `json:"light"`
Swagger []EntryPointAsset `json:"swagger"`
SwaggerCSSFiles []EntryPointAsset `json:"swaggerCssFiles"`
// CSSFiles []EntryPointAsset `json:"cssFiles"`
Dark string `json:"dark"`
Light string `json:"light"`
// Swagger []EntryPointAsset `json:"swagger"`
// SwaggerCSSFiles []EntryPointAsset `json:"swaggerCssFiles"`
}
type EntryPointAsset struct {
@@ -62,13 +62,13 @@ func (a *EntryPointAssets) SetContentDeliveryURL(prefix string) {
for i, p := range a.JSFiles {
a.JSFiles[i].FilePath = prefix + p.FilePath
}
for i, p := range a.CSSFiles {
a.CSSFiles[i].FilePath = prefix + p.FilePath
}
for i, p := range a.Swagger {
a.Swagger[i].FilePath = prefix + p.FilePath
}
for i, p := range a.SwaggerCSSFiles {
a.SwaggerCSSFiles[i].FilePath = prefix + p.FilePath
}
// for i, p := range a.CSSFiles {
// a.CSSFiles[i].FilePath = prefix + p.FilePath
// }
// for i, p := range a.Swagger {
// a.Swagger[i].FilePath = prefix + p.FilePath
// }
// for i, p := range a.SwaggerCSSFiles {
// a.SwaggerCSSFiles[i].FilePath = prefix + p.FilePath
// }
}
+1 -5
View File
@@ -18,10 +18,6 @@
<link rel="apple-touch-icon" sizes="180x180" href="[[.AppleTouchIcon]]" />
<link rel="mask-icon" href="[[.Assets.ContentDeliveryURL]]public/img/grafana_mask_icon.svg" color="#F05A28" />
[[range $asset := .Assets.CSSFiles]]
<link rel="stylesheet" href="[[$asset.FilePath]]" />
[[end]]
<!-- If theme is "system", we inject the stylesheets with javascript further down the page -->
[[ if eq .ThemeType "light" ]]
<link rel="stylesheet" href="[[.Assets.Light]]" />
@@ -358,7 +354,7 @@
<!-- see pkg/api/webassets/webassets.go -->
[[ if and .IsDevelopmentEnv .FrontendDevServer ]]
<script nonce="[[$.Nonce]]" type="module">
import RefreshRuntime from '[[ .FrontendDevServer ]]/@react-refresh';
import RefreshRuntime from 'http://localhost:5173/@react-refresh';
RefreshRuntime.injectIntoGlobalHook(window);
window.$RefreshReg$ = () => {};
window.$RefreshSig$ = () => (type) => type;
+1 -7
View File
@@ -12,10 +12,6 @@
<title>Grafana API Reference</title>
[[range $asset := .Assets.SwaggerCSSFiles]]
<link rel="stylesheet" href="[[$asset.FilePath]]" />
[[end]]
<link rel="stylesheet" href="[[.Assets.Light]]" />
<link rel="icon" type="image/png" href="[[.FavIcon]]" />
@@ -31,9 +27,7 @@
[[end]]
</script>
<div id="root"></div>
[[range $asset := .Assets.Swagger]]
<script nonce="[[$.Nonce]]" src="[[$asset.FilePath]]" type="text/javascript"></script>
[[end]]
<script></script>
</body>
</html>