feat: Metrix 平台按需启用与数据源合并为外部储存

This commit is contained in:
2026-06-25 17:20:17 +08:00
parent 6a517c98c8
commit 9339453482
8 changed files with 112 additions and 18 deletions
+11
View File
@@ -62,6 +62,17 @@ async def update_remote_config(config: dict[str, Any] = Body(...)):
return {"success": True, "message": "远程数据配置已更新", "update": state.config.update}
@router.post("/api/config/metrix-enabled")
async def update_metrix_enabled(enabled: bool = Body(..., embed=True)):
state.reload_config()
state.config.metrix_enabled = enabled
if not enabled:
state.config.source_type = "external"
state.config.warehouse_type = "mysql"
state.config.save()
return {"success": True, "message": "已更新", "update": state.config.update}
@router.post("/api/config/backend")
async def update_backend(
source_type: str = Body(...),