From 3d63872df0b52d0db45984de751145ccd5ae3fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=A8NW=C2=A8?= <¨neroworld@mail.ru¨> Date: Fri, 10 Apr 2026 21:39:26 +0100 Subject: [PATCH] fix: remove extra brace in Agents.tsx, remove unused Progress import --- client/src/pages/Agents.tsx | 119 ++++++++++++++++++++++++++++-------- 1 file changed, 93 insertions(+), 26 deletions(-) diff --git a/client/src/pages/Agents.tsx b/client/src/pages/Agents.tsx index 614388e..e7c72da 100644 --- a/client/src/pages/Agents.tsx +++ b/client/src/pages/Agents.tsx @@ -7,7 +7,6 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { Progress } from "@/components/ui/progress"; import { AlertDialog, AlertDialogAction, @@ -66,30 +65,73 @@ const ROLE_ICONS: Record = { function getStatusConfig(status: string) { switch (status) { case "running": - return { color: "text-neon-green", bg: "bg-neon-green", badge: "bg-neon-green/15 text-neon-green border-neon-green/30", glow: "glow-green" }; + return { + color: "text-neon-green", + bg: "bg-neon-green", + badge: "bg-neon-green/15 text-neon-green border-neon-green/30", + glow: "glow-green", + }; case "idle": - return { color: "text-primary", bg: "bg-primary", badge: "bg-primary/15 text-primary border-primary/30", glow: "glow-cyan" }; + return { + color: "text-primary", + bg: "bg-primary", + badge: "bg-primary/15 text-primary border-primary/30", + glow: "glow-cyan", + }; case "error": - return { color: "text-neon-red", bg: "bg-neon-red", badge: "bg-neon-red/15 text-neon-red border-neon-red/30", glow: "glow-red" }; + return { + color: "text-neon-red", + bg: "bg-neon-red", + badge: "bg-neon-red/15 text-neon-red border-neon-red/30", + glow: "glow-red", + }; default: - return { color: "text-muted-foreground", bg: "bg-muted", badge: "bg-muted text-muted-foreground border-border", glow: "" }; + return { + color: "text-muted-foreground", + bg: "bg-muted", + badge: "bg-muted text-muted-foreground border-border", + glow: "", + }; } } function getContainerStatusConfig(status: string | undefined | null) { switch (status) { case "running": - return { label: "RUNNING", color: "text-neon-green", bg: "bg-neon-green/15", border: "border-neon-green/30", icon: Container }; + return { + label: "RUNNING", + color: "text-neon-green", + bg: "bg-neon-green/15", + border: "border-neon-green/30", + icon: Container, + }; case "deploying": - return { label: "DEPLOYING", color: "text-neon-amber", bg: "bg-neon-amber/15", border: "border-neon-amber/30", icon: Loader2 }; + return { + label: "DEPLOYING", + color: "text-neon-amber", + bg: "bg-neon-amber/15", + border: "border-neon-amber/30", + icon: Loader2, + }; case "error": - return { label: "ERROR", color: "text-neon-red", bg: "bg-neon-red/15", border: "border-neon-red/30", icon: AlertCircle }; + return { + label: "ERROR", + color: "text-neon-red", + bg: "bg-neon-red/15", + border: "border-neon-red/30", + icon: AlertCircle, + }; case "stopped": default: - return { label: "STOPPED", color: "text-muted-foreground", bg: "bg-muted/50", border: "border-border", icon: Square }; + return { + label: "STOPPED", + color: "text-muted-foreground", + bg: "bg-muted/50", + border: "border-border", + icon: Square, + }; } } -} export default function Agents() { const [selectedAgent, setSelectedAgent] = useState(null); @@ -109,13 +151,13 @@ export default function Agents() { setAgentToDelete(null); refetch(); }, - onError: (error) => { + onError: error => { toast.error(`Failed to delete agent: ${error.message}`); }, }); const deployMutation = trpc.agents.deployContainer.useMutation({ - onSuccess: (data) => { + onSuccess: data => { if (data.success) { toast.success(`Agent container deployed: ${data.serviceName}`); } else { @@ -123,13 +165,13 @@ export default function Agents() { } refetch(); }, - onError: (error) => { + onError: error => { toast.error(`Deploy error: ${error.message}`); }, }); const stopMutation = trpc.agents.stopContainer.useMutation({ - onSuccess: (data) => { + onSuccess: data => { if (data.success) { toast.success("Agent container stopped"); } else { @@ -137,7 +179,7 @@ export default function Agents() { } refetch(); }, - onError: (error) => { + onError: error => { toast.error(`Stop error: ${error.message}`); }, }); @@ -432,7 +474,9 @@ export default function Agents() { variant="outline" className={`text-[9px] font-mono ${csc.bg} ${csc.color} ${csc.border}`} > - + {csc.label} @@ -524,29 +568,52 @@ export default function Agents() { onClick={e => { e.stopPropagation(); setStoppingAgentId(agent.id); - stopMutation.mutate({ agentId: agent.id }, { - onSettled: () => setStoppingAgentId(null), - }); + stopMutation.mutate( + { agentId: agent.id }, + { + onSettled: () => + setStoppingAgentId(null), + } + ); }} > - {isStopping ? : } + {isStopping ? ( + + ) : ( + + )} Stop ) : ( )}