2022-10-28 09:04:57 +00: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 14:44:09 +00:00
|
|
|
func (a *WebsiteRouter) InitRouter(Router *gin.RouterGroup) {
|
2022-10-28 09:04:57 +00:00
|
|
|
groupRouter := Router.Group("websites")
|
2023-03-11 09:51:42 +00:00
|
|
|
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
2022-10-28 09:04:57 +00:00
|
|
|
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2022-12-13 09:20:13 +00:00
|
|
|
groupRouter.POST("/search", baseApi.PageWebsite)
|
2023-01-03 08:56:36 +00:00
|
|
|
groupRouter.GET("/list", baseApi.GetWebsites)
|
2022-10-28 09:04:57 +00:00
|
|
|
groupRouter.POST("", baseApi.CreateWebsite)
|
2022-12-26 08:09:21 +00:00
|
|
|
groupRouter.POST("/operate", baseApi.OpWebsite)
|
2022-12-30 09:39:17 +00:00
|
|
|
groupRouter.POST("/log", baseApi.OpWebsiteLog)
|
2022-12-04 09:45:54 +00:00
|
|
|
groupRouter.POST("/check", baseApi.CreateWebsiteCheck)
|
2022-11-30 07:47:11 +00:00
|
|
|
groupRouter.GET("/options", baseApi.GetWebsiteOptions)
|
2022-12-13 09:20:13 +00:00
|
|
|
groupRouter.POST("/update", baseApi.UpdateWebsite)
|
|
|
|
groupRouter.GET("/:id", baseApi.GetWebsite)
|
|
|
|
groupRouter.POST("/del", baseApi.DeleteWebsite)
|
2023-01-05 03:57:03 +00:00
|
|
|
groupRouter.POST("/default/server", baseApi.ChangeDefaultServer)
|
2022-12-13 09:20:13 +00:00
|
|
|
|
2022-11-03 09:06:48 +00:00
|
|
|
groupRouter.GET("/domains/:websiteId", baseApi.GetWebDomains)
|
2022-12-13 09:20:13 +00:00
|
|
|
groupRouter.POST("/domains/del", baseApi.DeleteWebDomain)
|
2022-11-03 10:02:07 +00:00
|
|
|
groupRouter.POST("/domains", baseApi.CreateWebDomain)
|
2022-12-13 09:20:13 +00:00
|
|
|
|
2023-04-04 10:54:04 +00:00
|
|
|
groupRouter.GET("/:id/config/:type", baseApi.GetWebsiteNginx)
|
2022-11-07 08:19:05 +00:00
|
|
|
groupRouter.POST("/config", baseApi.GetNginxConfig)
|
|
|
|
groupRouter.POST("/config/update", baseApi.UpdateNginxConfig)
|
2023-01-05 03:57:03 +00:00
|
|
|
groupRouter.POST("/nginx/update", baseApi.UpdateWebsiteNginxConfig)
|
|
|
|
|
2022-11-20 10:32:56 +00:00
|
|
|
groupRouter.GET("/:id/https", baseApi.GetHTTPSConfig)
|
|
|
|
groupRouter.POST("/:id/https", baseApi.UpdateHTTPSConfig)
|
2023-01-05 03:57:03 +00:00
|
|
|
|
2023-04-05 16:09:58 +00:00
|
|
|
groupRouter.GET("/php/config/:id", baseApi.GetWebsitePHPConfig)
|
|
|
|
groupRouter.POST("/php/config", baseApi.UpdateWebsitePHPConfig)
|
2023-04-12 06:48:30 +00:00
|
|
|
groupRouter.POST("/php/update", baseApi.UpdatePHPFile)
|
2023-07-25 09:20:25 +00:00
|
|
|
groupRouter.POST("/php/version", baseApi.ChangePHPVersion)
|
2023-04-14 08:01:06 +00:00
|
|
|
|
|
|
|
groupRouter.POST("/rewrite", baseApi.GetRewriteConfig)
|
|
|
|
groupRouter.POST("/rewrite/update", baseApi.UpdateRewriteConfig)
|
2023-04-17 08:54:34 +00:00
|
|
|
|
|
|
|
groupRouter.POST("/dir/update", baseApi.UpdateSiteDir)
|
2023-04-18 10:46:58 +00:00
|
|
|
groupRouter.POST("/dir/permission", baseApi.UpdateSiteDirPermission)
|
2023-09-05 14:28:11 +00:00
|
|
|
groupRouter.POST("/dir", baseApi.GetDirConfig)
|
2023-04-23 10:15:38 +00:00
|
|
|
|
|
|
|
groupRouter.POST("/proxies", baseApi.GetProxyConfig)
|
|
|
|
groupRouter.POST("/proxies/update", baseApi.UpdateProxyConfig)
|
2023-04-24 09:48:22 +00:00
|
|
|
groupRouter.POST("/proxies/file", baseApi.UpdateProxyConfigFile)
|
2023-04-25 10:10:17 +00:00
|
|
|
|
|
|
|
groupRouter.POST("/auths", baseApi.GetAuthConfig)
|
|
|
|
groupRouter.POST("/auths/update", baseApi.UpdateAuthConfig)
|
2023-05-26 02:40:21 +00:00
|
|
|
|
|
|
|
groupRouter.POST("/leech", baseApi.GetAntiLeech)
|
|
|
|
groupRouter.POST("/leech/update", baseApi.UpdateAntiLeech)
|
2023-07-22 14:02:21 +00:00
|
|
|
|
|
|
|
groupRouter.POST("/redirect/update", baseApi.UpdateRedirectConfig)
|
|
|
|
groupRouter.POST("/redirect", baseApi.GetRedirectConfig)
|
|
|
|
groupRouter.POST("/redirect/file", baseApi.UpdateRedirectConfigFile)
|
2022-10-28 09:04:57 +00:00
|
|
|
}
|
|
|
|
}
|