mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: optimize service worker cache load
This commit is contained in:
8 files changed
+34
-23
No files matched your search
@@ -177,6 +177,7 @@ class SystemConfigHandler extends SystemHandler {
|
||||
let value = this.ctx.setting.configSource;
|
||||
|
||||
const processNode = (node: any, schema: Schema<any, any>, parent?: any, accessKey?: string) => {
|
||||
if (!node) return;
|
||||
if (['union', 'intersect'].includes(schema.type)) {
|
||||
for (const item of schema.list) processNode(node, item, parent, accessKey);
|
||||
}
|
||||
@@ -193,7 +194,9 @@ class SystemConfigHandler extends SystemHandler {
|
||||
const temp = yaml.load(this.ctx.setting.configSource);
|
||||
for (const schema of this.ctx.setting.settings) processNode(temp, schema);
|
||||
value = yaml.dump(temp);
|
||||
} catch (e) { }
|
||||
} catch (e) {
|
||||
logger.error('Failed to process config', e.message);
|
||||
}
|
||||
this.response.body = {
|
||||
schema: Schema.intersect(this.ctx.setting.settings).toJSON(),
|
||||
value,
|
||||
|
||||
Reference in new issue
Block a user