From 337b1e4a64932340e2d3f8bf8b653576b415fc94 Mon Sep 17 00:00:00 2001 From: Faur Ioan-Aurel Date: Tue, 20 May 2025 22:21:14 +0300 Subject: [PATCH 1/2] fix: open web terminal action is no longer displayed when the workspace is stopped. This action will be available only when the workspace is up and running (even when it is running with errors) --- CHANGELOG.md | 4 ++++ .../coder/toolbox/CoderRemoteEnvironment.kt | 23 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10ccc4f..1189777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - render network status in the Settings tab, under `Additional environment information` section. - quick action for creating new workspaces from the web dashboard. +### Fixed + +- `Open web terminal` action is no longer displayed when the workspace is stopped. + ## 0.2.1 - 2025-05-05 ### Changed diff --git a/src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt b/src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt index ad11c30..ae9721a 100644 --- a/src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt +++ b/src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt @@ -70,29 +70,32 @@ class CoderRemoteEnvironment( fun asPairOfWorkspaceAndAgent(): Pair = Pair(workspace, agent) private fun getAvailableActions(): List { - val actions = mutableListOf( - Action(context.i18n.ptrl("Open web terminal")) { + val actions = mutableListOf() + if (wsRawStatus.canStop()) { + actions.add(Action(context.i18n.ptrl("Open web terminal")) { context.cs.launch { BrowserUtil.browse(client.url.withPath("/${workspace.ownerName}/$name/terminal").toString()) { context.ui.showErrorInfoPopup(it) } } - }, + }) + } + actions.add( Action(context.i18n.ptrl("Open in dashboard")) { context.cs.launch { BrowserUtil.browse(client.url.withPath("/@${workspace.ownerName}/${workspace.name}").toString()) { context.ui.showErrorInfoPopup(it) } } - }, + }) - Action(context.i18n.ptrl("View template")) { - context.cs.launch { - BrowserUtil.browse(client.url.withPath("/templates/${workspace.templateName}").toString()) { - context.ui.showErrorInfoPopup(it) - } + actions.add(Action(context.i18n.ptrl("View template")) { + context.cs.launch { + BrowserUtil.browse(client.url.withPath("/templates/${workspace.templateName}").toString()) { + context.ui.showErrorInfoPopup(it) } - }) + } + }) if (wsRawStatus.canStart()) { if (workspace.outdated) { From 3747e1936b3eaacb05e9c8cf5b495311daabc892 Mon Sep 17 00:00:00 2001 From: Faur Ioan-Aurel Date: Tue, 20 May 2025 22:21:27 +0300 Subject: [PATCH 2/2] chore: next version is 0.2.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 14e11de..843e9e9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -version=0.2.1 +version=0.2.2 group=com.coder.toolbox name=coder-toolbox