Skip to content

Commit ad268b8

Browse files
committed
Merge branch 'main' into 6852-display-name
2 parents a0554df + 90e2bab commit ad268b8

File tree

15 files changed

+780
-91
lines changed

15 files changed

+780
-91
lines changed

site/src/api/api.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,15 +489,29 @@ export const postWorkspaceBuild = async (
489489
export const startWorkspace = (
490490
workspaceId: string,
491491
templateVersionID: string,
492+
logLevel?: TypesGen.CreateWorkspaceBuildRequest["log_level"],
492493
) =>
493494
postWorkspaceBuild(workspaceId, {
494495
transition: "start",
495496
template_version_id: templateVersionID,
497+
log_level: logLevel,
498+
})
499+
export const stopWorkspace = (
500+
workspaceId: string,
501+
logLevel?: TypesGen.CreateWorkspaceBuildRequest["log_level"],
502+
) =>
503+
postWorkspaceBuild(workspaceId, {
504+
transition: "stop",
505+
log_level: logLevel,
506+
})
507+
export const deleteWorkspace = (
508+
workspaceId: string,
509+
logLevel?: TypesGen.CreateWorkspaceBuildRequest["log_level"],
510+
) =>
511+
postWorkspaceBuild(workspaceId, {
512+
transition: "delete",
513+
log_level: logLevel,
496514
})
497-
export const stopWorkspace = (workspaceId: string) =>
498-
postWorkspaceBuild(workspaceId, { transition: "stop" })
499-
export const deleteWorkspace = (workspaceId: string) =>
500-
postWorkspaceBuild(workspaceId, { transition: "delete" })
501515

502516
export const cancelWorkspaceBuild = async (
503517
workspaceBuildId: TypesGen.WorkspaceBuild["id"],

site/src/components/AlertBanner/AlertBanner.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ export const AlertBanner: FC<React.PropsWithChildren<AlertBannerProps>> = ({
6060
spacing={0}
6161
justifyContent="space-between"
6262
>
63-
<Stack direction="row" alignItems="center" spacing={1}>
63+
<Stack
64+
direction="row"
65+
alignItems="center"
66+
spacing={2}
67+
className={classes.fullWidth}
68+
>
6469
{severityConstants[severity].icon}
65-
<Stack spacing={0}>
70+
<Stack spacing={0} className={classes.fullWidth}>
6671
{children}
6772
{alertMessage}
6873
{detail && (
@@ -94,11 +99,11 @@ const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
9499
borderColor: severityConstants[props.severity].color,
95100
border: `1px solid ${colors.orange[7]}`,
96101
borderRadius: theme.shape.borderRadius,
97-
padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`,
102+
padding: theme.spacing(2),
98103
backgroundColor: `${colors.gray[16]}`,
99104
textAlign: "left",
100105

101-
"& span": {
106+
"& > span": {
102107
paddingTop: `${theme.spacing(0.25)}px`,
103108
},
104109

@@ -108,4 +113,8 @@ const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
108113
marginRight: `${theme.spacing(1)}px`,
109114
},
110115
}),
116+
117+
fullWidth: {
118+
width: "100%",
119+
},
111120
}))

site/src/components/AlertBanner/severityConstants.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,20 @@ export const severityConstants: Record<
1313
color: colors.orange[7],
1414
icon: (
1515
<ReportProblemOutlinedIcon
16-
fontSize="small"
17-
style={{ color: colors.orange[7] }}
16+
style={{ color: colors.orange[7], fontSize: 16 }}
1817
/>
1918
),
2019
},
2120
error: {
2221
color: colors.red[7],
2322
icon: (
2423
<ErrorOutlineOutlinedIcon
25-
fontSize="small"
26-
style={{ color: colors.red[7] }}
24+
style={{ color: colors.red[7], fontSize: 16 }}
2725
/>
2826
),
2927
},
3028
info: {
3129
color: colors.blue[7],
32-
icon: (
33-
<InfoOutlinedIcon fontSize="small" style={{ color: colors.blue[7] }} />
34-
),
30+
icon: <InfoOutlinedIcon style={{ color: colors.blue[7], fontSize: 16 }} />,
3531
},
3632
}

site/src/components/Logs/Logs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const useStyles = makeStyles<
9393
background: theme.palette.background.default,
9494
},
9595
scrollWrapper: {
96-
width: "fit-content",
96+
minWidth: "fit-content",
9797
},
9898
line: {
9999
wordBreak: "break-all",
@@ -109,7 +109,7 @@ const useStyles = makeStyles<
109109
},
110110

111111
"&.debug": {
112-
backgroundColor: theme.palette.grey[900],
112+
backgroundColor: theme.palette.background.paperLight,
113113
},
114114

115115
"&.warn": {

site/src/components/Resources/AgentRow.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface AgentRowProps {
4444
applicationsHost: string | undefined
4545
showApps: boolean
4646
hideSSHButton?: boolean
47+
sshPrefix?: string
4748
hideVSCodeDesktopButton?: boolean
4849
serverVersion: string
4950
onUpdateAgent: () => void
@@ -61,6 +62,7 @@ export const AgentRow: FC<AgentRowProps> = ({
6162
serverVersion,
6263
onUpdateAgent,
6364
storybookStartupLogs,
65+
sshPrefix,
6466
}) => {
6567
const styles = useStyles()
6668
const { t } = useTranslation("agent")
@@ -308,6 +310,7 @@ export const AgentRow: FC<AgentRowProps> = ({
308310
<SSHButton
309311
workspaceName={workspace.name}
310312
agentName={agent.name}
313+
sshPrefix={sshPrefix}
311314
/>
312315
)}
313316
{!hideVSCodeDesktopButton && (

site/src/components/SSHButton/SSHButton.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ export const Closed = Template.bind({})
1313
Closed.args = {
1414
workspaceName: MockWorkspace.name,
1515
agentName: MockWorkspaceAgent.name,
16+
sshPrefix: "coder.",
1617
}
1718

1819
export const Opened = Template.bind({})
1920
Opened.args = {
2021
workspaceName: MockWorkspace.name,
2122
agentName: MockWorkspaceAgent.name,
2223
defaultIsOpen: true,
24+
sshPrefix: "coder.",
2325
}

site/src/components/SSHButton/SSHButton.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ export interface SSHButtonProps {
1515
workspaceName: string
1616
agentName: string
1717
defaultIsOpen?: boolean
18+
sshPrefix?: string
1819
}
1920

2021
export const SSHButton: React.FC<React.PropsWithChildren<SSHButtonProps>> = ({
2122
workspaceName,
2223
agentName,
2324
defaultIsOpen = false,
25+
sshPrefix,
2426
}) => {
2527
const anchorRef = useRef<HTMLButtonElement>(null)
2628
const [isOpen, setIsOpen] = useState(defaultIsOpen)
@@ -79,7 +81,9 @@ export const SSHButton: React.FC<React.PropsWithChildren<SSHButtonProps>> = ({
7981
Connect to the agent:
8082
</strong>
8183
</HelpTooltipText>
82-
<CodeExample code={`ssh coder.${workspaceName}.${agentName}`} />
84+
<CodeExample
85+
code={`ssh ${sshPrefix}${workspaceName}.${agentName}`}
86+
/>
8387
</div>
8488
</Stack>
8589

0 commit comments

Comments
 (0)