From e189d162cdf158eee843810922aa9b282c5ec651 Mon Sep 17 00:00:00 2001 From: Dominik Koch Date: Thu, 26 Dec 2024 22:44:20 +0100 Subject: [PATCH] fix:use swarmlist type def --- .../dashboard/swarm/monitoring-card.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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) => ( ))}