(info: &WorkspaceInfo)
| 53 | } |
| 54 | |
| 55 | fn remote_workspace_from_info(info: &WorkspaceInfo) -> Option<crate::api::RemoteWorkspace> { |
| 56 | if info.workspace_kind != WorkspaceKind::Remote { |
| 57 | return None; |
| 58 | } |
| 59 | let cid = info.metadata.get("connectionId")?.as_str()?.to_string(); |
| 60 | let name = info |
| 61 | .metadata |
| 62 | .get("connectionName") |
| 63 | .and_then(|v| v.as_str()) |
| 64 | .unwrap_or(&cid) |
| 65 | .to_string(); |
| 66 | let rp = bitfun_core::service::remote_ssh::normalize_remote_workspace_path( |
| 67 | &info.root_path.to_string_lossy(), |
| 68 | ); |
| 69 | let ssh_host = info |
| 70 | .metadata |
| 71 | .get("sshHost") |
| 72 | .and_then(|v| v.as_str()) |
| 73 | .unwrap_or("") |
| 74 | .to_string(); |
| 75 | Some(crate::api::RemoteWorkspace { |
| 76 | connection_id: cid, |
| 77 | remote_path: rp, |
| 78 | connection_name: name, |
| 79 | ssh_host, |
| 80 | }) |
| 81 | } |
| 82 | |
| 83 | fn lock_active_searches<'a>( |
| 84 | state: &'a State<'_, AppState>, |
no test coverage detected