2022-10-08 10:32:02 +00:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
2022-10-18 10:39:45 +00:00
|
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
2022-10-08 10:32:02 +00:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ContainerRouter struct{}
|
|
|
|
|
2023-12-20 14:44:09 +00:00
|
|
|
func (s *ContainerRouter) InitRouter(Router *gin.RouterGroup) {
|
2022-10-08 10:32:02 +00:00
|
|
|
baRouter := Router.Group("containers").
|
|
|
|
Use(middleware.JwtAuth()).
|
|
|
|
Use(middleware.SessionAuth()).
|
|
|
|
Use(middleware.PasswordExpired())
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2023-02-24 10:50:35 +00:00
|
|
|
baRouter.GET("/exec", baseApi.ContainerWsSsh)
|
2022-11-16 10:27:22 +00:00
|
|
|
baRouter.GET("/stats/:id", baseApi.ContainerStats)
|
2022-10-18 10:39:45 +00:00
|
|
|
|
2022-12-13 10:54:28 +00:00
|
|
|
baRouter.POST("", baseApi.ContainerCreate)
|
2023-06-15 03:00:11 +00:00
|
|
|
baRouter.POST("/update", baseApi.ContainerUpdate)
|
2023-06-16 09:54:11 +00:00
|
|
|
baRouter.POST("/upgrade", baseApi.ContainerUpgrade)
|
2023-06-15 03:00:11 +00:00
|
|
|
baRouter.POST("/info", baseApi.ContainerInfo)
|
2022-10-08 10:32:02 +00:00
|
|
|
baRouter.POST("/search", baseApi.SearchContainer)
|
2023-06-28 06:30:11 +00:00
|
|
|
baRouter.POST("/list", baseApi.ListContainer)
|
2023-07-06 10:04:22 +00:00
|
|
|
baRouter.GET("/list/stats", baseApi.ContainerListStats)
|
2023-06-13 15:04:12 +00:00
|
|
|
baRouter.GET("/search/log", baseApi.ContainerLogs)
|
2023-10-07 06:30:46 +00:00
|
|
|
baRouter.GET("/limit", baseApi.LoadResourceLimit)
|
2023-05-23 07:43:51 +00:00
|
|
|
baRouter.POST("/clean/log", baseApi.CleanContainerLog)
|
2023-08-02 08:47:30 +00:00
|
|
|
baRouter.POST("/load/log", baseApi.LoadContainerLog)
|
2022-10-11 11:47:16 +00:00
|
|
|
baRouter.POST("/inspect", baseApi.Inspect)
|
2023-10-26 10:20:16 +00:00
|
|
|
baRouter.POST("/rename", baseApi.ContainerRename)
|
2022-12-13 10:54:28 +00:00
|
|
|
baRouter.POST("/operate", baseApi.ContainerOperation)
|
2023-05-23 11:00:06 +00:00
|
|
|
baRouter.POST("/prune", baseApi.ContainerPrune)
|
2022-10-09 08:17:15 +00:00
|
|
|
|
2022-10-10 07:14:49 +00:00
|
|
|
baRouter.GET("/repo", baseApi.ListRepo)
|
2023-02-27 03:46:23 +00:00
|
|
|
baRouter.POST("/repo/status", baseApi.CheckRepoStatus)
|
2022-12-13 10:54:28 +00:00
|
|
|
baRouter.POST("/repo/search", baseApi.SearchRepo)
|
|
|
|
baRouter.POST("/repo/update", baseApi.UpdateRepo)
|
|
|
|
baRouter.POST("/repo", baseApi.CreateRepo)
|
|
|
|
baRouter.POST("/repo/del", baseApi.DeleteRepo)
|
2022-10-10 07:14:49 +00:00
|
|
|
|
2022-10-17 08:04:39 +00:00
|
|
|
baRouter.POST("/compose/search", baseApi.SearchCompose)
|
2022-12-06 07:05:13 +00:00
|
|
|
baRouter.POST("/compose", baseApi.CreateCompose)
|
2023-03-21 10:42:37 +00:00
|
|
|
baRouter.POST("/compose/test", baseApi.TestCompose)
|
2022-10-17 08:04:39 +00:00
|
|
|
baRouter.POST("/compose/operate", baseApi.OperatorCompose)
|
2022-12-06 07:05:13 +00:00
|
|
|
baRouter.POST("/compose/update", baseApi.ComposeUpdate)
|
2023-09-28 02:56:16 +00:00
|
|
|
baRouter.GET("/compose/search/log", baseApi.ComposeLogs)
|
2022-10-17 08:04:39 +00:00
|
|
|
|
|
|
|
baRouter.GET("/template", baseApi.ListComposeTemplate)
|
2022-12-13 10:54:28 +00:00
|
|
|
baRouter.POST("/template/search", baseApi.SearchComposeTemplate)
|
|
|
|
baRouter.POST("/template/update", baseApi.UpdateComposeTemplate)
|
|
|
|
baRouter.POST("/template", baseApi.CreateComposeTemplate)
|
|
|
|
baRouter.POST("/template/del", baseApi.DeleteComposeTemplate)
|
2022-10-17 01:10:06 +00:00
|
|
|
|
2022-10-12 10:55:47 +00:00
|
|
|
baRouter.GET("/image", baseApi.ListImage)
|
2024-01-10 09:05:52 +00:00
|
|
|
baRouter.GET("/image/all", baseApi.ListAllImage)
|
2022-12-13 10:54:28 +00:00
|
|
|
baRouter.POST("/image/search", baseApi.SearchImage)
|
2022-10-10 07:14:49 +00:00
|
|
|
baRouter.POST("/image/pull", baseApi.ImagePull)
|
|
|
|
baRouter.POST("/image/push", baseApi.ImagePush)
|
|
|
|
baRouter.POST("/image/save", baseApi.ImageSave)
|
|
|
|
baRouter.POST("/image/load", baseApi.ImageLoad)
|
|
|
|
baRouter.POST("/image/remove", baseApi.ImageRemove)
|
2022-10-11 09:46:52 +00:00
|
|
|
baRouter.POST("/image/tag", baseApi.ImageTag)
|
2022-10-12 05:42:58 +00:00
|
|
|
baRouter.POST("/image/build", baseApi.ImageBuild)
|
2022-10-11 06:20:51 +00:00
|
|
|
|
2023-07-07 15:17:05 +00:00
|
|
|
baRouter.GET("/network", baseApi.ListNetwork)
|
2022-10-11 06:20:51 +00:00
|
|
|
baRouter.POST("/network/del", baseApi.DeleteNetwork)
|
|
|
|
baRouter.POST("/network/search", baseApi.SearchNetwork)
|
|
|
|
baRouter.POST("/network", baseApi.CreateNetwork)
|
2023-07-07 15:17:05 +00:00
|
|
|
baRouter.GET("/volume", baseApi.ListVolume)
|
2022-10-11 06:20:51 +00:00
|
|
|
baRouter.POST("/volume/del", baseApi.DeleteVolume)
|
|
|
|
baRouter.POST("/volume/search", baseApi.SearchVolume)
|
|
|
|
baRouter.POST("/volume", baseApi.CreateVolume)
|
2022-11-14 11:19:42 +00:00
|
|
|
|
|
|
|
baRouter.GET("/daemonjson", baseApi.LoadDaemonJson)
|
2023-02-01 08:15:31 +00:00
|
|
|
baRouter.GET("/daemonjson/file", baseApi.LoadDaemonJsonFile)
|
2023-01-04 14:31:51 +00:00
|
|
|
baRouter.GET("/docker/status", baseApi.LoadDockerStatus)
|
2022-12-07 09:28:14 +00:00
|
|
|
baRouter.POST("/docker/operate", baseApi.OperateDocker)
|
2022-11-14 11:19:42 +00:00
|
|
|
baRouter.POST("/daemonjson/update", baseApi.UpdateDaemonJson)
|
2023-05-29 03:24:28 +00:00
|
|
|
baRouter.POST("/logoption/update", baseApi.UpdateLogOption)
|
2023-11-21 14:14:07 +00:00
|
|
|
baRouter.POST("/ipv6option/update", baseApi.UpdateIpv6Option)
|
2022-11-14 11:19:42 +00:00
|
|
|
baRouter.POST("/daemonjson/update/byfile", baseApi.UpdateDaemonJsonByFile)
|
2022-10-08 10:32:02 +00:00
|
|
|
}
|
|
|
|
}
|