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

@ -73,6 +73,7 @@ impl Database {
pub async fn create_dev_server(
&self,
name: &str,
ssh_connection_string: Option<&str>,
hashed_access_token: &str,
user_id: UserId,
) -> crate::Result<(dev_server::Model, proto::DevServerProjectsUpdate)> {
@ -86,6 +87,9 @@ impl Database {
hashed_token: ActiveValue::Set(hashed_access_token.to_string()),
name: ActiveValue::Set(name.trim().to_string()),
user_id: ActiveValue::Set(user_id),
ssh_connection_string: ActiveValue::Set(
ssh_connection_string.map(ToOwned::to_owned),
),
})
.exec_with_returning(&*tx)
.await?;

View file

@ -10,6 +10,7 @@ pub struct Model {
pub name: String,
pub user_id: UserId,
pub hashed_token: String,
pub ssh_connection_string: Option<String>,
}
impl ActiveModelBehavior for ActiveModel {}
@ -32,6 +33,7 @@ impl Model {
dev_server_id: self.id.to_proto(),
name: self.name.clone(),
status: status as i32,
ssh_connection_string: self.ssh_connection_string.clone(),
}
}
}