From f15d719d6f5a57d4737f442464e510421a8f3d41 Mon Sep 17 00:00:00 2001 From: desnlee Date: Mon, 29 Apr 2024 17:27:29 +0800 Subject: [PATCH] feat: add IP binding display in `ls` --- cmd/ls.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/ls.go b/cmd/ls.go index 292cb27..bb50409 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -37,7 +37,11 @@ func listAllSSMContainer() { if p, e := c.GetPortInfo(); e != nil { portStr = "none" } else { - portStr = fmt.Sprintf("%s: %s->%s", p.Type, p.Public, p.Private) + ip := "-" + if len(c.DockerContainer.Ports) > 0 { + ip = c.DockerContainer.Ports[0].IP + } + portStr = fmt.Sprintf("%s:%s->%s/%s", ip, p.Public, p.Private, p.Type) } tbl.AddRow(c.ContainerType, c.DockerContainer.ID[:24], c.Version, portStr, c.DockerContainer.State, c.Name) }