From a7983f32a6eb6f28aac9a8b1b5c7fd751d20d013 Mon Sep 17 00:00:00 2001 From: 190km Date: Mon, 30 Dec 2024 20:05:44 +0100 Subject: [PATCH] style: added gap for cards title & gap for tls status & availability --- .../dashboard/swarm/details/details-card.tsx | 2 +- .../dashboard/swarm/monitoring-card.tsx | 108 ++++++++++-------- 2 files changed, 61 insertions(+), 49 deletions(-) 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..16d2532c 100644 --- a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx +++ b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx @@ -8,13 +8,7 @@ import { 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 { @@ -26,46 +20,62 @@ export default function SwarmMonitorCard({ serverId }: Props) { serverId, }); - if (isLoading) { - return ( -
-
-
- -
-
-
- ); - } + if (isLoading) { + return ( +
+
+
+ +
+
+
+ ); + } - if (!nodes) { - return ( -
-
-
- Failed to load data -
-
-
- ); - } + if (!nodes) { + return ( +
+
+
+ Failed to load data +
+
+
+ ); + } 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 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 managerNodes = nodes.filter( + (node) => + node.ManagerStatus === "Leader" || node.ManagerStatus === "Reachable" + ); return (
-

Docker Swarm Overview

-

Monitor and manage your Docker Swarm cluster

+

+ Docker Swarm Overview +

+

+ Monitor and manage your Docker Swarm cluster +

{!serverId && ( - @@ -87,12 +97,13 @@ export default function SwarmMonitorCard({ serverId }: Props) { - - Active Nodes - - Online - - +
+ + Active Nodes + + Online + +
@@ -121,12 +132,13 @@ export default function SwarmMonitorCard({ serverId }: Props) { - - Manager Nodes - - Online - - +
+ + Manager Nodes + + Online + +
@@ -162,4 +174,4 @@ export default function SwarmMonitorCard({ serverId }: Props) {
); -} \ No newline at end of file +}