diff --git a/site/src/components/Resources/Resources.tsx b/site/src/components/Resources/Resources.tsx index f96dc3c4bac03..1b1e7db51684d 100644 --- a/site/src/components/Resources/Resources.tsx +++ b/site/src/components/Resources/Resources.tsx @@ -7,8 +7,9 @@ import TableHead from "@material-ui/core/TableHead" import TableRow from "@material-ui/core/TableRow" import useTheme from "@material-ui/styles/useTheme" import { ErrorSummary } from "components/ErrorSummary/ErrorSummary" +import { TableCellDataPrimary } from "components/TableCellData/TableCellData" import { FC } from "react" -import { getDisplayAgentStatus, getWorkspaceStatus, WorkspaceStateEnum } from "util/workspace" +import { getDisplayAgentStatus } from "util/workspace" import { Workspace, WorkspaceResource } from "../../api/typesGenerated" import { AppLink } from "../AppLink/AppLink" import { SSHButton } from "../SSHButton/SSHButton" @@ -24,6 +25,8 @@ const Language = { resourceLabel: "Resource", agentsLabel: "Agents", agentLabel: "Agent", + statusLabel: "status: ", + osLabel: "os: ", } interface ResourcesProps { @@ -42,10 +45,6 @@ export const Resources: FC> = ({ const styles = useStyles() const theme: Theme = useTheme() - const workspaceStatus: keyof typeof WorkspaceStateEnum = getWorkspaceStatus( - workspace.latest_build, - ) - return (
{getResourcesError ? ( @@ -103,21 +102,24 @@ export const Resources: FC> = ({ )} - {agent.name} -
- {agent.operating_system} - {WorkspaceStateEnum[workspaceStatus] !== - WorkspaceStateEnum["stopped"] && ( + {agent.name} +
+
+ {Language.statusLabel} {agentStatus.status} - )} +
+
+ {Language.osLabel} + {agent.operating_system} +
- <> +
{canUpdateWorkspace && agent.status === "connected" && ( -
+ <> > = ({ agentName={agent.name} /> ))} -
+ )} - +
) @@ -181,14 +183,6 @@ const useStyles = makeStyles((theme) => ({ paddingLeft: `${theme.spacing(4)}px !important`, }, - agentInfo: { - display: "flex", - gap: theme.spacing(1.5), - fontSize: 14, - color: theme.palette.text.secondary, - marginTop: theme.spacing(0.5), - }, - operatingSystem: { display: "block", textTransform: "capitalize", @@ -204,4 +198,23 @@ const useStyles = makeStyles((theme) => ({ status: { whiteSpace: "nowrap", }, + + data: { + color: theme.palette.text.secondary, + fontSize: 14, + marginTop: theme.spacing(0.75), + display: "grid", + gridAutoFlow: "row", + whiteSpace: "nowrap", + gap: theme.spacing(0.75), + }, + + dataRow: { + display: "flex", + alignItems: "center", + + "& strong": { + marginRight: theme.spacing(1), + }, + }, }))