2024-07-23 14:48:37 +08:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
2024-08-07 13:52:34 +08:00
|
|
|
v2 "github.com/1Panel-dev/1Panel/agent/app/api/v2"
|
2024-07-23 14:48:37 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type WebsiteRouter struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *WebsiteRouter) InitRouter(Router *gin.RouterGroup) {
|
|
|
|
websiteRouter := Router.Group("websites")
|
|
|
|
|
2024-08-07 13:52:34 +08:00
|
|
|
baseApi := v2.ApiGroupApp.BaseApi
|
2024-07-23 14:48:37 +08:00
|
|
|
{
|
|
|
|
websiteRouter.POST("/search", baseApi.PageWebsite)
|
|
|
|
websiteRouter.GET("/list", baseApi.GetWebsites)
|
|
|
|
websiteRouter.POST("", baseApi.CreateWebsite)
|
|
|
|
websiteRouter.POST("/operate", baseApi.OpWebsite)
|
|
|
|
websiteRouter.POST("/log", baseApi.OpWebsiteLog)
|
|
|
|
websiteRouter.POST("/check", baseApi.CreateWebsiteCheck)
|
2024-08-12 17:08:52 +08:00
|
|
|
websiteRouter.POST("/options", baseApi.GetWebsiteOptions)
|
2024-07-23 14:48:37 +08:00
|
|
|
websiteRouter.POST("/update", baseApi.UpdateWebsite)
|
|
|
|
websiteRouter.GET("/:id", baseApi.GetWebsite)
|
|
|
|
websiteRouter.POST("/del", baseApi.DeleteWebsite)
|
|
|
|
websiteRouter.POST("/default/server", baseApi.ChangeDefaultServer)
|
2024-08-19 18:04:43 +08:00
|
|
|
websiteRouter.POST("/group/change", baseApi.ChangeWebsiteGroup)
|
2024-07-23 14:48:37 +08:00
|
|
|
|
|
|
|
websiteRouter.GET("/domains/:websiteId", baseApi.GetWebDomains)
|
|
|
|
websiteRouter.POST("/domains/del", baseApi.DeleteWebDomain)
|
|
|
|
websiteRouter.POST("/domains", baseApi.CreateWebDomain)
|
2024-08-09 17:05:13 +08:00
|
|
|
websiteRouter.POST("/domains/update", baseApi.UpdateWebDomain)
|
2024-07-23 14:48:37 +08:00
|
|
|
|
|
|
|
websiteRouter.GET("/:id/config/:type", baseApi.GetWebsiteNginx)
|
|
|
|
websiteRouter.POST("/config", baseApi.GetNginxConfig)
|
|
|
|
websiteRouter.POST("/config/update", baseApi.UpdateNginxConfig)
|
|
|
|
websiteRouter.POST("/nginx/update", baseApi.UpdateWebsiteNginxConfig)
|
|
|
|
|
|
|
|
websiteRouter.GET("/:id/https", baseApi.GetHTTPSConfig)
|
|
|
|
websiteRouter.POST("/:id/https", baseApi.UpdateHTTPSConfig)
|
|
|
|
|
|
|
|
websiteRouter.POST("/rewrite", baseApi.GetRewriteConfig)
|
|
|
|
websiteRouter.POST("/rewrite/update", baseApi.UpdateRewriteConfig)
|
|
|
|
|
|
|
|
websiteRouter.POST("/dir/update", baseApi.UpdateSiteDir)
|
|
|
|
websiteRouter.POST("/dir/permission", baseApi.UpdateSiteDirPermission)
|
|
|
|
websiteRouter.POST("/dir", baseApi.GetDirConfig)
|
|
|
|
|
|
|
|
websiteRouter.POST("/proxies", baseApi.GetProxyConfig)
|
|
|
|
websiteRouter.POST("/proxies/update", baseApi.UpdateProxyConfig)
|
|
|
|
websiteRouter.POST("/proxies/file", baseApi.UpdateProxyConfigFile)
|
2024-09-12 18:06:22 +08:00
|
|
|
websiteRouter.POST("/proxy/config", baseApi.UpdateProxyCache)
|
|
|
|
websiteRouter.GET("/proxy/config/:id", baseApi.GetProxyCache)
|
2024-07-23 14:48:37 +08:00
|
|
|
|
|
|
|
websiteRouter.POST("/auths", baseApi.GetAuthConfig)
|
|
|
|
websiteRouter.POST("/auths/update", baseApi.UpdateAuthConfig)
|
2024-08-09 18:00:39 +08:00
|
|
|
websiteRouter.POST("/auths/path", baseApi.GetPathAuthConfig)
|
|
|
|
websiteRouter.POST("/auths/path/update", baseApi.UpdatePathAuthConfig)
|
2024-07-23 14:48:37 +08:00
|
|
|
|
|
|
|
websiteRouter.POST("/leech", baseApi.GetAntiLeech)
|
|
|
|
websiteRouter.POST("/leech/update", baseApi.UpdateAntiLeech)
|
|
|
|
|
|
|
|
websiteRouter.POST("/redirect/update", baseApi.UpdateRedirectConfig)
|
|
|
|
websiteRouter.POST("/redirect", baseApi.GetRedirectConfig)
|
|
|
|
websiteRouter.POST("/redirect/file", baseApi.UpdateRedirectConfigFile)
|
|
|
|
|
|
|
|
websiteRouter.GET("/default/html/:type", baseApi.GetDefaultHtml)
|
|
|
|
websiteRouter.POST("/default/html/update", baseApi.UpdateDefaultHtml)
|
2024-08-15 23:15:29 +08:00
|
|
|
|
|
|
|
websiteRouter.GET("/:id/lbs", baseApi.GetLoadBalances)
|
|
|
|
websiteRouter.POST("/lbs/create", baseApi.CreateLoadBalance)
|
|
|
|
websiteRouter.POST("/lbs/del", baseApi.DeleteLoadBalance)
|
2024-08-16 18:09:00 +08:00
|
|
|
websiteRouter.POST("/lbs/update", baseApi.UpdateLoadBalance)
|
|
|
|
websiteRouter.POST("/lbs/file", baseApi.UpdateLoadBalanceFile)
|
2024-09-11 16:20:15 +08:00
|
|
|
|
|
|
|
websiteRouter.POST("/php/version", baseApi.ChangePHPVersion)
|
2024-09-13 18:42:27 +08:00
|
|
|
|
|
|
|
websiteRouter.POST("/realip/config", baseApi.SetRealIPConfig)
|
|
|
|
websiteRouter.GET("/realip/config/:id", baseApi.GetRealIPConfig)
|
2024-07-23 14:48:37 +08:00
|
|
|
}
|
|
|
|
}
|