mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core&ui: optimize schema display
This commit is contained in:
1 parent
6f862657dc
commit
b1b933f3d7
4 files changed
+8
-4
No files matched your search
@@ -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">
|
||||
|
||||
Reference in new issue
Block a user