@@ -3,6 +3,7 @@ package com.coder.gateway.views
3
3
import com.coder.gateway.CoderGatewayBundle
4
4
import com.coder.gateway.icons.CoderIcons
5
5
import com.coder.gateway.services.CoderRecentWorkspaceConnectionsService
6
+ import com.intellij.ide.BrowserUtil
6
7
import com.intellij.openapi.actionSystem.AnActionEvent
7
8
import com.intellij.openapi.components.service
8
9
import com.intellij.openapi.project.DumbAwareAction
@@ -11,6 +12,7 @@ import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenUIManager
11
12
import com.intellij.ui.components.ActionLink
12
13
import com.intellij.ui.components.JBScrollPane
13
14
import com.intellij.ui.dsl.builder.BottomGap
15
+ import com.intellij.ui.dsl.builder.RightGap
14
16
import com.intellij.ui.dsl.builder.TopGap
15
17
import com.intellij.ui.dsl.builder.panel
16
18
import com.intellij.ui.dsl.gridLayout.HorizontalAlign
@@ -60,8 +62,12 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections {
60
62
if (hostname != null ) {
61
63
label(hostname).applyToComponent {
62
64
font = JBFont .h3().asBold()
63
- }.horizontalAlign(HorizontalAlign .LEFT )
64
- cell()
65
+ }.horizontalAlign(HorizontalAlign .LEFT ).gap(RightGap .SMALL )
66
+ actionButton(object : DumbAwareAction (" Open SSH Web Terminal" , " " , CoderIcons .OPEN_TERMINAL ) {
67
+ override fun actionPerformed (e : AnActionEvent ) {
68
+ BrowserUtil .browse(recentConnections[0 ]?.webTerminalLink ? : " " )
69
+ }
70
+ })
65
71
}
66
72
}.topGap(TopGap .MEDIUM )
67
73
@@ -78,7 +84,8 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections {
78
84
" project_path" to connectionDetails.projectPath!! ,
79
85
" ide_product_code" to " ${product.productCode} " ,
80
86
" ide_build_number" to " ${connectionDetails.ideBuildNumber} " ,
81
- " ide_download_link" to " ${connectionDetails.downloadSource} "
87
+ " ide_download_link" to " ${connectionDetails.downloadSource} " ,
88
+ " web_terminal_link" to " ${connectionDetails.webTerminalLink} "
82
89
)
83
90
)
84
91
}
@@ -88,7 +95,7 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections {
88
95
foreground = JBUI .CurrentTheme .ContextHelp .FOREGROUND
89
96
font = ComponentPanelBuilder .getCommentFont(font)
90
97
}
91
- actionButton(object : DumbAwareAction (" " , " " , CoderIcons .DELETE ) {
98
+ actionButton(object : DumbAwareAction (" Remove " , " " , CoderIcons .DELETE ) {
92
99
override fun actionPerformed (e : AnActionEvent ) {
93
100
recentConnectionsService.removeConnection(connectionDetails)
94
101
updateContentView()
0 commit comments