diff --git a/site/src/modules/resources/AgentRow.tsx b/site/src/modules/resources/AgentRow.tsx index 203bc314ae..bc7e323504 100644 --- a/site/src/modules/resources/AgentRow.tsx +++ b/site/src/modules/resources/AgentRow.tsx @@ -1,4 +1,3 @@ -import Collapse from "@mui/material/Collapse"; import { CopyIcon, EllipsisIcon, @@ -31,6 +30,11 @@ import { CheckIcon } from "#/components/AnimatedIcons/Check"; import { ChevronDownIcon } from "#/components/AnimatedIcons/ChevronDown"; import { Badge } from "#/components/Badge/Badge"; import { Button } from "#/components/Button/Button"; +import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "#/components/Collapsible/Collapsible"; import { DropdownMenu, DropdownMenuContent, @@ -553,221 +557,232 @@ export const AgentRow: FC = ({
-
- -
- -
- {/* - Collapse's `in` condition is needed here, - or else the Spinner will also show as Collapse is closing - */} - {shouldExpandLogs && - !(hasConnectivityIssues || shouldShowLogsTabs) && ( - - )} - {hasConnectivityIssues && ( -
- {connectivityIssues.map((issue) => ( - - ))} -
- )} - {shouldShowLogsTabs && ( -
- -
-
- - {visibleLogTabs.map((tab) => ( - - {tab.startIcon} - - {tab.title} - - {tab.error && ( - - - - )} - - ))} - {overflowLogTabs.length > 0 && ( - - - - - - - {overflowLogTabs.map((tab) => ( - - {tab.startIcon} - - {tab.title} - - {tab.error && ( - - - - )} - - ))} - - - - )} - -
-
+ Logs + {agent.lifecycle_state === "starting" && + runningScriptsCount > 0 && + connectivityIssues.length === 0 && ( + - - - - - - - {showCopiedSuccess - ? "Copied!" - : "Copy selected logs"} - - - - -
-
- {/* - Using a singular TabsContent is necessary to avoid scrolling - issues when the selected log tab changes. - */} - - - {({ width }) => ( - - )} - - -
-
- )} + {runningScriptsCount} + + )} + {hasConnectivityIssues && ( + + {hasWarningConnectivityIssues ? ( + + ) : ( + + )} + {connectivityIssues.length} + + )} + +
-
+ +
+ {/* + Gate the spinner on `shouldExpandLogs` so it does not flash while + CollapsibleContent is closing. + */} + {shouldExpandLogs && + !(hasConnectivityIssues || shouldShowLogsTabs) && ( +
+ +
+ )} + {hasConnectivityIssues && ( +
+ {connectivityIssues.map((issue) => ( + + ))} +
+ )} + {shouldShowLogsTabs && ( +
+ +
+
+ + {visibleLogTabs.map((tab) => ( + + {tab.startIcon} + + {tab.title} + + {tab.error && ( + + + + )} + + ))} + {overflowLogTabs.length > 0 && ( + + + + + + + {overflowLogTabs.map((tab) => ( + + {tab.startIcon} + + {tab.title} + + {tab.error && ( + + + + )} + + ))} + + + + )} + +
+
+ + + + + + + {showCopiedSuccess + ? "Copied!" + : "Copy selected logs"} + + + + +
+
+ {/* + Using a singular TabsContent is necessary to avoid scrolling + issues when the selected log tab changes. + */} + + + {({ width }) => ( + + )} + + +
+
+ )} +
+
+
); diff --git a/site/src/modules/resources/AgentStatus.tsx b/site/src/modules/resources/AgentStatus.tsx index 2bb1cfbe74..27b08a83cb 100644 --- a/site/src/modules/resources/AgentStatus.tsx +++ b/site/src/modules/resources/AgentStatus.tsx @@ -1,4 +1,3 @@ -import Link from "@mui/material/Link"; import { TriangleAlertIcon } from "lucide-react"; import type { FC } from "react"; import type { @@ -12,6 +11,7 @@ import { HelpPopoverTitle, HelpPopoverTrigger, } from "#/components/HelpPopover/HelpPopover"; +import { Link } from "#/components/Link/Link"; import { Tooltip, TooltipContent, @@ -75,7 +75,13 @@ const AgentWarningTooltip: FC = ({ {troubleshootingURL && ( <> {" "} - + Troubleshoot