core&ui: add dark theme support to manage_config

This commit is contained in:
undefined committed 2025-06-08 23:07:05 +08:00
1 parent 2305e168f0
commit b70b685b01
5 files changed
+36 -18

No files matched your search

+5 -8
View File
@@ -182,7 +182,7 @@ class SystemConfigHandler extends SystemHandler {
@requireSudo
async get() {
this.response.template = 'manage_config.html';
let value;
let value = this.ctx.setting.configSource;
const processNode = (node: any, schema: Schema<any, any>, parent?: any, accessKey?: string) => {
if (['union', 'intersect'].includes(schema.type)) {
@@ -198,16 +198,13 @@ class SystemConfigHandler extends SystemHandler {
};
try {
try {
value = Schema.intersect(this.ctx.setting.settings)(yaml.load(this.ctx.setting.configSource));
} catch (e) {
value = yaml.load(this.ctx.setting.configSource);
}
for (const schema of this.ctx.setting.settings) processNode(value, schema);
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) { }
this.response.body = {
schema: Schema.intersect(this.ctx.setting.settings).toJSON(),
value: yaml.dump(value),
value,
};
}