Support terminals with ssh in remote projects (#11913)

Release Notes:

- Added a way to create terminal tabs in remote projects, if an ssh
connection string is specified
This commit is contained in:
Kirill Bulatov 2024-05-17 17:48:07 +03:00 committed by GitHub
parent 70888cf3d6
commit 8631280baa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 239 additions and 68 deletions

View file

@ -39,6 +39,7 @@ impl From<proto::DevServerProject> for DevServerProject {
pub struct DevServer {
pub id: DevServerId,
pub name: SharedString,
pub ssh_connection_string: Option<SharedString>,
pub status: DevServerStatus,
}
@ -48,6 +49,7 @@ impl From<proto::DevServer> for DevServer {
id: DevServerId(dev_server.dev_server_id),
status: dev_server.status(),
name: dev_server.name.into(),
ssh_connection_string: dev_server.ssh_connection_string.map(|s| s.into()),
}
}
}
@ -164,11 +166,17 @@ impl Store {
pub fn create_dev_server(
&mut self,
name: String,
ssh_connection_string: Option<String>,
cx: &mut ModelContext<Self>,
) -> Task<Result<proto::CreateDevServerResponse>> {
let client = self.client.clone();
cx.background_executor().spawn(async move {
let result = client.request(proto::CreateDevServer { name }).await?;
let result = client
.request(proto::CreateDevServer {
name,
ssh_connection_string,
})
.await?;
Ok(result)
})
}