diff --git a/CHANGELOG.md b/CHANGELOG.md index 690093b1..f001e527 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,15 +5,22 @@ ## Unreleased ### Added + - warning system when plugin might not be compatible with Coder REST API - a `Create workspace` button which links to Coder's templates page - workspace icons - quick toolbar action to open Coder Dashboard in the browser ### Changed + - redesigned the information&warning banner. Messages can now include hyperlinks +### Removed + +- connection handle window is no longer displayed + ### Fixed + - outdated Coder CLI binaries are cleaned up - workspace status color style: running workspaces are green, failed ones should be red, everything else is gray - typos in plugin description @@ -21,6 +28,7 @@ ## 2.1.2 - 2022-11-23 ### Added + - upgraded support for the latest Coder REST API - support for latest Gateway 2022.2.x builds diff --git a/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt b/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt index 49100feb..0b9dcd66 100644 --- a/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt +++ b/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt @@ -5,7 +5,6 @@ package com.coder.gateway import com.coder.gateway.models.RecentWorkspaceConnection import com.coder.gateway.services.CoderRecentWorkspaceConnectionsService import com.intellij.openapi.components.service -import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.rd.util.launchUnderBackgroundProgress import com.intellij.remote.AuthType import com.intellij.remote.RemoteCredentialsHolder @@ -13,6 +12,7 @@ import com.intellij.ssh.config.unified.SshConfig import com.jetbrains.gateway.api.ConnectionRequestor import com.jetbrains.gateway.api.GatewayConnectionHandle import com.jetbrains.gateway.api.GatewayConnectionProvider +import com.jetbrains.gateway.api.GatewayUI import com.jetbrains.gateway.ssh.HighLevelHostAccessor import com.jetbrains.gateway.ssh.HostDeployInputs import com.jetbrains.gateway.ssh.IdeInfo @@ -30,7 +30,6 @@ import java.time.format.DateTimeFormatter class CoderGatewayConnectionProvider : GatewayConnectionProvider { private val recentConnectionsService = service() - private val connections = mutableSetOf() private val localTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MMM-dd HH:mm") override suspend fun connect(parameters: Map, requestor: ConnectionRequestor): GatewayConnectionHandle? { @@ -42,11 +41,6 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider { val webTerminalLink = parameters["web_terminal_link"]!! if (coderWorkspaceHostname != null && projectPath != null) { - val connection = CoderConnectionMetadata(coderWorkspaceHostname) - if (connection in connections) { - logger.warn("There is already a connection started on ${connection.workspaceHostname}") - return null - } val sshConfiguration = SshConfig(true).apply { setHost(coderWorkspaceHostname) setUsername("coder") @@ -89,16 +83,7 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider { } recentConnectionsService.addRecentConnection(RecentWorkspaceConnection(coderWorkspaceHostname, projectPath, localTimeFormatter.format(LocalDateTime.now()), ideProductCode, ideBuildNumber, ideDownloadLink, webTerminalLink)) - - return object : GatewayConnectionHandle(clientLifetime) { - override fun getTitle(): String { - return "Connection to Coder Workspaces" - } - - override fun hideToTrayOnStart(): Boolean { - return false - } - } + GatewayUI.getInstance().reset() } return null } @@ -106,10 +91,4 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider { override fun isApplicable(parameters: Map): Boolean { return parameters["type"] == "coder" } - - companion object { - val logger = Logger.getInstance(CoderGatewayConnectionProvider::class.java.simpleName) - } -} - -internal data class CoderConnectionMetadata(val workspaceHostname: String) \ No newline at end of file +} \ No newline at end of file