ssh: Add session state indicator to title bar (#18645)
 The indicator turns yellow when ssh client is trying to reconnect. Note that the state tracking is probably not ideal (we'll see how it pans out once we start dog-fooding), but at the very least "green=good" should be a decent mental model for now. Release Notes: - N/A
This commit is contained in:
parent
e2d613a803
commit
19b186671b
4 changed files with 66 additions and 5 deletions
|
@ -1217,7 +1217,10 @@ impl Project {
|
|||
server.ssh_connection_string.is_some()
|
||||
}
|
||||
|
||||
pub fn ssh_connection_string(&self, cx: &ModelContext<Self>) -> Option<SharedString> {
|
||||
pub fn ssh_connection_string(&self, cx: &AppContext) -> Option<SharedString> {
|
||||
if let Some(ssh_state) = &self.ssh_client {
|
||||
return Some(ssh_state.connection_string().into());
|
||||
}
|
||||
let dev_server_id = self.dev_server_project_id()?;
|
||||
dev_server_projects::Store::global(cx)
|
||||
.read(cx)
|
||||
|
@ -1226,6 +1229,10 @@ impl Project {
|
|||
.clone()
|
||||
}
|
||||
|
||||
pub fn ssh_is_connected(&self) -> Option<bool> {
|
||||
Some(!self.ssh_client.as_ref()?.is_reconnect_underway())
|
||||
}
|
||||
|
||||
pub fn replica_id(&self) -> ReplicaId {
|
||||
match self.client_state {
|
||||
ProjectClientState::Remote { replica_id, .. } => replica_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue