feat: add deps envs manager

This commit is contained in:
engigu
2025-12-22 00:09:40 +08:00
parent db6a5574e6
commit 179aad970f
9 changed files with 914 additions and 1 deletions
+13
View File
@@ -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)
}
}
}