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

impl: auto-connect to toolbox backend#24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fioan89 merged 2 commits intomainfromimpl-ssh-auto-connect
Mar 9, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletionssrc/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,31 +106,27 @@ class CoderRemoteEnvironment(
override suspend
fun getContentsView(): EnvironmentContentsView = EnvironmentView(client.url, workspace, agent)

override val connectionRequest: MutableStateFlow<Boolean>? = MutableStateFlow(false)

/**
* Does nothing. In theory, we could do something like start the workspace
* when you click into the workspace, but you would still need to press
* "connect" anyway before the content is populated so there does not seem
* to be much value.
*/
override fun setVisible(visibilityState: EnvironmentVisibilityState) {}

/**
* Immediately send the state to the listener and store for updates.
*/
// override fun addStateListener(consumer: EnvironmentStateConsumer): Boolean {
// // TODO@JB: It would be ideal if we could have the workspace state and
// // the connected state listed separately, since right now the
// // connected state can mask the workspace state.
// // TODO@JB: You can still press connect if the environment is
// // unreachable. Is that expected?
// consumer.consume(status.toRemoteEnvironmentState(serviceLocator))
// return super.addStateListener(consumer)
// }
override fun setVisible(visibilityState: EnvironmentVisibilityState) {
if (wsRawStatus.ready() && visibilityState.contentsVisible == true && visibilityState.isBackendConnected == false) {
context.logger.info("Connecting to $id...")
context.cs.launch {
connectionRequest?.update {
true
}
}
}
}

override fun onDelete() {
context.cs.launch {
// TODO info and cancel pop-ups only appear on the main page where all environments are listed.
// However, #showSnackbar works on other pages. Until JetBrains fixes this issue we are going to use the snackbar
val shouldDelete = if (wsRawStatus.canStop()) {
context.ui.showOkCancelPopup(
context.i18n.ptrl("Delete running workspace?"),
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp