File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
ui/packages/shared/pages/Instance/Info/Connection/ConnectModal/Content Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 55 *--------------------------------------------------------------------------
66 */
77
8-
98import { Instance } from '@postgres.ai/shared/types/api/entities/instance'
109
1110export const getCliInitCommand = ( instance : Instance ) =>
1211 `dblab init --url ${ instance . url } --token TOKEN --environment-id ${ instance . projectName } `
1312
1413export const getSshPortForwardingCommand = ( instance : Instance ) => {
15- if ( ! instance . sshServerUrl ) return null
16- return `ssh -NTML 2348:localhost:2345 ${ instance . sshServerUrl } -i ~/.ssh/id_rsa`
14+ if ( instance . sshServerUrl ) {
15+ // Parse the URL to get the port
16+ const url = new URL ( instance . url )
17+ const port = url . port || '2345'
18+ return `ssh -NTML ${ port } :localhost:${ port } ${ instance . sshServerUrl } -i ~/.ssh/id_rsa`
19+ } else {
20+ return null
21+ }
1722}
You can’t perform that action at this time.
0 commit comments