-
@@ -50,139 +50,116 @@ 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 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 activeNodes = nodes.filter((node) => node.Status === "Ready");
- const managerNodes = nodes.filter(
- (node) =>
- node.ManagerStatus === "Leader" || node.ManagerStatus === "Reachable",
- );
+ return (
+
+
+
- const getStatusIcon = (status: string) => {
- switch (status) {
- case "Ready":
- return
;
- case "Down":
- return
;
- case "Disconnected":
- return
;
- default:
- return
;
- }
- };
+
+
+
+ Total Nodes
+
+
+
+
+
+ {totalNodes}
+
+
- return (
-
-
-
Docker Swarm Overview
- {!serverId && (
-
- )}
-
-
-
-
-
- Monitor
-
-
-
-
-
- Total Nodes:
- {totalNodes}
-
-
-
Active Nodes:
-
-
-
-
- {activeNodesCount} / {totalNodes}
-
-
-
-
- {activeNodes.map((node) => (
-
- {getStatusIcon(node.Status)}
- {node.Hostname}
-
- ))}
-
-
-
-
-
-
-
Manager Nodes:
-
-
-
-
- {managerNodesCount} / {totalNodes}
-
-
-
-
- {managerNodes.map((node) => (
-
- {getStatusIcon(node.Status)}
- {node.Hostname}
-
- ))}
-
-
-
-
-
-
-
-
Node Status:
-
- {nodes.map((node) => (
- -
-
- {getStatusIcon(node.Status)}
- {node.Hostname}
-
-
- {node.ManagerStatus || "Worker"}
-
-
- ))}
-
-
-
-
-
- {nodes.map((node) => (
-
- ))}
-
-
- );
-}
+
+
+
+ Active Nodes
+
+ Online
+
+
+
+
+
+
+
+
+
+ {activeNodesCount} / {totalNodes}
+
+
+
+
+ {activeNodes.map((node) => (
+
+ {node.Hostname}
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+ Manager Nodes
+
+ Online
+
+
+
+
+
+
+
+
+
+
+
+ {managerNodesCount} / {totalNodes}
+
+
+
+
+ {managerNodes.map((node) => (
+
+ {node.Hostname}
+
+ ))}
+
+
+
+
+
+
+
+
+
+ {nodes.map((node) => (
+
+ ))}
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/apps/dokploy/pages/dashboard/swarm.tsx b/apps/dokploy/pages/dashboard/swarm.tsx
index 15a7d793..f36de68e 100644
--- a/apps/dokploy/pages/dashboard/swarm.tsx
+++ b/apps/dokploy/pages/dashboard/swarm.tsx
@@ -10,9 +10,7 @@ import superjson from "superjson";
const Dashboard = () => {
return (
<>
-
-
-
+
>
);
};
From 0c2a38254140650cea6e91bae6d630be62356c43 Mon Sep 17 00:00:00 2001
From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
Date: Sat, 28 Dec 2024 19:29:51 -0600
Subject: [PATCH 2/2] Update
apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx
---
.../dashboard/settings/servers/show-swarm-overview-modal.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx b/apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx
index a63c3037..1bb6fe5a 100644
--- a/apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx
@@ -39,7 +39,6 @@ export const ShowSwarmOverviewModal = ({ serverId }: Props) => {