properly display unforwarded port

This commit is contained in:
Jesse Duffield 2022-10-10 20:10:36 -07:00
parent 15990effff
commit 2f52bd04e6

View file

@ -57,6 +57,10 @@ func (c *Container) GetDisplayStrings(isFocused bool) []string {
func (c *Container) displayPorts() string {
portStrings := lo.Map(c.Container.Ports, func(port types.Port, _ int) string {
if port.PublicPort == 0 {
return fmt.Sprintf("%d\\%s", port.PrivatePort, port.Type)
}
// docker ps will show '0.0.0.0:80->80/tcp' but we'll show
// '80->80/tcp' instead to save space (unless the IP is something other than
// 0.0.0.0)