feat: add deps envs manager
This commit is contained in:
@@ -38,6 +38,7 @@ func RegisterControllers() *Controllers {
|
||||
Log: controllers.NewLogController(),
|
||||
Terminal: controllers.NewTerminalController(),
|
||||
Settings: controllers.NewSettingsController(userService, loginLogService),
|
||||
Runtime: controllers.NewRuntimeController(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ type Controllers struct {
|
||||
Log *controllers.LogController
|
||||
Terminal *controllers.TerminalController
|
||||
Settings *controllers.SettingsController
|
||||
Runtime *controllers.RuntimeController
|
||||
}
|
||||
|
||||
func mustSubFS(fsys fs.FS, dir string) fs.FS {
|
||||
@@ -177,6 +178,18 @@ func Setup(c *Controllers) *gin.Engine {
|
||||
settings.GET("/about", c.Settings.GetAbout)
|
||||
settings.GET("/loginlogs", c.Settings.GetLoginLogs)
|
||||
}
|
||||
|
||||
// Runtime routes (依赖管理)
|
||||
runtime := authorized.Group("/runtime")
|
||||
{
|
||||
runtime.GET("", c.Runtime.GetAvailableRuntimes)
|
||||
runtime.GET("/:type/envs", c.Runtime.ListEnvs)
|
||||
runtime.POST("/:type/envs", c.Runtime.CreateEnv)
|
||||
runtime.DELETE("/:type/envs/:name", c.Runtime.DeleteEnv)
|
||||
runtime.GET("/:type/envs/:name/packages", c.Runtime.ListPackages)
|
||||
runtime.POST("/:type/envs/:name/packages", c.Runtime.InstallPackage)
|
||||
runtime.DELETE("/:type/envs/:name/packages", c.Runtime.UninstallPackage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user