|
1 | 1 | package com.coder.gateway.models
|
2 | 2 |
|
3 |
| -import com.coder.gateway.icons.CoderIcons |
4 | 3 | import com.coder.gateway.sdk.v2.models.Workspace
|
5 | 4 | import com.coder.gateway.sdk.v2.models.WorkspaceAgent
|
6 | 5 | import com.coder.gateway.sdk.v2.models.WorkspaceAgentLifecycleState
|
7 | 6 | import com.coder.gateway.sdk.v2.models.WorkspaceAgentStatus
|
8 | 7 | import com.coder.gateway.sdk.v2.models.WorkspaceStatus
|
9 | 8 | import com.intellij.ui.JBColor
|
10 |
| -import javax.swing.Icon |
11 | 9 |
|
12 | 10 | /**
|
13 | 11 | * WorkspaceAndAgentStatus represents the combined status of a single agent and
|
14 | 12 | * its workspace (or just the workspace if there are no agents).
|
15 | 13 | */
|
16 |
| -enum class WorkspaceAndAgentStatus(val icon: Icon, val label: String, val description: String) { |
| 14 | +enum class WorkspaceAndAgentStatus(val label: String, val description: String) { |
17 | 15 | // Workspace states.
|
18 |
| - QUEUED(CoderIcons.PENDING, "Queued", "The workspace is queueing to start."), |
19 |
| - STARTING(CoderIcons.PENDING, "Starting", "The workspace is starting."), |
20 |
| - FAILED(CoderIcons.OFF, "Failed", "The workspace has failed to start."), |
21 |
| - DELETING(CoderIcons.PENDING, "Deleting", "The workspace is being deleted."), |
22 |
| - DELETED(CoderIcons.OFF, "Deleted", "The workspace has been deleted."), |
23 |
| - STOPPING(CoderIcons.PENDING, "Stopping", "The workspace is stopping."), |
24 |
| - STOPPED(CoderIcons.OFF, "Stopped", "The workspace has stopped."), |
25 |
| - CANCELING(CoderIcons.PENDING, "Canceling action", "The workspace is being canceled."), |
26 |
| - CANCELED(CoderIcons.OFF, "Canceled action", "The workspace has been canceled."), |
27 |
| - RUNNING(CoderIcons.RUN, "Running", "The workspace is running, waiting for agents."), |
| 16 | + QUEUED("Queued", "The workspace is queueing to start."), |
| 17 | + STARTING("Starting", "The workspace is starting."), |
| 18 | + FAILED("Failed", "The workspace has failed to start."), |
| 19 | + DELETING("Deleting", "The workspace is being deleted."), |
| 20 | + DELETED("Deleted", "The workspace has been deleted."), |
| 21 | + STOPPING("Stopping", "The workspace is stopping."), |
| 22 | + STOPPED("Stopped", "The workspace has stopped."), |
| 23 | + CANCELING("Canceling action", "The workspace is being canceled."), |
| 24 | + CANCELED("Canceled action", "The workspace has been canceled."), |
| 25 | + RUNNING("Running", "The workspace is running, waiting for agents."), |
28 | 26 |
|
29 | 27 | // Agent states.
|
30 |
| - CONNECTING(CoderIcons.PENDING, "Connecting", "The agent is connecting."), |
31 |
| - DISCONNECTED(CoderIcons.OFF, "Disconnected", "The agent has disconnected."), |
32 |
| - TIMEOUT(CoderIcons.PENDING, "Timeout", "The agent is taking longer than expected to connect."), |
33 |
| - AGENT_STARTING(CoderIcons.PENDING, "Starting", "The startup script is running."), |
| 28 | + CONNECTING("Connecting", "The agent is connecting."), |
| 29 | + DISCONNECTED("Disconnected", "The agent has disconnected."), |
| 30 | + TIMEOUT("Timeout", "The agent is taking longer than expected to connect."), |
| 31 | + AGENT_STARTING("Starting", "The startup script is running."), |
34 | 32 | AGENT_STARTING_READY(
|
35 |
| - CoderIcons.RUNNING, |
36 | 33 | "Starting",
|
37 | 34 | "The startup script is still running but the agent is ready to accept connections.",
|
38 | 35 | ),
|
39 |
| - CREATED(CoderIcons.PENDING, "Created", "The agent has been created."), |
40 |
| - START_ERROR(CoderIcons.RUNNING, "Started with error", "The agent is ready but the startup script errored."), |
41 |
| - START_TIMEOUT(CoderIcons.PENDING, "Starting", "The startup script is taking longer than expected."), |
| 36 | + CREATED("Created", "The agent has been created."), |
| 37 | + START_ERROR("Started with error", "The agent is ready but the startup script errored."), |
| 38 | + START_TIMEOUT("Starting", "The startup script is taking longer than expected."), |
42 | 39 | START_TIMEOUT_READY(
|
43 |
| - CoderIcons.RUNNING, |
44 | 40 | "Starting",
|
45 | 41 | "The startup script is taking longer than expected but the agent is ready to accept connections.",
|
46 | 42 | ),
|
47 |
| - SHUTTING_DOWN(CoderIcons.PENDING, "Shutting down", "The agent is shutting down."), |
48 |
| - SHUTDOWN_ERROR(CoderIcons.OFF, "Shutdown with error", "The agent shut down but the shutdown script errored."), |
49 |
| - SHUTDOWN_TIMEOUT(CoderIcons.OFF, "Shutting down", "The shutdown script is taking longer than expected."), |
50 |
| - OFF(CoderIcons.OFF, "Off", "The agent has shut down."), |
51 |
| - READY(CoderIcons.RUNNING, "Ready", "The agent is ready to accept connections."), |
| 43 | + SHUTTING_DOWN("Shutting down", "The agent is shutting down."), |
| 44 | + SHUTDOWN_ERROR("Shutdown with error", "The agent shut down but the shutdown script errored."), |
| 45 | + SHUTDOWN_TIMEOUT("Shutting down", "The shutdown script is taking longer than expected."), |
| 46 | + OFF("Off", "The agent has shut down."), |
| 47 | + READY("Ready", "The agent is ready to accept connections."), |
52 | 48 | ;
|
53 | 49 |
|
54 | 50 | fun statusColor(): JBColor =
|
|
0 commit comments