4
4
5
5
package io.gitpod.toolbox.gateway
6
6
7
- import com.jetbrains.toolbox.gateway.AbstractRemoteProviderEnvironment
8
- import com.jetbrains.toolbox.gateway.EnvironmentVisibilityState
9
- import com.jetbrains.toolbox.gateway.environments.EnvironmentContentsView
10
- import com.jetbrains.toolbox.gateway.states.EnvironmentStateConsumer
11
- import com.jetbrains.toolbox.gateway.states.StandardRemoteEnvironmentState
12
- import com.jetbrains.toolbox.gateway.ui.ActionDescription
13
- import com.jetbrains.toolbox.gateway.ui.ObservableList
14
- import com.jetbrains.toolbox.gateway.ui.ObservablePropertiesFactory
7
+ import com.jetbrains.toolbox.api.remoteDev.AbstractRemoteProviderEnvironment
8
+ import com.jetbrains.toolbox.api.remoteDev.EnvironmentVisibilityState
9
+ import com.jetbrains.toolbox.api.remoteDev.environments.EnvironmentContentsView
10
+ import com.jetbrains.toolbox.api.remoteDev.states.CustomRemoteEnvironmentState
11
+ import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateConsumer
12
+ import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateIcons
13
+ import com.jetbrains.toolbox.api.remoteDev.states.StandardRemoteEnvironmentState
14
+ import com.jetbrains.toolbox.api.ui.actions.ActionDescription
15
+ import com.jetbrains.toolbox.api.ui.observables.ObservableList
16
+ import com.jetbrains.toolbox.api.ui.observables.ObservablePropertiesFactory
15
17
import io.gitpod.publicapi.experimental.v1.Workspaces.WorkspaceInstanceStatus
16
18
import io.gitpod.toolbox.auth.GitpodAuthManager
17
19
import io.gitpod.toolbox.service.ConnectParams
@@ -100,17 +102,16 @@ private class WorkspaceEnvState(val phase: WorkspaceInstanceStatus.Phase) {
100
102
101
103
companion object {
102
104
val phaseToStateMap = mapOf (
103
- WorkspaceInstanceStatus .Phase .PHASE_UNSPECIFIED to StandardRemoteEnvironmentState .Unreachable ,
104
- WorkspaceInstanceStatus .Phase .PHASE_PREPARING to StandardRemoteEnvironmentState .Initializing ,
105
- WorkspaceInstanceStatus .Phase .PHASE_IMAGEBUILD to StandardRemoteEnvironmentState .Initializing ,
106
- WorkspaceInstanceStatus .Phase .PHASE_PENDING to StandardRemoteEnvironmentState .Initializing ,
107
- WorkspaceInstanceStatus .Phase .PHASE_CREATING to StandardRemoteEnvironmentState .Initializing ,
108
- WorkspaceInstanceStatus .Phase .PHASE_INITIALIZING to StandardRemoteEnvironmentState .Initializing ,
109
- WorkspaceInstanceStatus .Phase .PHASE_RUNNING to StandardRemoteEnvironmentState .Active ,
105
+ WorkspaceInstanceStatus .Phase .PHASE_UNSPECIFIED to CustomRemoteEnvironmentState ( " Unknown " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Inactive ), false , EnvironmentStateIcons . Error ) ,
106
+ WorkspaceInstanceStatus .Phase .PHASE_PREPARING to CustomRemoteEnvironmentState ( " Preparing " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Initializing ), false , EnvironmentStateIcons . Connecting ) ,
107
+ WorkspaceInstanceStatus .Phase .PHASE_IMAGEBUILD to CustomRemoteEnvironmentState ( " Building " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Initializing ), false , EnvironmentStateIcons . Connecting ) ,
108
+ WorkspaceInstanceStatus .Phase .PHASE_PENDING to CustomRemoteEnvironmentState ( " Initializing " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Initializing ), false , EnvironmentStateIcons . Connecting ) ,
109
+ WorkspaceInstanceStatus .Phase .PHASE_CREATING to CustomRemoteEnvironmentState ( " Creating " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Initializing ), false , EnvironmentStateIcons . Connecting ) ,
110
+ WorkspaceInstanceStatus .Phase .PHASE_INITIALIZING to CustomRemoteEnvironmentState ( " Initializing " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Initializing ), false , EnvironmentStateIcons . Connecting ) ,
111
+ WorkspaceInstanceStatus .Phase .PHASE_RUNNING to CustomRemoteEnvironmentState ( " Running " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Active ), true , EnvironmentStateIcons . Active ) ,
110
112
WorkspaceInstanceStatus .Phase .PHASE_INTERRUPTED to StandardRemoteEnvironmentState .Error ,
111
- WorkspaceInstanceStatus .Phase .PHASE_STOPPING to StandardRemoteEnvironmentState .Unreachable ,
112
- WorkspaceInstanceStatus .Phase .PHASE_STOPPED to StandardRemoteEnvironmentState .Hibernated ,
113
+ WorkspaceInstanceStatus .Phase .PHASE_STOPPING to CustomRemoteEnvironmentState ( " Stopping " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Hibernating ), false , EnvironmentStateIcons . Connecting ) ,
114
+ WorkspaceInstanceStatus .Phase .PHASE_STOPPED to CustomRemoteEnvironmentState ( " Stopped " , Utils .environmentStateColorPalette.getColor( StandardRemoteEnvironmentState .Hibernated ), false , EnvironmentStateIcons . Hibernated ) ,
113
115
)
114
116
}
115
- // TODO(hw): add customized state
116
- }
117
+ }
0 commit comments