From facce0a2c03dd9323943d643d48ad2ac18d9c8fa Mon Sep 17 00:00:00 2001 From: Faur Ioan-Aurel Date: Fri, 9 Dec 2022 00:29:37 +0200 Subject: [PATCH 1/3] Fix: connection handle window is left open - window is left open Jetbrains Client is closed - we don't actually need the window because we don't have to display anything. The workspaces are already started so no progress is needed, and we don't have any other telemetry data to show. - the fix just removes the connection window - resolves #105 --- CHANGELOG.md | 8 ++++++++ .../coder/gateway/CoderGatewayConnectionProvider.kt | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-) 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..287eae7b 100644 --- a/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt +++ b/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt @@ -89,16 +89,6 @@ 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 - } - } } return null } From f13b4e92e463e1be7b72596922a0c21b6d70dcd0 Mon Sep 17 00:00:00 2001 From: Faur Ioan-Aurel Date: Fri, 9 Dec 2022 00:41:11 +0200 Subject: [PATCH 2/3] Fix: jump to main view after client is started --- .../kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt b/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt index 287eae7b..3daaf877 100644 --- a/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt +++ b/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt @@ -13,6 +13,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 @@ -89,6 +90,7 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider { } recentConnectionsService.addRecentConnection(RecentWorkspaceConnection(coderWorkspaceHostname, projectPath, localTimeFormatter.format(LocalDateTime.now()), ideProductCode, ideBuildNumber, ideDownloadLink, webTerminalLink)) + GatewayUI.getInstance().reset() } return null } From fe30fd4d1d19329c9a480efa923599e575f60f32 Mon Sep 17 00:00:00 2001 From: Faur Ioan-Aurel Date: Fri, 9 Dec 2022 00:42:34 +0200 Subject: [PATCH 3/3] chore: remove dead code --- .../gateway/CoderGatewayConnectionProvider.kt | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt b/src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt index 3daaf877..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 @@ -31,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? { @@ -43,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") @@ -98,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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy