@@ -86,19 +86,36 @@ export function useUpstreamStatus(envGroupId?: Ref<number | undefined>) {
86
86
return onlineCount
87
87
}
88
88
89
+ // Format socket address for display (handles IPv6 addresses)
90
+ function formatSocketAddress ( host : string , port : string ) : string {
91
+ // Check if this is an IPv6 address by looking for colons
92
+ if ( host . includes ( ':' ) ) {
93
+ // IPv6 address - check if it already has brackets
94
+ if ( ! host . startsWith ( '[' ) ) {
95
+ return `[${ host } ]:${ port } `
96
+ }
97
+ // Already has brackets, just append port
98
+ return `${ host } :${ port } `
99
+ }
100
+ // IPv4 address or hostname
101
+ return `${ host } :${ port } `
102
+ }
103
+
89
104
// Get target display text
90
105
function getTargetText ( target : ProxyTarget ) : string {
106
+ const socketAddress = formatSocketAddress ( target . host , target . port )
107
+
91
108
if ( ! shouldShowMultiNodeDisplay . value ) {
92
109
// Fallback to single-node display
93
110
const result = proxyStore . getAvailabilityResult ( target )
94
111
if ( ! result )
95
- return ` ${ target . host } : ${ target . port } `
112
+ return socketAddress
96
113
97
114
if ( result . online ) {
98
- return `${ target . host } : ${ target . port } (${ result . latency . toFixed ( 2 ) } ms)`
115
+ return `${ socketAddress } (${ result . latency . toFixed ( 2 ) } ms)`
99
116
}
100
117
else {
101
- return ` ${ target . host } : ${ target . port } `
118
+ return socketAddress
102
119
}
103
120
}
104
121
@@ -107,7 +124,7 @@ export function useUpstreamStatus(envGroupId?: Ref<number | undefined>) {
107
124
const totalNodes = calculateTotalNodes ( group , testType )
108
125
const onlineCount = calculateOnlineCount ( target , group , testType )
109
126
110
- return `${ target . host } : ${ target . port } (${ onlineCount } /${ totalNodes } )`
127
+ return `${ socketAddress } (${ onlineCount } /${ totalNodes } )`
111
128
}
112
129
113
130
// Get target tooltip title
0 commit comments