Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfcb9dc7

Browse files
authored
impl: workspace status reporting (color and icons) (#118)
There were a couple of discrepancies in the status reporting especiallyaround icons and colors:- offline workspaces are marked by a new "offline" icon and a gray color(instead of a half pie icon with a red color)- stopping state now has a gray progress spinner- same for deleting state which previously used the offline icon insteadof the spinner.- failed workspaces used to render a gray offline icon instead of a redwarning (exclamation mark) sign.- there was no progress while establishing the SSH connection. Now wehave a "SSHing" label with a circular progress bar while connecting tothe SSH.
1 parentdd2166f commitfcb9dc7

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

‎CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
##Unreleased
44

5+
###Changed
6+
7+
- improved workspace status reporting (icon and colors) when it is failed, stopping, deleting, stopped or when we are
8+
establishing the SSH connection.
9+
510
##0.2.2 - 2025-05-21
611

712
###Added

‎src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ class CoderRemoteEnvironment(
157157

158158
overridefunbeforeConnection() {
159159
context.logger.info("Connecting to$id...")
160+
context.cs.launch {
161+
state.update {
162+
wsRawStatus.toSshConnectingEnvState(context)
163+
}
164+
}
160165
isConnected.update {true }
161166
pollJob= pollNetworkMetrics()
162167
}

‎src/main/kotlin/com/coder/toolbox/models/WorkspaceAndAgentStatus.kt

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import com.jetbrains.toolbox.api.remoteDev.states.CustomRemoteEnvironmentState
1111
importcom.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateIcons
1212
importcom.jetbrains.toolbox.api.remoteDev.states.StandardRemoteEnvironmentState
1313

14+
15+
privatevalCircularSpinner:EnvironmentStateIcons=EnvironmentStateIcons.Connecting
16+
1417
/**
1518
* WorkspaceAndAgentStatus represents the combined status of a single agent and
1619
* its workspace (or just the workspace if there are no agents).
@@ -69,23 +72,34 @@ enum class WorkspaceAndAgentStatus(val label: String, val description: String) {
6972
}
7073

7174
privatefungetStateColor(context:CoderToolboxContext):StateColor {
72-
returnif (ready()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Active)
73-
elseif (unhealthy()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Unhealthy)
74-
elseif (canStart()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Failed)
75-
elseif (pending()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Activating)
75+
returnif (this==FAILED) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.FailedToStart)
7676
elseif (this==DELETING) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Deleting)
7777
elseif (this==DELETED) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Deleted)
78+
elseif (ready()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Active)
79+
elseif (unhealthy()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Unhealthy)
80+
elseif (canStart()||this==STOPPING) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Hibernating)
81+
elseif (pending()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Activating)
7882
else context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Unreachable)
7983
}
8084

8185
privatefungetStateIcon():EnvironmentStateIcons {
82-
returnif (ready()|| unhealthy())EnvironmentStateIcons.Active
83-
elseif (canStart())EnvironmentStateIcons.Hibernated
84-
elseif (pending())EnvironmentStateIcons.Connecting
85-
elseif (this==DELETING||this==DELETED)EnvironmentStateIcons.Offline
86+
returnif (this==FAILED)EnvironmentStateIcons.Error
87+
elseif (pending()||this==DELETING||this==DELETED||this==STOPPING)CircularSpinner
88+
elseif (ready()|| unhealthy())EnvironmentStateIcons.Active
89+
elseif (canStart())EnvironmentStateIcons.Offline
8690
elseEnvironmentStateIcons.NoIcon
8791
}
8892

93+
funtoSshConnectingEnvState(context:CoderToolboxContext):CustomRemoteEnvironmentState {
94+
val existingState= toRemoteEnvironmentState(context)
95+
returnCustomRemoteEnvironmentState(
96+
"SSHing",
97+
existingState.color,
98+
existingState.isReachable,
99+
EnvironmentStateIcons.Connecting
100+
)
101+
}
102+
89103
/**
90104
* Return true if the agent is in a connectable state.
91105
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp