Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions site/src/components/Resources/Resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, wo
<TableHeaderRow>
<TableCell>{Language.resourceLabel}</TableCell>
<TableCell className={styles.agentColumn}>{Language.agentLabel}</TableCell>
<TableCell>{Language.statusLabel}</TableCell>
<TableCell>{Language.accessLabel}</TableCell>
<TableCell>{Language.statusLabel}</TableCell>
</TableHeaderRow>
</TableHead>
<TableBody>
Expand Down Expand Up @@ -82,11 +82,6 @@ export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, wo
{agent.name}
<span className={styles.operatingSystem}>{agent.operating_system}</span>
</TableCell>
<TableCell>
<span style={{ color: getDisplayAgentStatus(theme, agent).color }}>
{getDisplayAgentStatus(theme, agent).status}
</span>
</TableCell>
<TableCell>
{agent.status === "connected" && (
<TerminalLink
Expand All @@ -97,6 +92,11 @@ export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, wo
/>
)}
</TableCell>
<TableCell>
<span style={{ color: getDisplayAgentStatus(theme, agent).color }}>
{getDisplayAgentStatus(theme, agent).status}
</span>
</TableCell>
</TableRow>
)
})
Expand Down
62 changes: 33 additions & 29 deletions site/src/components/Workspace/Workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,43 +42,43 @@ export const Workspace: FC<WorkspaceProps> = ({

return (
<div className={styles.root}>
<div className={styles.header}>
<div>
<Typography variant="h4" className={styles.title}>
{workspace.name}
</Typography>
<Stack direction="row" spacing={3}>
<Stack direction="column" className={styles.firstColumnSpacer} spacing={3}>
<div className={styles.header}>
<div>
<Typography variant="h4" className={styles.title}>
{workspace.name}
</Typography>

<Typography color="textSecondary" className={styles.subtitle}>
{workspace.owner_name}
</Typography>
</div>
<Typography color="textSecondary" className={styles.subtitle}>
{workspace.owner_name}
</Typography>
</div>
<WorkspaceActions
workspace={workspace}
handleStart={handleStart}
handleStop={handleStop}
handleDelete={handleDelete}
handleUpdate={handleUpdate}
handleCancel={handleCancel}
/>
</div>
</Stack>

<div className={styles.headerActions}>
<WorkspaceActions
workspace={workspace}
handleStart={handleStart}
handleStop={handleStop}
handleDelete={handleDelete}
handleUpdate={handleUpdate}
handleCancel={handleCancel}
/>
</div>
</div>
<Stack direction="column" className={styles.secondColumnSpacer} spacing={3}></Stack>
</Stack>

<Stack direction="row" spacing={3} className={styles.layout}>
<Stack spacing={3} className={styles.main}>
<Stack direction="row" spacing={3}>
<Stack direction="column" className={styles.firstColumnSpacer} spacing={3}>
<WorkspaceScheduleBanner workspace={workspace} />

<WorkspaceStats workspace={workspace} />

<Resources resources={resources} getResourcesError={getResourcesError} workspace={workspace} />

<WorkspaceSection title="Timeline" contentsProps={{ className: styles.timelineContents }}>
<BuildsTable builds={builds} className={styles.timelineTable} />
</WorkspaceSection>
</Stack>

<Stack spacing={3} className={styles.sidebar}>
<Stack direction="column" className={styles.secondColumnSpacer} spacing={3}>
<WorkspaceSchedule workspace={workspace} />
</Stack>
</Stack>
Expand All @@ -92,15 +92,19 @@ export const useStyles = makeStyles((theme) => {
display: "flex",
flexDirection: "column",
},
firstColumnSpacer: {
flex: 2,
},
secondColumnSpacer: {
flex: "0 0 170px",
},
header: {
paddingTop: theme.spacing(5),
paddingBottom: theme.spacing(5),
fontFamily: MONOSPACE_FONT_FAMILY,
display: "flex",
alignItems: "center",
},
headerActions: {
marginLeft: "auto",
justifyContent: "space-between",
},
title: {
fontWeight: 600,
Expand Down
18 changes: 9 additions & 9 deletions site/src/components/WorkspaceActions/WorkspaceActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import { Stack } from "../Stack/Stack"
import { WorkspaceActionButton } from "../WorkspaceActionButton/WorkspaceActionButton"

export const Language = {
stop: "Stop workspace",
stopping: "Stopping workspace",
start: "Start workspace",
starting: "Starting workspace",
delete: "Delete workspace",
deleting: "Deleting workspace",
cancel: "Cancel action",
update: "Update workspace",
stop: "Stop",
stopping: "Stopping",
start: "Start",
starting: "Starting",
delete: "Delete",
deleting: "Deleting",
cancel: "Cancel",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still say "Cancel action" here because it's the one case where the object is not the workspace. Open to thoughts!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call - this was a mistake!

update: "Update",
}

/**
Expand Down Expand Up @@ -111,6 +111,6 @@ const useStyles = makeStyles((theme) => ({
actionButton: {
// Set fixed width for the action buttons so they will not change the size
// during the transitions
width: theme.spacing(27),
width: theme.spacing(16),
},
}))
20 changes: 10 additions & 10 deletions site/src/components/WorkspaceStats/WorkspaceStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({ workspace }) => {
</Link>
</div>
<div className={styles.statsDivider} />
<div className={styles.statItem}>
<span className={styles.statsLabel}>{Language.statusLabel}</span>
<span className={styles.statsValue}>
<span style={{ color: status.color }} role="status">
{status.status}
</span>
</span>
</div>
<div className={styles.statsDivider} />
<div className={styles.statItem}>
<span className={styles.statsLabel}>{Language.versionLabel}</span>
<span className={styles.statsValue}>
Expand All @@ -65,6 +56,15 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({ workspace }) => {
{dayjs().to(dayjs(workspace.latest_build.created_at))}
</span>
</div>
<div className={styles.statsDivider} />
<div className={styles.statItem}>
<span className={styles.statsLabel}>{Language.statusLabel}</span>
<span className={styles.statsValue}>
<span style={{ color: status.color }} role="status">
{status.status}
</span>
</span>
</div>
</div>
)
}
Expand All @@ -83,7 +83,7 @@ const useStyles = makeStyles((theme) => ({
},

statItem: {
minWidth: theme.spacing(20),
minWidth: "20%",
padding: theme.spacing(2),
paddingTop: theme.spacing(1.75),
},
Expand Down