feat: 完善堡垒机与 Agent 智能运维能力

- 支持 Windows Agent 构建、安装脚本和统一上报协议

- 增强 RDP 剪贴板、虚拟盘和文件传输能力

- 新增 AIOps 上下文工具、告警 RCA trace 落库和回放接口

- 重构 docs 模块文档并补充终端、堡垒机、监控、AI Agent 设计
This commit is contained in:
Logan.Li committed 2026-07-05 23:49:36 +08:00
1 parent a9513c2056
commit e0d652d211
169 files changed
+12192 -9116

No files matched your search

+7 -3
View File
@@ -17,9 +17,10 @@ type agentStaticPaths struct {
}
var agentBinaryFiles = map[string]string{
"linux-amd64": "aiops-agent-linux-amd64",
"linux-arm64": "aiops-agent-linux-arm64",
"darwin-arm64": "aiops-agent-darwin-arm64",
"linux-amd64": "aiops-agent-linux-amd64",
"linux-arm64": "aiops-agent-linux-arm64",
"darwin-arm64": "aiops-agent-darwin-arm64",
"windows-amd64": "aiops-agent-windows-amd64.exe",
}
// registerAgentDownloads 注册 Agent 安装脚本和二进制下载路由,避免维护 backend/agent 重复目录。 // Logan.Li
@@ -39,6 +40,9 @@ func registerAgentDownloads(r *gin.Engine, log *zap.Logger) {
r.GET("/agent/install.sh", func(c *gin.Context) {
serveAgentStaticFile(c, paths.deployDir, "install.sh")
})
r.GET("/agent/install.ps1", func(c *gin.Context) {
serveAgentStaticFile(c, paths.deployDir, "install.ps1")
})
for _, fileName := range agentBinaryFiles {
name := fileName
r.GET("/agent/"+name, func(c *gin.Context) {
+9 -9
View File
@@ -125,9 +125,8 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
api.POST("/auth/login", authHandler.Login)
api.POST("/auth/register", authHandler.Register)
// RDP 暂存文件拉取(token 鉴权,供 Windows iwr 回退下载)// Logan.Li
rdpFilePublic := controller.NewRDPFileHandler(db, cfg.JWT.Secret)
api.GET("/rdp-staged/:token", rdpFilePublic.ServeStaged)
// RDPDR Download 捕获文件拉取(token 鉴权)。// Logan.Li
api.GET("/rdp-staged/:token", controller.ServeRDPStaged)
// Webhook 触发路由(无需 JWT,由 Webhook Token 签名验证)
pipelineHandler := controller.NewPipelineHandler(db, redisCache, ti)
@@ -262,12 +261,6 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
servers.DELETE("/:id/files", sftpHandler.DeleteFile)
servers.POST("/:id/files/mkdir", sftpHandler.Mkdir)
// RDP 虚拟 Download 盘(SMB 管理共享,一键上传下载)// Logan.Li
rdpFileHandler := controller.NewRDPFileHandler(db, cfg.JWT.Secret)
servers.GET("/:id/rdp-files", rdpFileHandler.ListFiles)
servers.POST("/:id/rdp-files/upload", rdpFileHandler.UploadFile)
servers.GET("/:id/rdp-files/download", rdpFileHandler.DownloadFile)
servers.POST("/:id/rdp-files/stage", rdpFileHandler.StageUpload)
}
// 云账单处理器(云账号同步账单路由共用) // Logan.Li
@@ -941,6 +934,8 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
// AI 智能助手 - LLM 配置 + 对话代理(OpenAI 兼容) // Logan.Li
llmHandler := controller.NewLLMHandler(db)
aiopsContextHandler := controller.NewAIOpsContextHandler(db)
aiopsAlertAnalysisHandler := controller.NewAIOpsAlertAnalysisHandler(db)
aiopsGroup := authorized.Group("/aiops")
{
aiopsGroup.GET("/llm-config", llmHandler.GetLLMConfig)
@@ -950,6 +945,11 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
aiopsGroup.POST("/chat/stream", llmHandler.ChatStream)
aiopsGroup.GET("/chat-history", llmHandler.GetChatHistory)
aiopsGroup.DELETE("/chat-history", llmHandler.ClearChatHistory)
aiopsGroup.GET("/context/summary", aiopsContextHandler.Summary)
aiopsGroup.POST("/context/pack", aiopsContextHandler.BuildPack)
aiopsGroup.POST("/alert-analysis", aiopsAlertAnalysisHandler.Analyze)
aiopsGroup.GET("/analysis-traces", aiopsAlertAnalysisHandler.ListAnalysisTraces)
aiopsGroup.GET("/analysis-traces/:trace_id", aiopsAlertAnalysisHandler.GetAnalysisTrace)
}
// 指标浏览器 — 监控指标元数据 + 时序查询 // Logan.Li