2024-08-19 18:04:43 +08:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
|
|
|
v2 "github.com/1Panel-dev/1Panel/core/app/api/v2"
|
2024-12-19 22:21:00 +08:00
|
|
|
"github.com/1Panel-dev/1Panel/core/middleware"
|
2024-08-19 18:04:43 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type HostRouter struct{}
|
|
|
|
|
|
|
|
func (s *HostRouter) InitRouter(Router *gin.RouterGroup) {
|
2024-12-19 22:21:00 +08:00
|
|
|
hostRouter := Router.Group("hosts").
|
|
|
|
Use(middleware.JwtAuth()).
|
|
|
|
Use(middleware.SessionAuth()).
|
|
|
|
Use(middleware.PasswordExpired())
|
2024-08-19 18:04:43 +08:00
|
|
|
baseApi := v2.ApiGroupApp.BaseApi
|
|
|
|
{
|
|
|
|
hostRouter.POST("", baseApi.CreateHost)
|
|
|
|
hostRouter.POST("/del", baseApi.DeleteHost)
|
|
|
|
hostRouter.POST("/update", baseApi.UpdateHost)
|
|
|
|
hostRouter.POST("/update/group", baseApi.UpdateHostGroup)
|
|
|
|
hostRouter.POST("/search", baseApi.SearchHost)
|
|
|
|
hostRouter.POST("/tree", baseApi.HostTree)
|
|
|
|
hostRouter.POST("/test/byinfo", baseApi.TestByInfo)
|
|
|
|
hostRouter.POST("/test/byid/:id", baseApi.TestByID)
|
|
|
|
|
|
|
|
hostRouter.GET("/terminal", baseApi.WsSsh)
|
|
|
|
}
|
|
|
|
}
|