feat: Zabbix 数据源管理 — 完整 CRUD + 双 Tab 数据源页面

后端:
- models/zabbix_datasource.go: Zabbix 数据源 model (15字段, 参照 Grafana)
- handlers/zabbix_datasource.go: CRUD + 测试连接 (调用 Zabbix API Auth)
- routes.go: /zabbix-datasources 路由组
- database.go: AutoMigrate

前端:
- api.ts: zabbixDatasourceApi
- ZabbixDatasourceManager.tsx: 表单 (URL/用户名/密码/Trends设置/DB直连)
- DatasourcePage.tsx: Prometheus + Zabbix 双 Tab 包装
- App.tsx: /datasources 路由更新
This commit is contained in:
attacker committed 2026-06-18 14:14:40 +00:00
1 parent d2201fc8c0
commit c51d0b8b8b
8 files changed
+761 -2

No files matched your search

+11
View File
@@ -695,6 +695,17 @@ export const promDatasourceApi = {
testConnection: (data: any) => http.post('/prometheus-datasources/test', data),
};
// ==================== Zabbix 数据源管理 API ==================== // Logan.Li
export const zabbixDatasourceApi = {
list: () => http.get('/zabbix-datasources'),
get: (id: number | string) => http.get(`/zabbix-datasources/${id}`),
create: (data: any) => http.post('/zabbix-datasources', data),
update: (id: number | string, data: any) => http.put(`/zabbix-datasources/${id}`, data),
delete: (id: number | string) => http.delete(`/zabbix-datasources/${id}`),
setDefault: (id: number | string) => http.post(`/zabbix-datasources/${id}/default`),
testConnection: (data: any) => http.post('/zabbix-datasources/test', data),
};
// AI 智能助手 API(后端 LLM 配置 + 对话代理,OpenAI 兼容) // Logan.Li
export interface LLMConfigData {
configured?: boolean;