2022-10-28 17:04:57 +08:00
|
|
|
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 WebsiteRouter struct {
|
|
|
|
}
|
|
|
|
|
2023-12-20 22:44:09 +08:00
|
|
|
func (a *WebsiteRouter) InitRouter(Router *gin.RouterGroup) {
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter := Router.Group("websites")
|
|
|
|
websiteRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
2022-10-28 17:04:57 +08:00
|
|
|
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2024-06-19 10:17:36 +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)
|
|
|
|
websiteRouter.GET("/options", baseApi.GetWebsiteOptions)
|
|
|
|
websiteRouter.POST("/update", baseApi.UpdateWebsite)
|
|
|
|
websiteRouter.GET("/:id", baseApi.GetWebsite)
|
|
|
|
websiteRouter.POST("/del", baseApi.DeleteWebsite)
|
|
|
|
websiteRouter.POST("/default/server", baseApi.ChangeDefaultServer)
|
2022-12-13 17:20:13 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter.GET("/domains/:websiteId", baseApi.GetWebDomains)
|
|
|
|
websiteRouter.POST("/domains/del", baseApi.DeleteWebDomain)
|
|
|
|
websiteRouter.POST("/domains", baseApi.CreateWebDomain)
|
2022-12-13 17:20:13 +08:00
|
|
|
|
2024-06-19 10:17:36 +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)
|
2023-01-05 11:57:03 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter.GET("/:id/https", baseApi.GetHTTPSConfig)
|
|
|
|
websiteRouter.POST("/:id/https", baseApi.UpdateHTTPSConfig)
|
2023-01-05 11:57:03 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter.GET("/php/config/:id", baseApi.GetWebsitePHPConfig)
|
|
|
|
websiteRouter.POST("/php/config", baseApi.UpdateWebsitePHPConfig)
|
|
|
|
websiteRouter.POST("/php/update", baseApi.UpdatePHPFile)
|
|
|
|
websiteRouter.POST("/php/version", baseApi.ChangePHPVersion)
|
2023-04-14 16:01:06 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter.POST("/rewrite", baseApi.GetRewriteConfig)
|
|
|
|
websiteRouter.POST("/rewrite/update", baseApi.UpdateRewriteConfig)
|
2023-04-17 16:54:34 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter.POST("/dir/update", baseApi.UpdateSiteDir)
|
|
|
|
websiteRouter.POST("/dir/permission", baseApi.UpdateSiteDirPermission)
|
|
|
|
websiteRouter.POST("/dir", baseApi.GetDirConfig)
|
2023-04-23 18:15:38 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter.POST("/proxies", baseApi.GetProxyConfig)
|
|
|
|
websiteRouter.POST("/proxies/update", baseApi.UpdateProxyConfig)
|
|
|
|
websiteRouter.POST("/proxies/file", baseApi.UpdateProxyConfigFile)
|
2023-04-25 18:10:17 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter.POST("/auths", baseApi.GetAuthConfig)
|
|
|
|
websiteRouter.POST("/auths/update", baseApi.UpdateAuthConfig)
|
2023-05-26 10:40:21 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
websiteRouter.POST("/leech", baseApi.GetAntiLeech)
|
|
|
|
websiteRouter.POST("/leech/update", baseApi.UpdateAntiLeech)
|
2023-07-22 22:02:21 +08:00
|
|
|
|
2024-06-19 10:17:36 +08:00
|
|
|
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)
|
2022-10-28 17:04:57 +08:00
|
|
|
}
|
|
|
|
}
|