@@ -7,6 +7,7 @@ import com.coder.gateway.CoderGatewayConstants
7
7
import com.coder.gateway.CoderRemoteConnectionHandle
8
8
import com.coder.gateway.icons.CoderIcons
9
9
import com.coder.gateway.models.WorkspaceAgentListModel
10
+ import com.coder.gateway.models.WorkspaceAndAgentStatus
10
11
import com.coder.gateway.models.WorkspaceProjectIDE
11
12
import com.coder.gateway.models.toWorkspaceProjectIDE
12
13
import com.coder.gateway.sdk.CoderRestClient
@@ -193,11 +194,11 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
193
194
TopGap .MEDIUM
194
195
}
195
196
row {
196
- icon(status.first).applyToComponent {
197
- foreground = status.second
198
- }.align(AlignX .LEFT ).gap(RightGap .SMALL ).applyToComponent {
199
- size = Dimension (JBUI .scale(16 ), JBUI .scale(16 ))
200
- }
197
+ // icon(status.first).applyToComponent {
198
+ // foreground = status.second
199
+ // }.align(AlignX.LEFT).gap(RightGap.SMALL).applyToComponent {
200
+ // size = Dimension(JBUI.scale(16), JBUI.scale(16))
201
+ // }
201
202
label(workspaceName).applyToComponent {
202
203
font = JBFont .h3().asBold()
203
204
}.align(AlignX .LEFT ).gap(RightGap .SMALL )
@@ -280,41 +281,47 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
280
281
if (deploymentError == null || showError) {
281
282
row {
282
283
// There must be a way to make this properly wrap?
284
+ if (status.first == CoderIcons .PENDING ) {
285
+ icon(status.first)
286
+ }
283
287
label(" <html><body style='width:350px;'>" + status.third + " </html>" ).applyToComponent {
284
288
foreground = status.second
285
289
}
286
290
}
287
291
}
288
- connections.forEach { workspaceProjectIDE ->
289
- row {
290
- icon(workspaceProjectIDE.ideProduct.icon)
291
- cell(
292
- ActionLink (workspaceProjectIDE.projectPathDisplay) {
293
- CoderRemoteConnectionHandle ().connect { workspaceProjectIDE }
294
- GatewayUI .getInstance().reset()
295
- },
296
- )
297
- label(" " ).resizableColumn().align(AlignX .FILL )
298
- label(workspaceProjectIDE.ideName).applyToComponent {
299
- foreground = JBUI .CurrentTheme .ContextHelp .FOREGROUND
300
- font = ComponentPanelBuilder .getCommentFont(font)
301
- }
302
- label(workspaceProjectIDE.lastOpened.toString()).applyToComponent {
303
- foreground = JBUI .CurrentTheme .ContextHelp .FOREGROUND
304
- font = ComponentPanelBuilder .getCommentFont(font)
292
+ if (workspaceWithAgent?.workspace?.latestBuild?.status == WorkspaceStatus .RUNNING && workspaceWithAgent.status == WorkspaceAndAgentStatus .READY ) {
293
+ row { label(" Select a project to launch." ) }
294
+ connections.forEach { workspaceProjectIDE ->
295
+ row {
296
+ icon(workspaceProjectIDE.ideProduct.icon)
297
+ cell(
298
+ ActionLink (workspaceProjectIDE.projectPathDisplay) {
299
+ CoderRemoteConnectionHandle ().connect { workspaceProjectIDE }
300
+ GatewayUI .getInstance().reset()
301
+ },
302
+ )
303
+ label(" " ).resizableColumn().align(AlignX .FILL )
304
+ label(workspaceProjectIDE.ideName).applyToComponent {
305
+ foreground = JBUI .CurrentTheme .ContextHelp .FOREGROUND
306
+ font = ComponentPanelBuilder .getCommentFont(font)
307
+ }
308
+ label(workspaceProjectIDE.lastOpened.toString()).applyToComponent {
309
+ foreground = JBUI .CurrentTheme .ContextHelp .FOREGROUND
310
+ font = ComponentPanelBuilder .getCommentFont(font)
311
+ }
312
+ actionButton(
313
+ object : DumbAwareAction (
314
+ CoderGatewayBundle .message(" gateway.connector.recent-connections.remove.button.tooltip" ),
315
+ " " ,
316
+ CoderIcons .DELETE ,
317
+ ) {
318
+ override fun actionPerformed (e : AnActionEvent ) {
319
+ recentConnectionsService.removeConnection(workspaceProjectIDE.toRecentWorkspaceConnection())
320
+ updateRecentView()
321
+ }
322
+ },
323
+ )
305
324
}
306
- actionButton(
307
- object : DumbAwareAction (
308
- CoderGatewayBundle .message(" gateway.connector.recent-connections.remove.button.tooltip" ),
309
- " " ,
310
- CoderIcons .DELETE ,
311
- ) {
312
- override fun actionPerformed (e : AnActionEvent ) {
313
- recentConnectionsService.removeConnection(workspaceProjectIDE.toRecentWorkspaceConnection())
314
- updateRecentView()
315
- }
316
- },
317
- )
318
325
}
319
326
}
320
327
}
0 commit comments