admin/custom: 'style' section
Massimo Melina committed
May 26, 2024 at 21:50 UTC
6ce00a76cc82aac7c1114f928e8c15575237f422
3 files changed
+3
-2
src/customHtml.ts
+1
-1
@@ -7,7 +7,7 @@ import { mapPlugins } from './plugins'
7
8
const FILE = 'custom.html'
9
10
-export const customHtmlSections: ReadonlyArray<string> = ['beforeHeader', 'afterHeader', 'afterMenuBar', 'afterList',
10
+export const customHtmlSections: ReadonlyArray<string> = ['style', 'beforeHeader', 'afterHeader', 'afterMenuBar', 'afterList',
11
'top', 'bottom', 'afterEntryName', 'beforeLogin', 'unauthorized', 'htmlHead']
12
13
export const customHtmlState = proxy({
src/serveGuiAndSharedFiles.ts
+1
-1
@@ -103,7 +103,7 @@ export const serveGuiAndSharedFiles: Koa.Middleware = async (ctx, next) => {
103
const { authenticate } = ctx.query
104
const downloadManagerDetected = /DAP|FDM|[Mm]anager/.test(ctx.get('user-agent'))
105
if (downloadManagerDetected || authenticate)
106
- return ctx.set('WWW-Authenticate', authenticate || 'Basic') // we support basic authentication
106
+ return ctx.set('WWW-Authenticate', authenticate || 'Basic') // basic authentication for DMs getting the folder as a zip
107
ctx.state.serveApp = true
108
return serveFrontendFiles(ctx, next)
109
}
src/serveGuiFiles.ts
+1
@@ -127,6 +127,7 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
127
${_.map(plugins, (configs, pluginName) => // make plugin configs accessible via css
128
_.map(configs, (v,k) => `--${pluginName}-${k}: ${serializeCss(v)};`).join('\n')).join('')}
129
}
130
+ ${getSection('style')}
131
</style>
132
${isFrontend && mapPlugins((plug,id) =>
133
plug.frontend_css?.map(f =>