feat: complete Loki query, insights, settings and deployment workflows
Add the Loki query UI, access policies, ingress insights, alert and registry settings, and their backend APIs. Include the related Kubernetes deployment and collector updates required by the integrated application. Validated with go test ./..., npm run build, and npm run lint.
This commit is contained in:
1 parent
f9c6c1d826
commit
2d73661dd1
127 files changed
+8117
-2876
No files matched your search
@@ -34,6 +34,8 @@ func SetupRouter() *gin.Engine {
|
||||
userCtrl := controllers.NewUserController()
|
||||
ldapCtrl := controllers.NewLdapController()
|
||||
logsCtrl := controllers.NewLogsController()
|
||||
alertsCtrl := controllers.NewAlertsController()
|
||||
registryCtrl := controllers.NewImageRegistryController()
|
||||
|
||||
// API v1
|
||||
api := r.Group("/api/v1")
|
||||
@@ -86,6 +88,29 @@ func SetupRouter() *gin.Engine {
|
||||
logs.GET("/health", logsCtrl.Health)
|
||||
}
|
||||
|
||||
// 镜像源(国内加速/海外/私有仓库)
|
||||
authorized.GET("/settings/image-registry", registryCtrl.Get)
|
||||
authorized.PUT("/settings/image-registry", middleware.AdminAuth(), registryCtrl.Save)
|
||||
|
||||
// 告警:飞书通知配置 + 告警规则(参照 opsx-sec)
|
||||
alertNotify := authorized.Group("/alerts")
|
||||
{
|
||||
alertNotify.GET("/notify-config", alertsCtrl.GetNotifyConfig)
|
||||
alertNotify.PUT("/notify-config", middleware.AdminAuth(), alertsCtrl.UpdateNotifyConfig)
|
||||
alertNotify.POST("/notify-config/test", middleware.AdminAuth(), alertsCtrl.TestNotifyConfig)
|
||||
alertNotify.GET("/rules", alertsCtrl.ListRules)
|
||||
alertNotify.POST("/rules", middleware.AdminAuth(), alertsCtrl.CreateRule)
|
||||
alertNotify.PUT("/rules/:id", middleware.AdminAuth(), alertsCtrl.UpdateRule)
|
||||
alertNotify.DELETE("/rules/:id", middleware.AdminAuth(), alertsCtrl.DeleteRule)
|
||||
alertNotify.POST("/check", middleware.AdminAuth(), alertsCtrl.CheckNow)
|
||||
alertNotify.GET("/deliveries", alertsCtrl.Deliveries)
|
||||
alertNotify.GET("/channels", alertsCtrl.ListChannels)
|
||||
alertNotify.POST("/channels", middleware.AdminAuth(), alertsCtrl.SaveChannel)
|
||||
alertNotify.PUT("/channels/:id", middleware.AdminAuth(), alertsCtrl.SaveChannel)
|
||||
alertNotify.DELETE("/channels/:id", middleware.AdminAuth(), alertsCtrl.DeleteChannel)
|
||||
alertNotify.POST("/channels/test", middleware.AdminAuth(), alertsCtrl.TestChannel)
|
||||
}
|
||||
|
||||
// LDAP 配置(admin 读写;查询供用户页判断导入按钮显隐,登录用户即可读)
|
||||
authorized.GET("/settings/ldap", middleware.AdminAuth(), ldapCtrl.GetConfig)
|
||||
authorized.PUT("/settings/ldap", middleware.AdminAuth(), ldapCtrl.UpdateConfig)
|
||||
@@ -113,6 +138,8 @@ func SetupRouter() *gin.Engine {
|
||||
authorized.DELETE("/clusters/:id", clusterCtrl.Delete)
|
||||
authorized.POST("/clusters/:id/validate", clusterCtrl.Validate)
|
||||
authorized.GET("/clusters/:id/info", clusterCtrl.GetInfo)
|
||||
authorized.GET("/clusters/:id/namespaces", clusterCtrl.Namespaces)
|
||||
authorized.GET("/clusters/:id/namespaces/:namespace/deployments", clusterCtrl.Deployments)
|
||||
|
||||
// Hosts
|
||||
authorized.GET("/hosts", hostCtrl.List)
|
||||
@@ -138,6 +165,8 @@ func SetupRouter() *gin.Engine {
|
||||
authorized.GET("/deployments/:id", deploymentCtrl.Get)
|
||||
authorized.POST("/deployments", deploymentCtrl.Create)
|
||||
authorized.PUT("/deployments/:id", deploymentCtrl.Update)
|
||||
authorized.POST("/deployments/:id/retention", deploymentCtrl.UpdateRetention)
|
||||
authorized.GET("/deployments/:id/config", middleware.AdminAuth(), deploymentCtrl.GetLiveConfig)
|
||||
authorized.DELETE("/deployments/:id", deploymentCtrl.Delete)
|
||||
authorized.POST("/deployments/:id/deploy", deploymentCtrl.Deploy)
|
||||
authorized.POST("/deployments/:id/stop", deploymentCtrl.Stop)
|
||||
|
||||
Reference in new issue
Block a user