@@ -174,14 +174,15 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
174
174
val workspaceWithAgent = deployment?.items?.firstOrNull { it.workspace.name == workspaceName }
175
175
val status =
176
176
if (deploymentError != null ) {
177
- Pair (UIUtil .getErrorForeground(), deploymentError)
177
+ Triple (UIUtil .getErrorForeground(), deploymentError, UIUtil .getBalloonErrorIcon() )
178
178
} else if (workspaceWithAgent != null ) {
179
- Pair (
179
+ Triple (
180
180
workspaceWithAgent.status.statusColor(),
181
181
workspaceWithAgent.status.description,
182
+ null
182
183
)
183
184
} else {
184
- Pair (UIUtil .getContextHelpForeground(), " Querying workspace status..." )
185
+ Triple (UIUtil .getContextHelpForeground(), " Querying workspace status..." , AnimatedIcon . Default () )
185
186
}
186
187
val gap =
187
188
if (top) {
@@ -201,19 +202,25 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
201
202
label(" " ).resizableColumn().align(AlignX .FILL )
202
203
}.topGap(gap)
203
204
204
- connections.forEach { workspaceProjectIDE ->
205
- val enableLinks = listOf (WorkspaceStatus .STOPPED , WorkspaceStatus .CANCELED , WorkspaceStatus .FAILED , WorkspaceStatus .STARTING , WorkspaceStatus .RUNNING ).contains(workspaceWithAgent?.workspace?.latestBuild?.status)
206
- val inLoadingState = listOf (WorkspaceStatus .STARTING , WorkspaceStatus .CANCELING , WorkspaceStatus .DELETING , WorkspaceStatus .STOPPING ).contains(workspaceWithAgent?.workspace?.latestBuild?.status)
205
+ val enableLinks = listOf (WorkspaceStatus .STOPPED , WorkspaceStatus .CANCELED , WorkspaceStatus .FAILED , WorkspaceStatus .STARTING , WorkspaceStatus .RUNNING ).contains(workspaceWithAgent?.workspace?.latestBuild?.status)
206
+ val inLoadingState = listOf (WorkspaceStatus .STARTING , WorkspaceStatus .CANCELING , WorkspaceStatus .DELETING , WorkspaceStatus .STOPPING ).contains(workspaceWithAgent?.workspace?.latestBuild?.status)
207
207
208
+ // We only display an API error on the first workspace rather than duplicating it on each workspace.
209
+ if (deploymentError == null || showError) {
208
210
row {
209
211
if (inLoadingState) {
210
212
icon(AnimatedIcon .Default ())
211
213
}
214
+ if (status.third != null ) {
215
+ icon(status.third!! )
216
+ }
212
217
label(" <html><body style='width:350px;'>" + status.second + " </html>" ).applyToComponent {
213
218
foreground = status.first
214
219
}
215
220
}
221
+ }
216
222
223
+ connections.forEach { workspaceProjectIDE ->
217
224
row {
218
225
icon(workspaceProjectIDE.ideProduct.icon)
219
226
if (enableLinks) {
0 commit comments