diff --git a/apps/dokploy/components/dashboard/swarm/details/details-card.tsx b/apps/dokploy/components/dashboard/swarm/details/details-card.tsx index 2de0901a..eb06e79c 100644 --- a/apps/dokploy/components/dashboard/swarm/details/details-card.tsx +++ b/apps/dokploy/components/dashboard/swarm/details/details-card.tsx @@ -63,7 +63,7 @@ export function NodeCard({ node, serverId }: Props) {
-
+
{node.Hostname}
diff --git a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx index bd8570db..0dd34852 100644 --- a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx +++ b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx @@ -2,29 +2,23 @@ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; -import { - Activity, - Loader2, - Monitor, - Settings, - Server, -} from "lucide-react"; +import { Activity, Loader2, Monitor, Settings, Server } from "lucide-react"; import { NodeCard } from "./details/details-card"; interface Props { - serverId?: string; + serverId?: string; } export default function SwarmMonitorCard({ serverId }: Props) { - const { data: nodes, isLoading } = api.swarm.getNodes.useQuery({ - serverId, - }); + const { data: nodes, isLoading } = api.swarm.getNodes.useQuery({ + serverId, + }); if (isLoading) { return ( @@ -50,116 +44,132 @@ export default function SwarmMonitorCard({ serverId }: Props) { ); } - const totalNodes = nodes.length; - const activeNodesCount = nodes.filter((node) => node.Status === "Ready").length; - const managerNodesCount = nodes.filter((node) =>node.ManagerStatus === "Leader" || node.ManagerStatus === "Reachable").length; - const activeNodes = nodes.filter((node) => node.Status === "Ready"); - const managerNodes = nodes.filter((node) => node.ManagerStatus === "Leader" || node.ManagerStatus === "Reachable"); + const totalNodes = nodes.length; + const activeNodesCount = nodes.filter( + (node) => node.Status === "Ready", + ).length; + const managerNodesCount = nodes.filter( + (node) => + node.ManagerStatus === "Leader" || node.ManagerStatus === "Reachable", + ).length; + const activeNodes = nodes.filter((node) => node.Status === "Ready"); + const managerNodes = nodes.filter( + (node) => + node.ManagerStatus === "Leader" || node.ManagerStatus === "Reachable", + ); - return ( -
-
-
-
-

Docker Swarm Overview

-

Monitor and manage your Docker Swarm cluster

-
- {!serverId && ( - - )} -
+ return ( +
+
+
+
+

+ Docker Swarm Overview +

+

+ Monitor and manage your Docker Swarm cluster +

+
+ {!serverId && ( + + )} +
-
- - - Total Nodes -
- -
-
- -
{totalNodes}
-
-
+
+ + + Total Nodes +
+ +
+
+ +
{totalNodes}
+
+
- - - - Active Nodes - - Online - - -
- -
-
- - - - -
- {activeNodesCount} / {totalNodes} -
-
- -
- {activeNodes.map((node) => ( -
- {node.Hostname} -
- ))} -
-
-
-
-
-
+ + +
+ + Active Nodes + + Online +
+
+ +
+
+ + + + +
+ {activeNodesCount} / {totalNodes} +
+
+ +
+ {activeNodes.map((node) => ( +
+ {node.Hostname} +
+ ))} +
+
+
+
+
+
- - - - Manager Nodes - - Online - - -
- -
-
- - - - -
- {managerNodesCount} / {totalNodes} -
-
- -
- {managerNodes.map((node) => ( -
- {node.Hostname} -
- ))} -
-
-
-
-
-
-
+ + +
+ + Manager Nodes + + Online +
+
+ +
+
+ + + + +
+ {managerNodesCount} / {totalNodes} +
+
+ +
+ {managerNodes.map((node) => ( +
+ {node.Hostname} +
+ ))} +
+
+
+
+
+
+
-
- {nodes.map((node) => ( - - ))} -
-
-
- ); -} \ No newline at end of file +
+ {nodes.map((node) => ( + + ))} +
+
+
+ ); +}