({
workspaceName,
agentName,
workspaceOwnerUsername,
})
| 23 | } |
| 24 | |
| 25 | export const AgentSSHButton: FC<AgentSSHButtonProps> = ({ |
| 26 | workspaceName, |
| 27 | agentName, |
| 28 | workspaceOwnerUsername, |
| 29 | }) => { |
| 30 | const { data } = useQuery(deploymentSSHConfig()); |
| 31 | const sshSuffix = data?.hostname_suffix; |
| 32 | |
| 33 | return ( |
| 34 | <Popover> |
| 35 | <PopoverTrigger asChild> |
| 36 | <Button size="sm" variant="subtle"> |
| 37 | Connect via SSH |
| 38 | <ChevronDownIcon /> |
| 39 | </Button> |
| 40 | </PopoverTrigger> |
| 41 | |
| 42 | <PopoverContent |
| 43 | align="end" |
| 44 | className="py-4 px-6 w-80 text-content-secondary mt-[2px] bg-surface-secondary" |
| 45 | > |
| 46 | <HelpPopoverText> |
| 47 | Run the following commands to connect with SSH: |
| 48 | </HelpPopoverText> |
| 49 | |
| 50 | <ol style={{ margin: 0, padding: 0 }}> |
| 51 | <div className="flex flex-col gap-1 mt-3"> |
| 52 | <SSHStep |
| 53 | helpText="Configure SSH hosts on machine:" |
| 54 | codeExample="coder config-ssh" |
| 55 | /> |
| 56 | <SSHStep |
| 57 | helpText="Connect to the agent:" |
| 58 | codeExample={`ssh ${agentName}.${workspaceName}.${workspaceOwnerUsername}.${sshSuffix}`} |
| 59 | /> |
| 60 | </div> |
| 61 | </ol> |
| 62 | |
| 63 | <HelpPopoverLinksGroup> |
| 64 | <HelpPopoverLink href="/install">Install Coder CLI</HelpPopoverLink> |
| 65 | <HelpPopoverLink href={docs("/user-guides/workspace-access/vscode")}> |
| 66 | Connect via VS Code Remote SSH |
| 67 | </HelpPopoverLink> |
| 68 | <HelpPopoverLink |
| 69 | href={docs("/user-guides/workspace-access/jetbrains")} |
| 70 | > |
| 71 | Connect via JetBrains IDEs |
| 72 | </HelpPopoverLink> |
| 73 | <HelpPopoverLink href={docs("/user-guides/desktop")}> |
| 74 | Connect via Coder Desktop |
| 75 | </HelpPopoverLink> |
| 76 | <HelpPopoverLink href={docs("/user-guides/workspace-access#ssh")}> |
| 77 | SSH configuration |
| 78 | </HelpPopoverLink> |
| 79 | </HelpPopoverLinksGroup> |
| 80 | </PopoverContent> |
| 81 | </Popover> |
| 82 | ); |
nothing calls this directly
no test coverage detected