feat: 后台添加大模型配置管理页面

- 新增 /admin/llm_config 页面
- 支持配置API地址、Key、模型名称、参数
- 支持测试连接和恢复默认配置
- 配置保存到数据库,翻译服务动态读取
- 所有后台页面侧边栏添加入口
This commit is contained in:
2026-04-10 18:42:20 +08:00
parent 801dd1e29b
commit 7fede0212b
16 changed files with 318 additions and 1 deletions

View File

@@ -274,6 +274,13 @@ class TranslationTask:
# 启动翻译线程
def run_translation():
# 动态获取LLM配置
if app:
with app.app_context():
from admin import get_llm_config
llm_config = get_llm_config()
config['LLM_CONFIG'] = llm_config
service = TranslationService(config)
task['status'] = 'processing'
task['started_at'] = datetime.now().isoformat()