ui: fix theme load

This commit is contained in:
undefined committed 2022-02-22 01:04:59 +08:00
1 parent c54c7151ff
commit 9b8833453c
3 files changed
+5 -2

No files matched your search

+3
View File
@@ -90,6 +90,9 @@ async function main() {
if (fs.existsSync('public/hydro.js')) { if (fs.existsSync('public/hydro.js')) {
fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`); fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`);
} }
if (fs.existsSync('public/default.theme.css')) {
fs.copyFileSync('public/default.theme.css', `public/default-${pkg.version}.theme.js`);
}
if (argv.options.production) { if (argv.options.production) {
fs.removeSync('public/vditor/dist/js/mathjax'); fs.removeSync('public/vditor/dist/js/mathjax');
fs.removeSync('public/vditor/dist/js/echarts'); fs.removeSync('public/vditor/dist/js/echarts');
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.32.1", "version": "4.32.2",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",
@@ -34,7 +34,7 @@
{% if process.env.DEV %} {% if process.env.DEV %}
<link rel="stylesheet" media="all" href="/default.theme.css"> <link rel="stylesheet" media="all" href="/default.theme.css">
{% else %} {% else %}
<link rel="stylesheet" media="all" href="{{ static_url((handler.user|default({})).theme|default('default') + '.theme-' + global.Hydro.version['ui-default'] +'.css') }}"> <link rel="stylesheet" media="all" href="{{ static_url((handler.user|default({})).theme|default('default') + '-' + global.Hydro.version['ui-default'] +'.theme.css') }}">
{% endif %} {% endif %}
{% if not isIE(handler.request.headers['user-agent']) %} {% if not isIE(handler.request.headers['user-agent']) %}
<script> <script>