@@ -44,8 +44,11 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
4444 const configuration = run . run_spec . configuration as TDevEnvironmentConfiguration ;
4545 const latestSubmission = run . jobs [ 0 ] ?. job_submissions ?. slice ( - 1 ) [ 0 ] ;
4646 const workingDir = latestSubmission ?. job_runtime_data ?. working_dir ?? '/' ;
47- const openInIDEUrl = `${ configuration . ide } ://vscode-remote/ssh-remote+${ run . run_spec . run_name } ${ workingDir } ` ;
48- const ideDisplayName = getIDEDisplayName ( configuration . ide ) ;
47+ const hasIDE = ! ! configuration . ide ;
48+ const openInIDEUrl = hasIDE
49+ ? `${ configuration . ide } ://vscode-remote/ssh-remote+${ run . run_spec . run_name } ${ workingDir } `
50+ : undefined ;
51+ const ideDisplayName = hasIDE ? getIDEDisplayName ( configuration . ide ! ) : undefined ;
4952
5053 const [ configCliCommand , copyCliCommand ] = useConfigProjectCliCommand ( { projectName : run . project_name } ) ;
5154
@@ -210,52 +213,82 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
210213 ) ,
211214 isOptional : true ,
212215 } ,
213- {
214- title : 'Open' ,
215- description : `After the CLI is attached, you can open the dev environment in ${ ideDisplayName } .` ,
216- content : (
217- < SpaceBetween size = "s" >
218- < Button
219- variant = "primary"
220- external = { true }
221- onClick = { ( ) => window . open ( openInIDEUrl , '_blank' ) }
222- >
223- Open in { ideDisplayName }
224- </ Button >
216+ hasIDE
217+ ? {
218+ title : 'Open' ,
219+ description : `After the CLI is attached, you can open the dev environment in ${ ideDisplayName } .` ,
220+ content : (
221+ < SpaceBetween size = "s" >
222+ < Button
223+ variant = "primary"
224+ external = { true }
225+ onClick = { ( ) => window . open ( openInIDEUrl , '_blank' ) }
226+ >
227+ Open in { ideDisplayName }
228+ </ Button >
225229
226- < ExpandableSection headerText = "Need plain SSH?" >
227- < SpaceBetween size = "s" >
228- < Box />
229- < div className = { styles . codeWrapper } >
230- < Code className = { styles . code } > { sshCommand } </ Code >
230+ < ExpandableSection headerText = "Need plain SSH?" >
231+ < SpaceBetween size = "s" >
232+ < Box />
233+ < div className = { styles . codeWrapper } >
234+ < Code className = { styles . code } > { sshCommand } </ Code >
231235
232- < div className = { styles . copy } >
233- < Popover
234- dismissButton = { false }
235- position = "top"
236- size = "small"
237- triggerType = "custom"
238- content = {
239- < StatusIndicator type = "success" >
240- { t ( 'common.copied' ) }
241- </ StatusIndicator >
242- }
243- >
244- < Button
245- formAction = "none"
246- iconName = "copy"
247- variant = "normal"
248- onClick = { ( ) => copySSHCommand ( ) }
249- />
250- </ Popover >
251- </ div >
252- </ div >
253- </ SpaceBetween >
254- </ ExpandableSection >
255- </ SpaceBetween >
256- ) ,
257- isOptional : true ,
258- } ,
236+ < div className = { styles . copy } >
237+ < Popover
238+ dismissButton = { false }
239+ position = "top"
240+ size = "small"
241+ triggerType = "custom"
242+ content = {
243+ < StatusIndicator type = "success" >
244+ { t ( 'common.copied' ) }
245+ </ StatusIndicator >
246+ }
247+ >
248+ < Button
249+ formAction = "none"
250+ iconName = "copy"
251+ variant = "normal"
252+ onClick = { ( ) => copySSHCommand ( ) }
253+ />
254+ </ Popover >
255+ </ div >
256+ </ div >
257+ </ SpaceBetween >
258+ </ ExpandableSection >
259+ </ SpaceBetween >
260+ ) ,
261+ isOptional : true ,
262+ }
263+ : {
264+ title : 'Connect via SSH' ,
265+ description : 'After the CLI is attached, you can connect to the dev environment via SSH.' ,
266+ content : (
267+ < div className = { styles . codeWrapper } >
268+ < Code className = { styles . code } > { sshCommand } </ Code >
269+
270+ < div className = { styles . copy } >
271+ < Popover
272+ dismissButton = { false }
273+ position = "top"
274+ size = "small"
275+ triggerType = "custom"
276+ content = {
277+ < StatusIndicator type = "success" > { t ( 'common.copied' ) } </ StatusIndicator >
278+ }
279+ >
280+ < Button
281+ formAction = "none"
282+ iconName = "copy"
283+ variant = "normal"
284+ onClick = { ( ) => copySSHCommand ( ) }
285+ />
286+ </ Popover >
287+ </ div >
288+ </ div >
289+ ) ,
290+ isOptional : true ,
291+ } ,
259292 ] }
260293 />
261294 ) }
0 commit comments