core&ui: optimize schema display

pull/421/head
undefined 2 years ago
parent 6f862657dc
commit b1b933f3d7

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.16.9",
"version": "3.16.10",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",

@ -186,9 +186,13 @@ class SystemSettingHandler extends SystemHandler {
class SystemConfigHandler extends SystemHandler {
async get() {
this.response.template = 'manage_config.html';
let value = configSource;
try {
value = yaml.dump(Schema.intersect(SystemSettings)(yaml.load(configSource)));
} catch (e) { }
this.response.body = {
schema: Schema.intersect(SystemSettings).toJSON(),
value: configSource,
value,
};
}

@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.39.23",
"version": "4.39.24",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",

@ -11,7 +11,7 @@
<textarea id="config" data-yaml data-model="hydro://system/setting.yaml" placeholder="" class="textbox">{{ value }}</textarea>
</div>
</label>
<p class="help-text" id="info"></p>
<pre class="help-text" id="info"></pre>
</div>
</div>
<div class="row">

Loading…
Cancel
Save