diff --git a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx index e2453dd9f..63ff580b0 100644 --- a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx +++ b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx @@ -15,7 +15,7 @@ import { Loader2, Server, } from "lucide-react"; -import { NodeCard } from "./details/details-card"; +import { NodeCard, type SwarmList as Node } from "./details/details-card"; interface Props { serverId?: string; @@ -52,16 +52,16 @@ export default function SwarmMonitorCard({ serverId }: Props) { const totalNodes = nodes.length; const activeNodesCount = nodes.filter( - (node) => node.Status === "Ready", + (node: Node) => node.Status === "Ready", ).length; const managerNodesCount = nodes.filter( - (node) => + (node: Node) => node.ManagerStatus === "Leader" || node.ManagerStatus === "Reachable", ).length; - const activeNodes = nodes.filter((node) => node.Status === "Ready"); + const activeNodes = nodes.filter((node: Node) => node.Status === "Ready"); const managerNodes = nodes.filter( - (node) => + (node: Node) => node.ManagerStatus === "Leader" || node.ManagerStatus === "Reachable", ); @@ -120,7 +120,7 @@ export default function SwarmMonitorCard({ serverId }: Props) {
- {activeNodes.map((node) => ( + {activeNodes.map((node: Node) => (
{getStatusIcon(node.Status)} {node.Hostname} @@ -145,7 +145,7 @@ export default function SwarmMonitorCard({ serverId }: Props) {
- {managerNodes.map((node) => ( + {managerNodes.map((node: Node) => (
{getStatusIcon(node.Status)} {node.Hostname} @@ -160,7 +160,7 @@ export default function SwarmMonitorCard({ serverId }: Props) {

Node Status:

    - {nodes.map((node) => ( + {nodes.map((node: Node) => (
  • - {nodes.map((node) => ( + {nodes.map((node: Node) => ( ))}
    diff --git a/packages/server/src/services/docker.ts b/packages/server/src/services/docker.ts index cc7e02b9b..8fb4dc43e 100644 --- a/packages/server/src/services/docker.ts +++ b/packages/server/src/services/docker.ts @@ -366,10 +366,10 @@ export const getSwarmNodes = async (serverId?: string) => { const nodes = JSON.parse(stdout); - const nodesArray = stdout + const nodesArray = nodes .trim() .split("\n") - .map((line) => JSON.parse(line)); + .map((line: string) => JSON.parse(line)); return nodesArray; } catch (error) {} };