mirror of https://github.com/1Panel-dev/1Panel
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.4 KiB
37 lines
1.4 KiB
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("/device/base", baseApi.LoadDeviceBaseInfo)
|
|
toolboxRouter.GET("/device/zone/options", baseApi.LoadTimeOption)
|
|
toolboxRouter.POST("/device/update/conf", baseApi.UpdateDeviceConf)
|
|
toolboxRouter.POST("/device/update/host", baseApi.UpdateDeviceHost)
|
|
toolboxRouter.POST("/device/update/passwd", baseApi.UpdateDevicPasswd)
|
|
toolboxRouter.POST("/device/update/byconf", baseApi.UpdateDevicByFile)
|
|
toolboxRouter.POST("/device/check/dns", baseApi.CheckDNS)
|
|
toolboxRouter.POST("/device/conf", baseApi.LoadDeviceConf)
|
|
|
|
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)
|
|
}
|
|
}
|