From b17369264cfa2cef011a4173ee0dbd1297cfdd87 Mon Sep 17 00:00:00 2001
From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
Date: Wed, 1 Jan 2025 19:02:24 -0600
Subject: [PATCH] refactor: remove min-h-screen
---
.../dashboard/swarm/monitoring-card.tsx | 308 +++++++++---------
1 file changed, 153 insertions(+), 155 deletions(-)
diff --git a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx
index 16d2532c2..0dd34852a 100644
--- a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx
+++ b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx
@@ -2,176 +2,174 @@ 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 { 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 (
-
- );
- }
+ 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 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 (
-
-
-
+ return (
+
+
+
-
-
-
- Total Nodes
-
-
-
-
-
- {totalNodes}
-
-
+
+
+
+ Total Nodes
+
+
+
+
+
+ {totalNodes}
+
+
-
-
-
-
- Active Nodes
-
-
Online
+
+
+
+
+ Active Nodes
+
+ Online
+
+
+
+
+
+
+
+
+ {activeNodesCount} / {totalNodes}
+
+
+
+
+ {activeNodes.map((node) => (
+
+ {node.Hostname}
+
+ ))}
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- {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) => (
-
- ))}
-
-
-
- );
+
+ {nodes.map((node) => (
+
+ ))}
+
+
+
+ );
}