Skip to content

Commit 25421bb

Browse files
authored
Merge pull request #117 from coder/fix-connection-handle-window
Fix connection handle window
2 parents 55b5b11 + fe30fd4 commit 25421bb

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,30 @@
55
## Unreleased
66

77
### Added
8+
89
- warning system when plugin might not be compatible with Coder REST API
910
- a `Create workspace` button which links to Coder's templates page
1011
- workspace icons
1112
- quick toolbar action to open Coder Dashboard in the browser
1213

1314
### Changed
15+
1416
- redesigned the information&warning banner. Messages can now include hyperlinks
1517

18+
### Removed
19+
20+
- connection handle window is no longer displayed
21+
1622
### Fixed
23+
1724
- outdated Coder CLI binaries are cleaned up
1825
- workspace status color style: running workspaces are green, failed ones should be red, everything else is gray
1926
- typos in plugin description
2027

2128
## 2.1.2 - 2022-11-23
2229

2330
### Added
31+
2432
- upgraded support for the latest Coder REST API
2533
- support for latest Gateway 2022.2.x builds
2634

src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ package com.coder.gateway
55
import com.coder.gateway.models.RecentWorkspaceConnection
66
import com.coder.gateway.services.CoderRecentWorkspaceConnectionsService
77
import com.intellij.openapi.components.service
8-
import com.intellij.openapi.diagnostic.Logger
98
import com.intellij.openapi.rd.util.launchUnderBackgroundProgress
109
import com.intellij.remote.AuthType
1110
import com.intellij.remote.RemoteCredentialsHolder
1211
import com.intellij.ssh.config.unified.SshConfig
1312
import com.jetbrains.gateway.api.ConnectionRequestor
1413
import com.jetbrains.gateway.api.GatewayConnectionHandle
1514
import com.jetbrains.gateway.api.GatewayConnectionProvider
15+
import com.jetbrains.gateway.api.GatewayUI
1616
import com.jetbrains.gateway.ssh.HighLevelHostAccessor
1717
import com.jetbrains.gateway.ssh.HostDeployInputs
1818
import com.jetbrains.gateway.ssh.IdeInfo
@@ -30,7 +30,6 @@ import java.time.format.DateTimeFormatter
3030
class CoderGatewayConnectionProvider : GatewayConnectionProvider {
3131
private val recentConnectionsService = service<CoderRecentWorkspaceConnectionsService>()
3232

33-
private val connections = mutableSetOf<CoderConnectionMetadata>()
3433
private val localTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MMM-dd HH:mm")
3534

3635
override suspend fun connect(parameters: Map<String, String>, requestor: ConnectionRequestor): GatewayConnectionHandle? {
@@ -42,11 +41,6 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider {
4241
val webTerminalLink = parameters["web_terminal_link"]!!
4342

4443
if (coderWorkspaceHostname != null && projectPath != null) {
45-
val connection = CoderConnectionMetadata(coderWorkspaceHostname)
46-
if (connection in connections) {
47-
logger.warn("There is already a connection started on ${connection.workspaceHostname}")
48-
return null
49-
}
5044
val sshConfiguration = SshConfig(true).apply {
5145
setHost(coderWorkspaceHostname)
5246
setUsername("coder")
@@ -89,27 +83,12 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider {
8983
}
9084

9185
recentConnectionsService.addRecentConnection(RecentWorkspaceConnection(coderWorkspaceHostname, projectPath, localTimeFormatter.format(LocalDateTime.now()), ideProductCode, ideBuildNumber, ideDownloadLink, webTerminalLink))
92-
93-
return object : GatewayConnectionHandle(clientLifetime) {
94-
override fun getTitle(): String {
95-
return "Connection to Coder Workspaces"
96-
}
97-
98-
override fun hideToTrayOnStart(): Boolean {
99-
return false
100-
}
101-
}
86+
GatewayUI.getInstance().reset()
10287
}
10388
return null
10489
}
10590

10691
override fun isApplicable(parameters: Map<String, String>): Boolean {
10792
return parameters["type"] == "coder"
10893
}
109-
110-
companion object {
111-
val logger = Logger.getInstance(CoderGatewayConnectionProvider::class.java.simpleName)
112-
}
113-
}
114-
115-
internal data class CoderConnectionMetadata(val workspaceHostname: String)
94+
}

0 commit comments

Comments
 (0)
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