update list containers

This commit is contained in:
2025-04-11 18:00:46 +08:00
parent 38333b2338
commit d09608088f
12 changed files with 234 additions and 34 deletions
+20
View File
@@ -0,0 +1,20 @@
package network
import (
"floares/lib/http/network"
"github.com/gin-gonic/gin"
"net/http"
)
func ListConnect(c *gin.Context) {
ns := c.Param("ns")
if ns == "" {
c.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"msg": "namespace is required",
})
}
inspect := network.GetInspect(ns)
c.JSON(http.StatusOK, inspect)
}
+1
View File
@@ -4,4 +4,5 @@ import "github.com/gin-gonic/gin"
func RegisterRouter(r *gin.RouterGroup) {
r.GET("/", ListNetwork)
r.GET("/:ns/containers", ListConnect)
}