2022-08-16 15:30:23 +00:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
2022-10-17 08:32:31 +00:00
|
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
2022-08-16 15:30:23 +00:00
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
2022-11-15 09:20:57 +00:00
|
|
|
type LogRouter struct{}
|
2022-08-16 15:30:23 +00:00
|
|
|
|
2023-12-20 14:44:09 +00:00
|
|
|
func (s *LogRouter) InitRouter(Router *gin.RouterGroup) {
|
2022-11-15 09:20:57 +00:00
|
|
|
operationRouter := Router.Group("logs")
|
2022-09-29 08:15:59 +00:00
|
|
|
operationRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
2022-08-16 15:30:23 +00:00
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2023-01-04 14:31:51 +00:00
|
|
|
operationRouter.POST("/login", baseApi.GetLoginLogs)
|
|
|
|
operationRouter.POST("/operation", baseApi.GetOperationLogs)
|
|
|
|
operationRouter.POST("/clean", baseApi.CleanLogs)
|
2023-09-20 08:24:26 +00:00
|
|
|
operationRouter.GET("/system/files", baseApi.GetSystemFiles)
|
|
|
|
operationRouter.POST("/system", baseApi.GetSystemLogs)
|
2022-08-16 15:30:23 +00:00
|
|
|
}
|
|
|
|
}
|