Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e3bd944
Impl: update the workspace panel every 5 seconds
fioan89 Aug 11, 2022
9ed6d9e
Fix: show the workspaces for which the agent can't be retrieved
fioan89 Aug 11, 2022
5a87781
Impl: workspace version status
fioan89 Aug 11, 2022
fd3a4be
Fix: render workspace name as bold
fioan89 Aug 11, 2022
45c17f4
Impl: add table action toolbar
fioan89 Aug 12, 2022
55e14ab
Fix: enable table antialiasing
fioan89 Aug 12, 2022
cce4f39
Use strings for workspace actions from localization bundle
fioan89 Aug 12, 2022
eb89d2c
Fix: enable or disable the workspace actions depending on the workspa…
fioan89 Aug 12, 2022
86654c3
Impl: add REST calls for starting/stopping workspaces
fioan89 Aug 12, 2022
f9db23e
Impl: add support for starting&stopping a workspace
fioan89 Aug 12, 2022
7d7c58c
Fix: consistent icon theming for start/stop workspace actions
fioan89 Aug 15, 2022
d1b1ba0
Log only request and response lines
fioan89 Aug 15, 2022
53577a7
Fix: terminal link for workspaces with a single agent
fioan89 Aug 15, 2022
43a1f6f
Upgrade to latest Gateway build
fioan89 Aug 15, 2022
869e99c
Fix: poll the workspaces every 5 seconds
fioan89 Aug 15, 2022
e2f8fe6
Fix: retrieve agents from the template
fioan89 Aug 16, 2022
f66debc
Fix: enable/disable start/stop actions after they were triggered
fioan89 Aug 17, 2022
2a9a5ba
Impl: REST calls to update a workspace to latest template
fioan89 Aug 17, 2022
8636fe7
Impl: action to update workspace to the latest template version
fioan89 Aug 17, 2022
cdde8e4
Fix: no such host is known errors
fioan89 Aug 17, 2022
b75685a
Next version is 2.1.0
fioan89 Aug 17, 2022
fc0016b
Fix: workspaces are now being refreshed when coming back from IDE&Pro…
fioan89 Aug 18, 2022
0f5aa11
Fix: disable the next button whe user selects a Windows or a macOS wo…
fioan89 Aug 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Impl: add table action toolbar
- with two buttons for starting/stopping a workspace
- icons for start&stop
  • Loading branch information
fioan89 committed Aug 12, 2022
commit 45c17f4451232d4d1f96c8b51b20b2fe882dc346
3 changes: 3 additions & 0 deletions src/main/kotlin/com/coder/gateway/icons/CoderIcons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ object CoderIcons {

val OPEN_TERMINAL = IconLoader.getIcon("open_terminal.svg", javaClass)

val RUN = IconLoader.getIcon("run.svg", javaClass)
val STOP = IconLoader.getIcon("stop.svg", javaClass)

val WINDOWS = IconLoader.getIcon("windows.svg", javaClass)
val MACOS = IconLoader.getIcon("macOS.svg", javaClass)
val LINUX = IconLoader.getIcon("linux.svg", javaClass)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ import com.coder.gateway.sdk.getOS
import com.coder.gateway.sdk.toURL
import com.coder.gateway.sdk.v2.models.Workspace
import com.coder.gateway.sdk.withPath
import com.intellij.CommonBundle
import com.intellij.icons.AllIcons
import com.intellij.ide.BrowserUtil
import com.intellij.ide.IdeBundle
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.ModalityState
import com.intellij.openapi.application.invokeAndWaitIfNeeded
Expand All @@ -31,8 +34,10 @@ import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.progress.Task
import com.intellij.openapi.ui.panel.ComponentPanelBuilder
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenUIManager
import com.intellij.ui.AnActionButton
import com.intellij.ui.AppIcon
import com.intellij.ui.JBColor
import com.intellij.ui.ToolbarDecorator
import com.intellij.ui.components.JBTextField
import com.intellij.ui.components.dialog
import com.intellij.ui.dsl.builder.BottomGap
Expand Down Expand Up @@ -76,8 +81,8 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
WorkspaceNameColumnInfo("Name"),
WorkspaceTemplateNameColumnInfo("Template"),
WorkspaceVersionColumnInfo("Version"),
WorkspaceStatusColumnInfo("Status")
)
WorkspaceStatusColumnInfo("Status"))

private var tableOfWorkspaces = TableView(listTableModelOfWorkspaces).apply {
rowSelectionAllowed = true
columnSelectionAllowed = false
Expand All @@ -93,7 +98,15 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
selectionModel.addListSelectionListener {
enableNextButtonCallback(selectedObject != null && selectedObject?.agentStatus == RUNNING)
}

}

private val toolbar = ToolbarDecorator.createDecorator(tableOfWorkspaces)
.disableAddAction()
.disableRemoveAction()
.disableUpDownActions()
.addExtraAction(StartWorkspaceAction())
.addExtraAction(StopWorkspaceAction())

private var poller: Job? = null

Expand Down Expand Up @@ -127,7 +140,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
cell()
}
row {
scrollCell(tableOfWorkspaces).resizableColumn().horizontalAlign(HorizontalAlign.FILL).verticalAlign(VerticalAlign.FILL)
scrollCell(toolbar.createPanel()).resizableColumn().horizontalAlign(HorizontalAlign.FILL).verticalAlign(VerticalAlign.FILL)
cell()
}.topGap(TopGap.NONE).resizableRow()

Expand All @@ -137,6 +150,18 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
override val previousActionText = IdeBundle.message("button.back")
override val nextActionText = CoderGatewayBundle.message("gateway.connector.view.coder.workspaces.next.text")

private inner class StartWorkspaceAction : AnActionButton("Start Workspace", "Start Workspace", CoderIcons.RUN) {
override fun actionPerformed(p0: AnActionEvent) {
TODO("Not yet implemented")
}
}

private inner class StopWorkspaceAction : AnActionButton("Stop Workspace", "Stop Workspace", CoderIcons.STOP) {
override fun actionPerformed(p0: AnActionEvent) {
TODO("Not yet implemented")
}
}

override fun onInit(wizardModel: CoderWorkspacesWizardModel) {
enableNextButtonCallback(false)
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/run.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/main/resources/run_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/main/resources/stop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/main/resources/stop_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.