attacker
b8cab7ed0f
feat: AIOps智能助手接入真实LLM后端(OpenAI兼容代理+配置持久化)
后端:
- models/llm.go: LLMConfig模型(单行配置)+请求/响应struct
- handlers/llm.go: GetLLMConfig/SaveLLMConfig(脱敏+upsert)/Chat(OpenAI兼容代理)/TestLLMConnection
- routes.go: 注册 /aiops/llm-config(GET/PUT/test)+/aiops/chat(POST)
- database.go: AutoMigrate LLMConfig
- 支持OpenAI/DeepSeek/通义千问/Moonshot/Ollama/自定义6种提供商
- API Key脱敏(仅保留后4位)+回传脱敏值保留原值
- 优雅错误处理(连接超时/401/未配置均返回友好消息)
- 120s超时+AIOps运维助手默认系统提示词
前端:
- AIOpsAssistant.tsx: 全量重写接入真实后端
· 配置弹窗从后端加载(持久化),提供商切换自动填充endpoint/模型
· 启用开关+测试连接按钮+保存反馈
· 真实对话(发送最近10条上下文),思考中spinner,错误红色气泡
· 状态徽章(未配置/在线+模型名),新对话清空
- api.ts: aiApi替代mock aiAssistantApi(getConfig/saveConfig/testConnection/chat)
验证: tsc零错误+build通过+/health正常+前后端联调通过(配置CRUD+API Key脱敏+masked-key保留+chat错误优雅降级) // Logan.Li
2026-06-18 02:12:17 +08:00
..
2026-06-14 22:11:18 +08:00
2026-06-14 21:27:14 +08:00
2026-06-15 14:05:28 +08:00
2026-06-14 22:11:18 +08:00
2026-06-15 14:05:28 +08:00
2026-06-15 14:05:28 +08:00
2026-06-15 10:01:24 +08:00
2026-06-16 01:07:43 +08:00
2026-06-16 01:07:43 +08:00
2026-06-16 01:07:43 +08:00
2026-06-15 10:01:24 +08:00
2026-06-15 01:09:49 +08:00
2026-06-15 10:01:24 +08:00
2026-06-15 01:09:49 +08:00
2026-06-15 17:04:02 +08:00
2026-06-15 17:04:02 +08:00
2026-06-15 01:09:49 +08:00
2026-06-15 01:09:49 +08:00
2026-06-15 01:09:49 +08:00
2026-06-15 10:01:24 +08:00
2026-06-15 03:05:26 +08:00
2026-06-15 13:01:56 +08:00
2026-06-15 01:09:49 +08:00
2026-06-15 01:09:49 +08:00
2026-06-15 01:09:49 +08:00
2026-06-18 02:12:17 +08:00
2026-06-15 01:32:15 +08:00
2026-06-16 01:07:43 +08:00
2026-06-16 01:07:43 +08:00
2026-06-15 15:05:28 +08:00
2026-06-15 15:05:28 +08:00
2026-06-14 20:12:42 +08:00
2026-06-15 13:01:56 +08:00
2026-06-17 08:55:09 +08:00
2026-06-17 08:55:09 +08:00
2026-06-17 08:55:09 +08:00
2026-06-15 13:01:56 +08:00
2026-06-15 01:09:49 +08:00
2026-06-17 08:55:09 +08:00