Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh committed Dec 6, 2024
1 parent d5cb8cd commit 42a7e9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ package io.gitpod.toolbox.gateway
import com.jetbrains.toolbox.api.remoteDev.AbstractRemoteProviderEnvironment
import com.jetbrains.toolbox.api.remoteDev.EnvironmentVisibilityState
import com.jetbrains.toolbox.api.remoteDev.environments.EnvironmentContentsView
import com.jetbrains.toolbox.api.remoteDev.states.CustomRemoteEnvironmentState
import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateConsumer
import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateIcons
import com.jetbrains.toolbox.api.remoteDev.states.StandardRemoteEnvironmentState
import com.jetbrains.toolbox.api.ui.actions.ActionDescription
import com.jetbrains.toolbox.api.ui.observables.ObservableList
Expand Down Expand Up @@ -108,9 +110,9 @@ private class WorkspaceEnvState(val phase: WorkspaceInstanceStatus.Phase) {
WorkspaceInstanceStatus.Phase.PHASE_INITIALIZING to StandardRemoteEnvironmentState.Initializing,
WorkspaceInstanceStatus.Phase.PHASE_RUNNING to StandardRemoteEnvironmentState.Active,
WorkspaceInstanceStatus.Phase.PHASE_INTERRUPTED to StandardRemoteEnvironmentState.Error,
WorkspaceInstanceStatus.Phase.PHASE_STOPPING to StandardRemoteEnvironmentState.Unreachable,
WorkspaceInstanceStatus.Phase.PHASE_STOPPED to StandardRemoteEnvironmentState.Hibernated,
WorkspaceInstanceStatus.Phase.PHASE_STOPPING to CustomRemoteEnvironmentState("Stopping", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Activating), false, EnvironmentStateIcons.Offline),
// WorkspaceInstanceStatus.Phase.PHASE_STOPPED to CustomRemoteEnvironmentState("Stopped", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Error), false, EnvironmentStateIcons.Offline),
WorkspaceInstanceStatus.Phase.PHASE_STOPPED to CustomRemoteEnvironmentState("Stopping", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Restarting), false, EnvironmentStateIcons.Connecting),
)
}
// TODO(hw): add customized state
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.jetbrains.toolbox.api.core.os.LocalDesktopManager
import com.jetbrains.toolbox.api.remoteDev.connection.ClientHelper
import com.jetbrains.toolbox.api.remoteDev.connection.ToolboxProxySettings
import com.jetbrains.toolbox.api.remoteDev.ssh.validation.SshConnectionValidator
import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateColorPalette
import com.jetbrains.toolbox.api.remoteDev.ui.EnvironmentUiPageManager
import com.jetbrains.toolbox.api.ui.ToolboxUi
import com.jetbrains.toolbox.api.ui.observables.ObservablePropertiesFactory
Expand All @@ -33,6 +34,7 @@ object Utils {
lateinit var gitpodSettings: GitpodSettings private set

lateinit var toolboxUi: ToolboxUi private set
lateinit var environmentStateColorPalette: EnvironmentStateColorPalette private set
lateinit var localDesktopManager: LocalDesktopManager private set
lateinit var environmentUiPageManager: EnvironmentUiPageManager private set

Expand All @@ -45,6 +47,7 @@ object Utils {
coroutineScope = serviceLocator.getService(CoroutineScope::class.java)
toolboxUi = serviceLocator.getService(ToolboxUi::class.java)
localDesktopManager = serviceLocator.getService(LocalDesktopManager::class.java)
environmentStateColorPalette = serviceLocator.getService(EnvironmentStateColorPalette::class.java)
environmentUiPageManager = serviceLocator.getService(EnvironmentUiPageManager::class.java)
settingStore = serviceLocator.getService(PluginSettingsStore::class.java)
sshConnectionValidator = serviceLocator.getService(SshConnectionValidator::class.java)
Expand Down

0 comments on commit 42a7e9c

Please sign in to comment.