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/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 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) {