From 80522e0fefc531134049915c8c3527cbae9604f2 Mon Sep 17 00:00:00 2001 From: cdosso Date: Tue, 1 Oct 2024 17:31:11 +0200 Subject: [PATCH 1/3] Add Agent name in rows --- .../gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt b/src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt index 8abe6a8d7..c00c258f5 100644 --- a/src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt +++ b/src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt @@ -244,7 +244,7 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback: foreground = Color.GRAY } } - label("").resizableColumn().align(AlignX.FILL) + label(workspaceProjectIDE.name.replace(workspaceName+".","")).resizableColumn() label(workspaceProjectIDE.ideName).applyToComponent { foreground = JBUI.CurrentTheme.ContextHelp.FOREGROUND font = ComponentPanelBuilder.getCommentFont(font) From f0b57cd633b8b502dbdd62a2f29c7e8e73242157 Mon Sep 17 00:00:00 2001 From: cdosso Date: Tue, 1 Oct 2024 17:32:09 +0200 Subject: [PATCH 2/3] Fetch resources from workspace last_build instead of templateversions --- src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt b/src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt index 3969461ed..c4cb6297b 100644 --- a/src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt +++ b/src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt @@ -182,7 +182,7 @@ open class CoderRestClient( // It is possible for there to be resources with duplicate names so we // need to use a set. return workspaces.flatMap { ws -> - resources(ws).filter { it.agents != null }.flatMap { it.agents!! }.map { + ws.latestBuild.resources.filter { it.agents != null }.flatMap { it.agents!! }.map { "${ws.name}.${it.name}" } }.toSet() From e4c87692d9c6f04987c074808024c5ea4c77e05e Mon Sep 17 00:00:00 2001 From: cdosso Date: Wed, 2 Oct 2024 10:38:16 +0200 Subject: [PATCH 3/3] Add resources fallback if workspace latestBuild is empty --- src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt b/src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt index c4cb6297b..69806f078 100644 --- a/src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt +++ b/src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt @@ -182,7 +182,7 @@ open class CoderRestClient( // It is possible for there to be resources with duplicate names so we // need to use a set. return workspaces.flatMap { ws -> - ws.latestBuild.resources.filter { it.agents != null }.flatMap { it.agents!! }.map { + ws.latestBuild.resources.ifEmpty { resources(ws) }.filter { it.agents != null }.flatMap { it.agents!! }.map { "${ws.name}.${it.name}" } }.toSet()