File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed
frontend/providers/applaunchpad/src/pages/app/edit/components Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,22 @@ export function NetworkSection({
180180 [ getValues , appendNetworks , removeNetworks , updateNetworks ]
181181 ) ;
182182
183+ const getAccessDisplayText = useCallback (
184+ ( network : AppEditType [ 'networks' ] [ 0 ] ) => {
185+ if ( network . customDomain ) return network . customDomain ;
186+
187+ if ( network . openNodePort ) {
188+ const prefix = `${ network . protocol . toLowerCase ( ) } .${ network . domain } ` ;
189+ return network ?. nodePort
190+ ? `${ prefix } :${ network . nodePort } `
191+ : `${ prefix } :${ t ( 'pending_to_allocated' ) } ` ;
192+ }
193+
194+ return `${ network . publicDomain } .${ network . domain } ` ;
195+ } ,
196+ [ t ]
197+ ) ;
198+
183199 return (
184200 < >
185201 < Box id = { 'network' } { ...boxStyles } >
@@ -328,20 +344,10 @@ export function NetworkSection({
328344 userSelect = { 'all' }
329345 className = "textEllipsis"
330346 onClick = { ( ) => {
331- copyData ( ` ${ network . publicDomain } . ${ network . domain } ` ) ;
347+ copyData ( getAccessDisplayText ( network ) ) ;
332348 } }
333349 >
334- { network . customDomain
335- ? network . customDomain
336- : network . openNodePort
337- ? network ?. nodePort
338- ? `${ network . protocol . toLowerCase ( ) } .${ network . domain } :${
339- network . nodePort
340- } `
341- : `${ network . protocol . toLowerCase ( ) } .${ network . domain } :${ t (
342- 'pending_to_allocated'
343- ) } `
344- : `${ network . publicDomain } .${ network . domain } ` }
350+ { getAccessDisplayText ( network ) }
345351 </ Box >
346352 </ Tooltip >
347353
You can’t perform that action at this time.
0 commit comments