1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 容器列表页显示端口映射对应 ip (#2262)

This commit is contained in:
ssongliu 2023-09-12 17:16:10 +08:00 committed by GitHub
parent 16446ecaf3
commit 3a0b3e952b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -939,9 +939,9 @@ func simplifyPort(ports []types.Port) []string {
return datas
}
if len(ports) == 1 {
itemPortStr := fmt.Sprintf("%v/%s", ports[0].PrivatePort, ports[0].Type)
itemPortStr := fmt.Sprintf("%s:%v/%s", ports[0].IP, ports[0].PrivatePort, ports[0].Type)
if ports[0].PublicPort != 0 {
itemPortStr = fmt.Sprintf("%v->%v/%s", ports[0].PublicPort, ports[0].PrivatePort, ports[0].Type)
itemPortStr = fmt.Sprintf("%s:%v->%v/%s", ports[0].IP, ports[0].PublicPort, ports[0].PrivatePort, ports[0].Type)
}
datas = append(datas, itemPortStr)
return datas