fix: resolve port doubling issue in status display

- Modified Docker inspect template to include spaces between port bindings.
- Updated proxy_info logic to extract only the first port instance.
- Fixed concatenation of TCP and UDP ports (e.g., 2725727257 -> 27257).
This commit is contained in:
kobaltgit
2026-04-06 12:46:57 +03:00
parent 09f1aa3832
commit e1b495ca47

View File

@@ -271,7 +271,7 @@ async def proxy_info() -> dict | None:
cmd_str = await docker_val("{{range .Config.Cmd}}{{.}} {{end}}") cmd_str = await docker_val("{{range .Config.Cmd}}{{.}} {{end}}")
secret = cmd_str.split()[-1] if cmd_str else "" secret = cmd_str.split()[-1] if cmd_str else ""
hp = await docker_val("{{range $p,$c := .HostConfig.PortBindings}}{{(index $c 0).HostPort}} {{end}}") hp = await docker_val("{{range $p,$c := .HostConfig.PortBindings}}{{(index $c 0).HostPort}} {{end}}")
port = hp or "443" port = hp.split()[0] if hp else "443"
ip4 = await get_ip4() ip4 = await get_ip4()
ip6 = await get_ip6() ip6 = await get_ip6()
cfg = load_config() cfg = load_config()