diff --git a/site/src/components/AppLink/AppLink.tsx b/site/src/components/AppLink/AppLink.tsx index 2ac76d686b457..6e1df2055ecdd 100644 --- a/site/src/components/AppLink/AppLink.tsx +++ b/site/src/components/AppLink/AppLink.tsx @@ -84,7 +84,6 @@ export const AppLink: FC = ({ const button = ( + ) : ( + + )} + + + + setStartupScriptOpen(false)} + anchorEl={startupScriptAnchorRef.current} + > +
+ + {agent.startup_script || ""} + +
+
+ + )} ) } const useStyles = makeStyles((theme) => ({ - agentWrapper: { - "&:not(:last-child)": { - borderBottom: `1px solid ${theme.palette.divider}`, - }, - }, - agentRow: { - padding: theme.spacing(3, 4), backgroundColor: theme.palette.background.paperLight, fontSize: 16, + borderLeft: `2px solid ${theme.palette.text.secondary}`, + + "&:not(:first-child)": { + borderTop: `2px solid ${theme.palette.divider}`, + }, }, - startupLinks: { - display: "flex", - alignItems: "center", - gap: theme.spacing(2), - marginTop: theme.spacing(0.5), + "agentRow-connected": { + borderLeftColor: theme.palette.success.light, }, - startupLink: { - cursor: "pointer", + "agentRow-disconnected": { + borderLeftColor: theme.palette.text.secondary, + }, + + "agentRow-connecting": { + borderLeftColor: theme.palette.info.light, + }, + + "agentRow-timeout": { + borderLeftColor: theme.palette.warning.light, + }, + + "agentRow-lifecycle-created": {}, + + "agentRow-lifecycle-starting": { + borderLeftColor: theme.palette.info.light, + }, + + "agentRow-lifecycle-ready": { + borderLeftColor: theme.palette.success.light, + }, + + "agentRow-lifecycle-start_timeout": { + borderLeftColor: theme.palette.warning.light, + }, + + "agentRow-lifecycle-start_error": { + borderLeftColor: theme.palette.error.light, + }, + + "agentRow-lifecycle-shutting_down": { + borderLeftColor: theme.palette.info.light, + }, + + "agentRow-lifecycle-shutdown_timeout": { + borderLeftColor: theme.palette.warning.light, + }, + + "agentRow-lifecycle-shutdown_error": { + borderLeftColor: theme.palette.error.light, + }, + + "agentRow-lifecycle-off": { + borderLeftColor: theme.palette.text.secondary, + }, + + agentInfo: { + padding: theme.spacing(2, 4), + }, + + agentDefaultActions: { display: "flex", - gap: 4, - alignItems: "center", - userSelect: "none", - whiteSpace: "nowrap", + gap: theme.spacing(1), + marginLeft: "auto", + }, - "& svg": { - width: 12, - height: 12, - }, + agentDescription: { + fontSize: 14, + color: theme.palette.text.secondary, }, startupLogs: { maxHeight: 256, - background: theme.palette.background.default, + borderBottom: `1px solid ${theme.palette.divider}`, + backgroundColor: theme.palette.background.paper, + paddingTop: theme.spacing(2), + + // We need this to be able to apply the padding top from startupLogs + "& > div": { + position: "relative", + }, }, startupScriptPopover: { backgroundColor: theme.palette.background.default, }, - agentStatusWrapper: { - width: theme.spacing(4.5), + agentNameAndStatus: { display: "flex", - justifyContent: "center", + alignItems: "center", + gap: theme.spacing(4), }, agentName: { + whiteSpace: "nowrap", + overflow: "hidden", + textOverflow: "ellipsis", + maxWidth: 260, fontWeight: 600, + fontSize: theme.spacing(2), }, - agentOS: { - textTransform: "capitalize", + agentDataGroup: { + display: "flex", + alignItems: "baseline", + gap: theme.spacing(6), }, agentData: { - fontSize: 14, + display: "flex", + flexDirection: "column", + fontSize: 12, + + "& > *:first-child": { + fontWeight: 500, + color: theme.palette.text.secondary, + }, + }, + + apps: { + display: "flex", + flexWrap: "wrap", + gap: theme.spacing(1.5), + padding: theme.spacing(4), + borderTop: `1px solid ${theme.palette.divider}`, + }, + + logsPanel: { + borderTop: `1px solid ${theme.palette.divider}`, + }, + + logsPanelButtons: { + display: "flex", + }, + + logsPanelButton: { + textAlign: "left", + background: "transparent", + border: 0, + fontFamily: "inherit", + padding: theme.spacing(1.5, 4), color: theme.palette.text.secondary, + cursor: "pointer", + display: "flex", + alignItems: "center", + gap: theme.spacing(1), + whiteSpace: "nowrap", + + "&:hover": { + color: theme.palette.text.primary, + backgroundColor: colors.gray[14], + }, + + "& svg": { + color: "inherit", + }, + }, + + toggleLogsButton: { + width: "100%", + }, + + buttonSkeleton: { + borderRadius: 4, + }, + + agentErrorMessage: { + fontSize: 12, + fontWeight: 400, marginTop: theme.spacing(0.5), + color: theme.palette.warning.light, }, - agentStartupLogs: { - maxHeight: 200, - display: "flex", - flexDirection: "column-reverse", + scriptButton: { + "& svg": { + width: theme.spacing(2), + height: theme.spacing(2), + }, + }, + + agentOS: { + textTransform: "capitalize", }, })) diff --git a/site/src/components/Resources/AgentStatus.tsx b/site/src/components/Resources/AgentStatus.tsx index eedd521034e02..d03fb1c664e32 100644 --- a/site/src/components/Resources/AgentStatus.tsx +++ b/site/src/components/Resources/AgentStatus.tsx @@ -391,6 +391,7 @@ const useStyles = makeStyles((theme) => ({ width: theme.spacing(1), height: theme.spacing(1), borderRadius: "100%", + flexShrink: 0, }, connected: { @@ -421,17 +422,15 @@ const useStyles = makeStyles((theme) => ({ timeoutWarning: { color: theme.palette.warning.light, - width: theme.spacing(2.5), - height: theme.spacing(2.5), + width: theme.spacing(2), + height: theme.spacing(2), position: "relative", - top: theme.spacing(1), }, errorWarning: { color: theme.palette.error.main, - width: theme.spacing(2.5), - height: theme.spacing(2.5), + width: theme.spacing(2), + height: theme.spacing(2), position: "relative", - top: theme.spacing(1), }, })) diff --git a/site/src/components/Resources/AgentVersion.tsx b/site/src/components/Resources/AgentVersion.tsx index 2f21e79ecff39..713609b686197 100644 --- a/site/src/components/Resources/AgentVersion.tsx +++ b/site/src/components/Resources/AgentVersion.tsx @@ -13,13 +13,10 @@ export const AgentVersion: FC<{ const anchorRef = useRef(null) const [isOpen, setIsOpen] = useState(false) const id = isOpen ? "version-outdated-popover" : undefined - const { displayVersion, outdated } = getDisplayVersionStatus( - agent.version, - serverVersion, - ) + const { outdated } = getDisplayVersionStatus(agent.version, serverVersion) if (!outdated) { - return {displayVersion} + return Updated } return ( @@ -32,7 +29,7 @@ export const AgentVersion: FC<{ onMouseLeave={() => setIsOpen(false)} className={styles.trigger} > - Agent Outdated + Outdated > = ({ <> ({ }, button: { - whiteSpace: "nowrap", - backgroundColor: theme.palette.background.default, - - "&:hover": { - backgroundColor: `${theme.palette.background.default} !important`, - }, + fontSize: 12, + fontWeight: 500, + height: theme.spacing(4), + minHeight: theme.spacing(4), + borderRadius: 4, }, })) diff --git a/site/src/components/TerminalLink/TerminalLink.tsx b/site/src/components/TerminalLink/TerminalLink.tsx index ded51c01d9f94..c4cb39ff1ba38 100644 --- a/site/src/components/TerminalLink/TerminalLink.tsx +++ b/site/src/components/TerminalLink/TerminalLink.tsx @@ -1,7 +1,5 @@ import Button from "@material-ui/core/Button" -import Link from "@material-ui/core/Link" import { makeStyles } from "@material-ui/core/styles" -import ComputerIcon from "@material-ui/icons/Computer" import { FC } from "react" import * as TypesGen from "../../api/typesGenerated" import { combineClasses } from "../../utils/combineClasses" @@ -30,7 +28,7 @@ export const TerminalLink: FC> = ({ agentName, userName = "me", workspaceName, - className, + className = "", }) => { const styles = useStyles() const href = `/@${userName}/${workspaceName}${ @@ -38,9 +36,12 @@ export const TerminalLink: FC> = ({ }/terminal` return ( - { event.preventDefault() @@ -51,28 +52,17 @@ export const TerminalLink: FC> = ({ ) }} > - - + {Language.linkText} + ) } const useStyles = makeStyles((theme) => ({ - link: { - textDecoration: "none !important", - }, - button: { - whiteSpace: "nowrap", - backgroundColor: theme.palette.background.default, - - "&:hover": { - backgroundColor: `${theme.palette.background.default} !important`, - }, + fontSize: 12, + fontWeight: 500, + height: theme.spacing(4), + minHeight: theme.spacing(4), + borderRadius: 4, }, })) diff --git a/site/src/components/VSCodeDesktopButton/VSCodeDesktopButton.tsx b/site/src/components/VSCodeDesktopButton/VSCodeDesktopButton.tsx index 03789b490e25b..42fd9e430007e 100644 --- a/site/src/components/VSCodeDesktopButton/VSCodeDesktopButton.tsx +++ b/site/src/components/VSCodeDesktopButton/VSCodeDesktopButton.tsx @@ -20,7 +20,6 @@ export const VSCodeDesktopButton: FC< return (