Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d040a8

Browse files
committed
Remove unused status icons
We display the status text and color, but not the icons.
1 parent ce85ff5 commit 9d040a8

File tree

6 files changed

+24
-51
lines changed

6 files changed

+24
-51
lines changed

src/main/kotlin/com/coder/gateway/icons/CoderIcons.kt

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ object CoderIcons {
1616

1717
val OPEN_TERMINAL = IconLoader.getIcon("icons/open_terminal.svg", javaClass)
1818

19-
val PENDING = IconLoader.getIcon("icons/pending.svg", javaClass)
20-
val RUNNING = IconLoader.getIcon("icons/running.svg", javaClass)
21-
val OFF = IconLoader.getIcon("icons/off.svg", javaClass)
22-
2319
val HOME = IconLoader.getIcon("icons/homeFolder.svg", javaClass)
2420
val CREATE = IconLoader.getIcon("icons/create.svg", javaClass)
2521
val RUN = IconLoader.getIcon("icons/run.svg", javaClass)

src/main/kotlin/com/coder/gateway/models/WorkspaceAgentListModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ data class WorkspaceAgentListModel(
1212
val workspace: Workspace,
1313
// If this is missing, assume the workspace is off or has no agents.
1414
val agent: WorkspaceAgent? = null,
15-
// The icon to display on the row.
15+
// The icon of the template from which this workspace was created.
1616
var icon: Icon? = null,
1717
// The combined status of the workspace and agent to display on the row.
1818
val status: WorkspaceAndAgentStatus = WorkspaceAndAgentStatus.from(workspace, agent),

src/main/kotlin/com/coder/gateway/models/WorkspaceAndAgentStatus.kt

+23-27
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,50 @@
11
package com.coder.gateway.models
22

3-
import com.coder.gateway.icons.CoderIcons
43
import com.coder.gateway.sdk.v2.models.Workspace
54
import com.coder.gateway.sdk.v2.models.WorkspaceAgent
65
import com.coder.gateway.sdk.v2.models.WorkspaceAgentLifecycleState
76
import com.coder.gateway.sdk.v2.models.WorkspaceAgentStatus
87
import com.coder.gateway.sdk.v2.models.WorkspaceStatus
98
import com.intellij.ui.JBColor
10-
import javax.swing.Icon
119

1210
/**
1311
* WorkspaceAndAgentStatus represents the combined status of a single agent and
1412
* its workspace (or just the workspace if there are no agents).
1513
*/
16-
enum class WorkspaceAndAgentStatus(val icon: Icon, val label: String, val description: String) {
14+
enum class WorkspaceAndAgentStatus(val label: String, val description: String) {
1715
// 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."),
2826

2927
// 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."),
3432
AGENT_STARTING_READY(
35-
CoderIcons.RUNNING,
3633
"Starting",
3734
"The startup script is still running but the agent is ready to accept connections.",
3835
),
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."),
4239
START_TIMEOUT_READY(
43-
CoderIcons.RUNNING,
4440
"Starting",
4541
"The startup script is taking longer than expected but the agent is ready to accept connections.",
4642
),
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."),
5248
;
5349

5450
fun statusColor(): JBColor =

src/main/resources/icons/off.svg

-6
This file was deleted.

src/main/resources/icons/pending.svg

-7
This file was deleted.

src/main/resources/icons/running.svg

-6
This file was deleted.

0 commit comments

Comments
 (0)