mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
49d8582658
Refs #2209 #1643 #1787 #2645
28 lines
932 B
Go
28 lines
932 B
Go
package router
|
|
|
|
import (
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type ToolboxRouter struct{}
|
|
|
|
func (s *ToolboxRouter) InitToolboxRouter(Router *gin.RouterGroup) {
|
|
toolboxRouter := Router.Group("toolbox").
|
|
Use(middleware.JwtAuth()).
|
|
Use(middleware.SessionAuth()).
|
|
Use(middleware.PasswordExpired())
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
{
|
|
toolboxRouter.GET("/fail2ban/base", baseApi.LoadFail2BanBaseInfo)
|
|
toolboxRouter.GET("/fail2ban/load/conf", baseApi.LoadFail2BanConf)
|
|
toolboxRouter.POST("/fail2ban/search", baseApi.SearchFail2Ban)
|
|
toolboxRouter.POST("/fail2ban/operate", baseApi.OperateFail2Ban)
|
|
toolboxRouter.POST("/fail2ban/operate/sshd", baseApi.OperateSSHD)
|
|
toolboxRouter.POST("/fail2ban/update", baseApi.UpdateFail2BanConf)
|
|
toolboxRouter.POST("/fail2ban/update/byconf", baseApi.UpdateFail2BanConfByFile)
|
|
}
|
|
}
|