Skip to content

feat(site): add numbers to SSHButton content for clarity #15661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 12, 2024
46 changes: 25 additions & 21 deletions site/src/modules/resources/SSHButton/SSHButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,18 @@ export const SSHButton: FC<SSHButtonProps> = ({
Run the following commands to connect with SSH:
</HelpTooltipText>

<Stack spacing={0.5} css={styles.codeExamples}>
<div>
<HelpTooltipText>
<strong css={styles.codeExampleLabel}>
Configure SSH hosts on machine:
</strong>
</HelpTooltipText>
<CodeExample secret={false} code="coder config-ssh" />
</div>

<div>
<HelpTooltipText>
<strong css={styles.codeExampleLabel}>
Connect to the agent:
</strong>
</HelpTooltipText>
<CodeExample
secret={false}
code={`ssh ${sshPrefix}${workspaceName}.${agentName}`}
<ol style={{ margin: 0, padding: 0 }}>
<Stack spacing={0.5} css={styles.codeExamples}>
<SSHStep
helpText="Configure SSH hosts on machine:"
codeExample="coder config-ssh"
/>
<SSHStep
helpText="Connect to the agent:"
codeExample={`ssh ${sshPrefix}${workspaceName}.${agentName}`}
/>
</div>
</Stack>
</Stack>
</ol>

<HelpTooltipLinksGroup>
<HelpTooltipLink href={docs("/install")}>
Expand All @@ -92,6 +82,20 @@ export const SSHButton: FC<SSHButtonProps> = ({
);
};

interface SSHStepProps {
helpText: string;
codeExample: string;
}

const SSHStep: FC<SSHStepProps> = ({ helpText, codeExample }) => (
<li style={{ listStylePosition: "inside" }}>
<HelpTooltipText style={{ display: "inline" }}>
<strong css={styles.codeExampleLabel}>{helpText}</strong>
</HelpTooltipText>
<CodeExample secret={false} code={codeExample} />
</li>
);

const classNames = {
paper: (css, theme) => css`
padding: 16px 24px 24px;
Expand Down
Loading