feat: 引入 vjsf 渲染表单

This commit is contained in:
Junyan Qin
2024-10-15 16:16:39 +08:00
parent 661fdeb6a1
commit 12f1f3609d
20 changed files with 618 additions and 1293 deletions
+3 -1
View File
@@ -3,6 +3,7 @@ from __future__ import annotations
from .. import stage, app
from ..bootutils import config
from ...config import settings as settings_mgr
from ...utils import schema
@stage.stage_class("LoadConfigStage")
@@ -50,7 +51,8 @@ class LoadConfigStage(stage.BootingStage):
ap.settings_mgr.register_manager(
name="system.json",
description="系统配置",
manager=ap.system_cfg
manager=ap.system_cfg,
schema=schema.CONFIG_SYSTEM_SCHEMA
)
ap.plugin_setting_meta = await config.load_json_config("plugins/plugins.json", "templates/plugin-settings.json")
+10
View File
@@ -0,0 +1,10 @@
import os
import json
def load_schema(schema_path: str) -> dict:
with open(schema_path, 'r', encoding='utf-8') as f:
return json.load(f)
CONFIG_SYSTEM_SCHEMA = load_schema("templates/schema/system.json")