attacker
|
5949ec5d0c
|
feat: Agent采集uptime, 后端持久化kernel/uptime/diskIO, 前端磁盘BPS+IOPS展示
- Agent: system.go 添加 readUptime(), SystemStat 携带 Uptime
- Backend: Server 模型新增 Kernel 字段, ReceiveReport 持久化 kernel+uptime
- Backend: /agent/latest 返回 kernel/uptime/port_info/disk_io_info/disk_total
- Frontend: 磁盘监控改为 BPS+IOPS (4张卡片), 系统信息修复内核/运行时长/监听端口/磁盘容量
- 图表单位从 MB/s 改为 KB/s, 添加 formatBPS 工具函数
|
2026-06-19 01:10:00 +00:00 |
|
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 |
|