mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-12 08:46:02 +00:00
perf: 使用 json-editor-vue 作为json编辑器
This commit is contained in:
@@ -38,7 +38,8 @@ class SettingsRouterGroup(group.RouterGroup):
|
||||
"description": manager.description,
|
||||
"schema": manager.schema,
|
||||
"file": manager.file.config_file_name,
|
||||
"data": manager.data
|
||||
"data": manager.data,
|
||||
"doc_link": manager.doc_link
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -24,6 +24,9 @@ class ConfigManager:
|
||||
data: dict = None
|
||||
"""配置数据"""
|
||||
|
||||
doc_link: str = None
|
||||
"""配置文件文档链接"""
|
||||
|
||||
def __init__(self, cfg_file: file_model.ConfigFile) -> None:
|
||||
self.file = cfg_file
|
||||
self.data = {}
|
||||
|
||||
@@ -27,6 +27,7 @@ class SettingsManager:
|
||||
description: str,
|
||||
manager: config_manager.ConfigManager,
|
||||
schema: dict=None,
|
||||
doc_link: str=None,
|
||||
) -> None:
|
||||
"""注册配置管理器
|
||||
|
||||
@@ -44,6 +45,7 @@ class SettingsManager:
|
||||
manager.name = name
|
||||
manager.description = description
|
||||
manager.schema = schema
|
||||
manager.doc_link = doc_link
|
||||
self.managers.append(manager)
|
||||
|
||||
def get_manager(self, name: str) -> config_manager.ConfigManager | None:
|
||||
|
||||
@@ -28,35 +28,40 @@ class LoadConfigStage(stage.BootingStage):
|
||||
name="command.json",
|
||||
description="命令配置",
|
||||
manager=ap.command_cfg,
|
||||
schema=schema.CONFIG_COMMAND_SCHEMA
|
||||
schema=schema.CONFIG_COMMAND_SCHEMA,
|
||||
doc_link="https://qchatgpt.rockchin.top/config/function/command.html"
|
||||
)
|
||||
|
||||
ap.settings_mgr.register_manager(
|
||||
name="pipeline.json",
|
||||
description="消息处理流水线配置",
|
||||
manager=ap.pipeline_cfg,
|
||||
schema=schema.CONFIG_PIPELINE_SCHEMA
|
||||
schema=schema.CONFIG_PIPELINE_SCHEMA,
|
||||
doc_link="https://qchatgpt.rockchin.top/config/function/pipeline.html"
|
||||
)
|
||||
|
||||
ap.settings_mgr.register_manager(
|
||||
name="platform.json",
|
||||
description="消息平台配置",
|
||||
manager=ap.platform_cfg,
|
||||
schema=schema.CONFIG_PLATFORM_SCHEMA
|
||||
schema=schema.CONFIG_PLATFORM_SCHEMA,
|
||||
doc_link="https://qchatgpt.rockchin.top/config/function/platform.html"
|
||||
)
|
||||
|
||||
ap.settings_mgr.register_manager(
|
||||
name="provider.json",
|
||||
description="大模型能力配置",
|
||||
manager=ap.provider_cfg,
|
||||
schema=schema.CONFIG_PROVIDER_SCHEMA
|
||||
schema=schema.CONFIG_PROVIDER_SCHEMA,
|
||||
doc_link="https://qchatgpt.rockchin.top/config/function/provider.html"
|
||||
)
|
||||
|
||||
ap.settings_mgr.register_manager(
|
||||
name="system.json",
|
||||
description="系统配置",
|
||||
manager=ap.system_cfg,
|
||||
schema=schema.CONFIG_SYSTEM_SCHEMA
|
||||
schema=schema.CONFIG_SYSTEM_SCHEMA,
|
||||
doc_link="https://qchatgpt.rockchin.top/config/function/system.html"
|
||||
)
|
||||
|
||||
ap.plugin_setting_meta = await config.load_json_config("plugins/plugins.json", "templates/plugin-settings.json")
|
||||
|
||||
Reference in New Issue
Block a user