mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add service worker to cache resources (#445)
This commit is contained in:
1 parent
aa5df5346a
commit
fcc4eedd9f
10 files changed
+112
-54
No files matched your search
@@ -161,6 +161,14 @@ class LanguageHandler extends ResourceHandler {
|
||||
}
|
||||
}
|
||||
|
||||
class SWConfigHandler extends ResourceHandler {
|
||||
async get() {
|
||||
this.response.body = {
|
||||
preload: SystemModel.get('ui-default.preload'),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class SystemConfigSchemaHandler extends Handler {
|
||||
async get() {
|
||||
const schema = convert(Schema.intersect(SystemSettings) as any, true);
|
||||
@@ -227,6 +235,7 @@ export function apply(ctx: Context) {
|
||||
ctx.Route('markdown', '/markdown', MarkdownHandler);
|
||||
ctx.Route('config_schema', '/manage/config/schema.json', SystemConfigSchemaHandler, PRIV.PRIV_EDIT_SYSTEM);
|
||||
ctx.Route('lang', '/l/:lang', LanguageHandler);
|
||||
ctx.Route('sw_config', '/sw-config', SWConfigHandler);
|
||||
ctx.Route('media', '/media', RichMediaHandler);
|
||||
ctx.on('app/started', buildUI);
|
||||
ctx.on('app/started', updateLogo);
|
||||
|
||||
Reference in new issue
Block a user