Skip to content
Open
Changes from all 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
17 changes: 13 additions & 4 deletions ui/src/pages/Agents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,26 @@ export function Agents() {

const filtered = filterAgents(agents ?? [], tab, showTerminated);
const filteredOrg = filterOrgTree(orgTree ?? [], tab, showTerminated);
const counts = useMemo(() => {
const all = agents ?? [];
return {
all: all.filter((a) => matchesFilter(a.status, "all", showTerminated)).length,
active: all.filter((a) => matchesFilter(a.status, "active", showTerminated)).length,
paused: all.filter((a) => matchesFilter(a.status, "paused", showTerminated)).length,
error: all.filter((a) => matchesFilter(a.status, "error", showTerminated)).length,
};
}, [agents, showTerminated]);

return (
<div className="space-y-4">
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<Tabs value={tab} onValueChange={(v) => navigate(`/agents/${v}`)}>
<PageTabBar
items={[
{ value: "all", label: "All" },
{ value: "active", label: "Active" },
{ value: "paused", label: "Paused" },
{ value: "error", label: "Error" },
{ value: "all", label: `All (${counts.all})` },
{ value: "active", label: `Active (${counts.active})` },
{ value: "paused", label: `Paused (${counts.paused})` },
{ value: "error", label: `Error (${counts.error})` },
]}
value={tab}
onValueChange={(v) => navigate(`/agents/${v}`)}
Expand Down
Loading