core&ui: optimize schema display

This commit is contained in:
undefined committed 2022-09-04 16:50:36 +08:00
1 parent 6f862657dc
commit b1b933f3d7
4 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.16.9", "version": "3.16.10",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+5 -1
View File
@@ -186,9 +186,13 @@ class SystemSettingHandler extends SystemHandler {
class SystemConfigHandler extends SystemHandler { class SystemConfigHandler extends SystemHandler {
async get() { async get() {
this.response.template = 'manage_config.html'; this.response.template = 'manage_config.html';
let value = configSource;
try {
value = yaml.dump(Schema.intersect(SystemSettings)(yaml.load(configSource)));
} catch (e) { }
this.response.body = { this.response.body = {
schema: Schema.intersect(SystemSettings).toJSON(), schema: Schema.intersect(SystemSettings).toJSON(),
value: configSource, value,
}; };
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.39.23", "version": "4.39.24",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",
@@ -11,7 +11,7 @@
<textarea id="config" data-yaml data-model="hydro://system/setting.yaml" placeholder="" class="textbox">{{ value }}</textarea> <textarea id="config" data-yaml data-model="hydro://system/setting.yaml" placeholder="" class="textbox">{{ value }}</textarea>
</div> </div>
</label> </label>
<p class="help-text" id="info"></p> <pre class="help-text" id="info"></pre>
</div> </div>
</div> </div>
<div class="row"> <div class="row">