Skip to content

Commit 803e9e6

Browse files
authored
Use latestBuild resources when non-empty and add agent name (#489)
* Add Agent name in rows * Fetch resources from workspace last_build instead of templateversions * Add resources fallback if workspace latestBuild is empty
1 parent 24fce61 commit 803e9e6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ open class CoderRestClient(
182182
// It is possible for there to be resources with duplicate names so we
183183
// need to use a set.
184184
return workspaces.flatMap { ws ->
185-
resources(ws).filter { it.agents != null }.flatMap { it.agents!! }.map {
185+
ws.latestBuild.resources.ifEmpty { resources(ws) }.filter { it.agents != null }.flatMap { it.agents!! }.map {
186186
"${ws.name}.${it.name}"
187187
}
188188
}.toSet()

src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
244244
foreground = Color.GRAY
245245
}
246246
}
247-
label("").resizableColumn().align(AlignX.FILL)
247+
label(workspaceProjectIDE.name.replace(workspaceName+".","")).resizableColumn()
248248
label(workspaceProjectIDE.ideName).applyToComponent {
249249
foreground = JBUI.CurrentTheme.ContextHelp.FOREGROUND
250250
font = ComponentPanelBuilder.getCommentFont(font)

0 commit comments

Comments
 (0)