diff --git a/apps/dokploy/components/dashboard/swarm/applications/columns.tsx b/apps/dokploy/components/dashboard/swarm/applications/columns.tsx
index ba2d9e13f..1961cd997 100644
--- a/apps/dokploy/components/dashboard/swarm/applications/columns.tsx
+++ b/apps/dokploy/components/dashboard/swarm/applications/columns.tsx
@@ -11,7 +11,7 @@ import {
} from "@/components/ui/dropdown-menu";
import { Badge } from "@/components/ui/badge";
-import { ShowNodeConfig } from "../details/show-node";
+import { ShowNodeConfig } from "../details/show-node-config";
// import { ShowContainerConfig } from "../config/show-container-config";
// import { ShowDockerModalLogs } from "../logs/show-docker-modal-logs";
// import { DockerTerminalModal } from "../terminal/docker-terminal-modal";
diff --git a/apps/dokploy/components/dashboard/swarm/applications/show-applications.tsx b/apps/dokploy/components/dashboard/swarm/applications/show-applications.tsx
index 4363adc1f..e3b38a71d 100644
--- a/apps/dokploy/components/dashboard/swarm/applications/show-applications.tsx
+++ b/apps/dokploy/components/dashboard/swarm/applications/show-applications.tsx
@@ -7,7 +7,6 @@ import {
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
-import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { api } from "@/utils/api";
import { Layers, LoaderIcon } from "lucide-react";
import React from "react";
@@ -108,7 +107,6 @@ const ShowNodeApplications = ({ nodeName }: Props) => {
- {/* */}
);
diff --git a/apps/dokploy/components/dashboard/swarm/containers/columns.tsx b/apps/dokploy/components/dashboard/swarm/containers/columns.tsx
deleted file mode 100644
index 0ccf8e373..000000000
--- a/apps/dokploy/components/dashboard/swarm/containers/columns.tsx
+++ /dev/null
@@ -1,139 +0,0 @@
-import type { ColumnDef } from "@tanstack/react-table";
-import { ArrowUpDown, MoreHorizontal } from "lucide-react";
-import * as React from "react";
-
-import { Button } from "@/components/ui/button";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuLabel,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu";
-
-import type { Badge } from "@/components/ui/badge";
-import { ShowNodeConfig } from "../details/show-node";
-// import { ShowContainerConfig } from "../config/show-container-config";
-// import { ShowDockerModalLogs } from "../logs/show-docker-modal-logs";
-// import { DockerTerminalModal } from "../terminal/docker-terminal-modal";
-// import type { Container } from "./show-containers";
-
-export interface ContainerList {
- containerId: string;
- name: string;
- image: string;
- ports: string;
- state: string;
- status: string;
- serverId: string | null | undefined;
-}
-
-export const columns: ColumnDef[] = [
- {
- accessorKey: "ID",
- accessorFn: (row) => row.containerId,
- header: ({ column }) => {
- return (
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("containerId")}
;
- },
- },
- {
- accessorKey: "Name",
- accessorFn: (row) => row.name,
- header: ({ column }) => {
- return (
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("name")}
;
- },
- },
- {
- accessorKey: "Image",
- accessorFn: (row) => row.image,
- header: ({ column }) => {
- return (
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("image")}
;
- },
- },
- {
- accessorKey: "Ports",
- accessorFn: (row) => row.ports,
- header: ({ column }) => {
- return (
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("ports")}
;
- },
- },
- {
- accessorKey: "State",
- accessorFn: (row) => row.state,
- header: ({ column }) => {
- return (
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("state")}
;
- },
- },
- {
- accessorKey: "Status",
- accessorFn: (row) => row.status,
- header: ({ column }) => {
- return (
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("status")}
;
- },
- },
-];
diff --git a/apps/dokploy/components/dashboard/swarm/containers/data-table.tsx b/apps/dokploy/components/dashboard/swarm/containers/data-table.tsx
deleted file mode 100644
index 95b4498ea..000000000
--- a/apps/dokploy/components/dashboard/swarm/containers/data-table.tsx
+++ /dev/null
@@ -1,210 +0,0 @@
-"use client";
-
-import {
- type ColumnDef,
- type ColumnFiltersState,
- type SortingState,
- type VisibilityState,
- flexRender,
- getCoreRowModel,
- getFilteredRowModel,
- getPaginationRowModel,
- getSortedRowModel,
- useReactTable,
-} from "@tanstack/react-table";
-
-import { Button } from "@/components/ui/button";
-import {
- DropdownMenu,
- DropdownMenuCheckboxItem,
- DropdownMenuContent,
-} from "@/components/ui/dropdown-menu";
-import { Input } from "@/components/ui/input";
-import {
- Table,
- TableBody,
- TableCell,
- TableHead,
- TableHeader,
- TableRow,
-} from "@/components/ui/table";
-import { DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu";
-import { ChevronDown } from "lucide-react";
-import React from "react";
-
-interface DataTableProps {
- columns: ColumnDef[];
- data: TData[];
- isLoading: boolean;
-}
-
-export function DataTable({
- columns,
- data,
- isLoading,
-}: DataTableProps) {
- const [sorting, setSorting] = React.useState([]);
- const [columnFilters, setColumnFilters] = React.useState(
- [],
- );
- const [columnVisibility, setColumnVisibility] =
- React.useState({});
- const [rowSelection, setRowSelection] = React.useState({});
-
- const table = useReactTable({
- data,
- columns,
- onSortingChange: setSorting,
- onColumnFiltersChange: setColumnFilters,
- getCoreRowModel: getCoreRowModel(),
- getPaginationRowModel: getPaginationRowModel(),
- getSortedRowModel: getSortedRowModel(),
- getFilteredRowModel: getFilteredRowModel(),
- onColumnVisibilityChange: setColumnVisibility,
- onRowSelectionChange: setRowSelection,
- state: {
- sorting,
- columnFilters,
- columnVisibility,
- rowSelection,
- },
- });
-
- return (
-
-
-
-
- table.getColumn("Name")?.setFilterValue(event.target.value)
- }
- className="md:max-w-sm"
- />
-
-
-
-
-
- {table
- .getAllColumns()
- .filter((column) => column.getCanHide())
- .map((column) => {
- return (
-
- column.toggleVisibility(!!value)
- }
- >
- {column.id}
-
- );
- })}
-
-
-
-
-
- {isLoading ? (
-
-
- Loading...
-
-
- ) : data?.length === 0 ? (
-
-
- No results.
-
-
- ) : (
-
-
- {table.getHeaderGroups().map((headerGroup) => (
-
- {headerGroup.headers.map((header) => {
- return (
-
- {header.isPlaceholder
- ? null
- : flexRender(
- header.column.columnDef.header,
- header.getContext(),
- )}
-
- );
- })}
-
- ))}
-
-
- {table?.getRowModel()?.rows?.length ? (
- table.getRowModel().rows.map((row) => (
-
- {row.getVisibleCells().map((cell) => (
-
- {flexRender(
- cell.column.columnDef.cell,
- cell.getContext(),
- )}
-
- ))}
-
- ))
- ) : (
-
-
- {isLoading ? (
-
-
- Loading...
-
-
- ) : (
- <>No results.>
- )}
-
-
- )}
-
-
- )}
-
- {data && data?.length > 0 && (
-
-
-
-
-
-
- )}
-
-
- );
-}
diff --git a/apps/dokploy/components/dashboard/swarm/containers/show-container.tsx b/apps/dokploy/components/dashboard/swarm/containers/show-container.tsx
deleted file mode 100644
index 4d6582aaa..000000000
--- a/apps/dokploy/components/dashboard/swarm/containers/show-container.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogHeader,
- DialogTitle,
- DialogTrigger,
-} from "@/components/ui/dialog";
-import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
-import { api } from "@/utils/api";
-import React from "react";
-import { ShowContainers } from "../../docker/show/show-containers";
-import { columns } from "./columns";
-import { DataTable } from "./data-table";
-// import { columns } from "./columns";
-// import { DataTable } from "./data-table";
-
-interface Props {
- serverId: string;
-}
-
-const ShowNodeContainers = ({ serverId }: Props) => {
- return (
-
- );
-};
-
-export default ShowNodeContainers;
diff --git a/apps/dokploy/components/dashboard/swarm/show/deatils-card.tsx b/apps/dokploy/components/dashboard/swarm/details/deatils-card.tsx
similarity index 69%
rename from apps/dokploy/components/dashboard/swarm/show/deatils-card.tsx
rename to apps/dokploy/components/dashboard/swarm/details/deatils-card.tsx
index 83d226a5c..b8eb9f81f 100644
--- a/apps/dokploy/components/dashboard/swarm/show/deatils-card.tsx
+++ b/apps/dokploy/components/dashboard/swarm/details/deatils-card.tsx
@@ -1,25 +1,10 @@
import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogTrigger,
-} from "@/components/ui/dialog";
import { api } from "@/utils/api";
-import {
- AlertCircle,
- CheckCircle,
- HelpCircle,
- Layers,
- LoaderIcon,
- Settings,
-} from "lucide-react";
+import { AlertCircle, CheckCircle, HelpCircle, LoaderIcon } from "lucide-react";
import { useState } from "react";
import ShowNodeApplications from "../applications/show-applications";
-import { ShowNodeConfig } from "../details/show-node";
+import { ShowNodeConfig } from "./show-node-config";
export interface SwarmList {
ID: string;
@@ -36,9 +21,6 @@ interface NodeCardProps {
}
export function NodeCard({ node }: NodeCardProps) {
- const [showConfig, setShowConfig] = useState(false);
- const [showServices, setShowServices] = useState(false);
-
const { data, isLoading } = api.swarm.getNodeInfo.useQuery({
nodeId: node.ID,
});
@@ -77,7 +59,6 @@ export function NodeCard({ node }: NodeCardProps) {
);
}
- console.log(data);
return (
@@ -143,41 +124,7 @@ export function NodeCard({ node }: NodeCardProps) {
- {/*
*/}
- {/*
*/}
diff --git a/apps/dokploy/components/dashboard/swarm/details/show-node.tsx b/apps/dokploy/components/dashboard/swarm/details/show-node-config.tsx
similarity index 85%
rename from apps/dokploy/components/dashboard/swarm/details/show-node.tsx
rename to apps/dokploy/components/dashboard/swarm/details/show-node-config.tsx
index 4f7518056..2d8a3e3ee 100644
--- a/apps/dokploy/components/dashboard/swarm/details/show-node.tsx
+++ b/apps/dokploy/components/dashboard/swarm/details/show-node-config.tsx
@@ -8,10 +8,8 @@ import {
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
-import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { api } from "@/utils/api";
import { Settings } from "lucide-react";
-import React from "react";
interface Props {
nodeId: string;
@@ -22,12 +20,6 @@ export const ShowNodeConfig = ({ nodeId }: Props) => {
return (
- {/* setShowContainers(!showContainers)}
- >
-
- {showContainers ? "Hide" : "Show"} Containers
- */}
- {/* {showContainers && (
-
-
-
- )} */}
);
diff --git a/apps/dokploy/components/dashboard/swarm/servers/servers-overview.tsx b/apps/dokploy/components/dashboard/swarm/servers/servers-overview.tsx
index 8768a88c8..a90546c9f 100644
--- a/apps/dokploy/components/dashboard/swarm/servers/servers-overview.tsx
+++ b/apps/dokploy/components/dashboard/swarm/servers/servers-overview.tsx
@@ -1,5 +1,5 @@
import { api } from "@/utils/api";
-import { ServerOverviewCard } from "../server-card";
+import { ServerOverviewCard } from "./server-card";
export default function ServersOverview() {
const { data: servers, isLoading } = api.server.all.useQuery();
diff --git a/apps/dokploy/components/dashboard/swarm/servers/show-server.tsx b/apps/dokploy/components/dashboard/swarm/servers/show-server.tsx
deleted file mode 100644
index 0486b1648..000000000
--- a/apps/dokploy/components/dashboard/swarm/servers/show-server.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { api } from "@/utils/api";
-import React from "react";
-import { columns } from "./columns";
-import { DataTable } from "./data-table";
-
-function ShowApplicationServers() {
- const { data, isLoading } = api.server.all.useQuery();
-
- console.log(data);
-
- return (
-
- );
-}
-
-export default ShowApplicationServers;
diff --git a/apps/dokploy/components/dashboard/swarm/show/columns.tsx b/apps/dokploy/components/dashboard/swarm/show/columns.tsx
deleted file mode 100644
index b07749363..000000000
--- a/apps/dokploy/components/dashboard/swarm/show/columns.tsx
+++ /dev/null
@@ -1,202 +0,0 @@
-import type { ColumnDef } from "@tanstack/react-table";
-import { ArrowUpDown, MoreHorizontal } from "lucide-react";
-import * as React from "react";
-
-import { Button } from "@/components/ui/button";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuLabel,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu";
-
-import { Badge } from "@/components/ui/badge";
-import ShowNodeApplications from "../applications/show-applications";
-import ShowContainers from "../containers/show-container";
-import { ShowNodeConfig } from "../details/show-node";
-// import { ShowContainerConfig } from "../config/show-container-config";
-// import { ShowDockerModalLogs } from "../logs/show-docker-modal-logs";
-// import { DockerTerminalModal } from "../terminal/docker-terminal-modal";
-// import type { Container } from "./show-containers";
-
-export interface SwarmList {
- ID: string;
- Hostname: string;
- Availability: string;
- EngineVersion: string;
- Status: string;
- ManagerStatus: string;
- TLSStatus: string;
-}
-
-export const columns: ColumnDef[] = [
- {
- accessorKey: "ID",
- header: ({ column }) => {
- return (
- column.toggleSorting(column.getIsSorted() === "asc")}
- >
- ID
-
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("ID")}
;
- },
- },
- {
- accessorKey: "EngineVersion",
- header: ({ column }) => {
- return (
- column.toggleSorting(column.getIsSorted() === "asc")}
- >
- Engine Version
-
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("EngineVersion")}
;
- },
- },
- {
- accessorKey: "Hostname",
- header: ({ column }) => {
- return (
- column.toggleSorting(column.getIsSorted() === "asc")}
- >
- Hostname
-
-
- );
- },
- cell: ({ row }) => {
- return {row.getValue("Hostname")}
;
- },
- },
- // {
- // accessorKey: "Status",
- // header: ({ column }) => {
- // return (
- // column.toggleSorting(column.getIsSorted() === "asc")}
- // >
- // Status
- //
- //
- // );
- // },
- // cell: ({ row }) => {
- // const value = row.getValue("status") as string;
- // return (
- //
- //
- // {value}
- //
- //
- // );
- // },
- // },
- {
- accessorKey: "Availability",
- header: ({ column }) => {
- return (
- column.toggleSorting(column.getIsSorted() === "asc")}
- >
- Availability
-
-
- );
- },
- cell: ({ row }) => {
- const value = row.getValue("Availability") as string;
- return (
-
-
- {value}
-
-
- );
- },
- },
- {
- accessorKey: "ManagerStatus",
- header: ({ column }) => {
- return (
- column.toggleSorting(column.getIsSorted() === "asc")}
- >
- ManagerStatus
-
-
- );
- },
- cell: ({ row }) => (
- {row.getValue("ManagerStatus")}
- ),
- },
- {
- id: "actions",
- enableHiding: false,
- cell: ({ row }) => {
- return (
-
-
-
- Open menu
-
-
-
-
- Actions
-
-
- {/*
- View Logs
-
-
-
- Terminal
- */}
-
-
- );
- },
- },
-];
diff --git a/apps/dokploy/components/dashboard/swarm/show/data-table.tsx b/apps/dokploy/components/dashboard/swarm/show/data-table.tsx
deleted file mode 100644
index d3e993529..000000000
--- a/apps/dokploy/components/dashboard/swarm/show/data-table.tsx
+++ /dev/null
@@ -1,269 +0,0 @@
-"use client";
-
-import {
- type ColumnFiltersState,
- type SortingState,
- type VisibilityState,
- type ColumnDef,
- flexRender,
- getCoreRowModel,
- getFilteredRowModel,
- getPaginationRowModel,
- getSortedRowModel,
- useReactTable,
-} from "@tanstack/react-table";
-
-import {
- Table,
- TableBody,
- TableCell,
- TableHead,
- TableHeader,
- TableRow,
-} from "@/components/ui/table";
-import React from "react";
-import {
- DropdownMenu,
- DropdownMenuCheckboxItem,
- DropdownMenuContent,
-} from "@/components/ui/dropdown-menu";
-import { DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu";
-import { Button } from "@/components/ui/button";
-import { ChevronDown } from "lucide-react";
-import { Input } from "@/components/ui/input";
-
-interface DataTableProps {
- columns: ColumnDef[];
- data: TData[];
- isLoading: boolean;
-}
-
-export function DataTable({
- columns,
- data,
- isLoading,
-}: DataTableProps) {
- const [sorting, setSorting] = React.useState([]);
- const [columnFilters, setColumnFilters] = React.useState(
- []
- );
- const [columnVisibility, setColumnVisibility] =
- React.useState({});
- const [rowSelection, setRowSelection] = React.useState({});
-
- const table = useReactTable({
- data,
- columns,
- onSortingChange: setSorting,
- onColumnFiltersChange: setColumnFilters,
- getCoreRowModel: getCoreRowModel(),
- getPaginationRowModel: getPaginationRowModel(),
- getSortedRowModel: getSortedRowModel(),
- getFilteredRowModel: getFilteredRowModel(),
- onColumnVisibilityChange: setColumnVisibility,
- onRowSelectionChange: setRowSelection,
- state: {
- sorting,
- columnFilters,
- columnVisibility,
- rowSelection,
- },
- });
-
- console.log("Data in DataTable", data);
-
- return (
-
-
-
-
- table.getColumn("Hostname")?.setFilterValue(event.target.value)
- }
- className="md:max-w-sm"
- />
-
-
-
- Columns
-
-
-
- {table
- .getAllColumns()
- .filter((column) => column.getCanHide())
- .map((column) => {
- return (
-
- column.toggleVisibility(!!value)
- }
- >
- {column.id}
-
- );
- })}
-
-
-
- {/*
-
- {table.getHeaderGroups().map((headerGroup) => (
-
- {headerGroup.headers.map((header) => {
- return (
-
- {header.isPlaceholder
- ? null
- : flexRender(
- header.column.columnDef.header,
- header.getContext()
- )}
-
- );
- })}
-
- ))}
-
-
- {table?.getRowModel()?.rows?.length ? (
- table.getRowModel().rows.map((row) => (
-
- {row.getVisibleCells().map((cell) => (
-
- {flexRender(
- cell.column.columnDef.cell,
- cell.getContext()
- )}
-
- ))}
-
- ))
- ) : (
-
-
- {isLoading ? (
-
-
- Loading...
-
-
- ) : (
- <>No results.>
- )}
-
-
- )}
-
-
*/}
-
- {isLoading ? (
-
-
- Loading...
-
-
- ) : data?.length === 0 ? (
-
-
- No results.
-
-
- ) : (
-
-
- {table.getHeaderGroups().map((headerGroup) => (
-
- {headerGroup.headers.map((header) => {
- return (
-
- {header.isPlaceholder
- ? null
- : flexRender(
- header.column.columnDef.header,
- header.getContext()
- )}
-
- );
- })}
-
- ))}
-
-
- {table?.getRowModel()?.rows?.length ? (
- table.getRowModel().rows.map((row) => (
-
- {row.getVisibleCells().map((cell) => (
-
- {flexRender(
- cell.column.columnDef.cell,
- cell.getContext()
- )}
-
- ))}
-
- ))
- ) : (
-
-
- {isLoading ? (
-
-
- Loading...
-
-
- ) : (
- <>No results.>
- )}
-
-
- )}
-
-
- )}
-
- {data && data?.length > 0 && (
-
-
- table.previousPage()}
- disabled={!table.getCanPreviousPage()}
- >
- Previous
-
- table.nextPage()}
- disabled={!table.getCanNextPage()}
- >
- Next
-
-
-
- )}
-
-
- );
-}
diff --git a/apps/dokploy/components/dashboard/swarm/show/show-nodes.tsx b/apps/dokploy/components/dashboard/swarm/show/show-nodes.tsx
deleted file mode 100644
index e629654f7..000000000
--- a/apps/dokploy/components/dashboard/swarm/show/show-nodes.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { api } from "@/utils/api";
-import React from "react";
-import { columns } from "./columns";
-import { DataTable } from "./data-table";
-
-function ShowSwarmNodes() {
- const { data, isLoading } = api.swarm.getNodes.useQuery();
-
- return (
-
- );
-}
-
-export default ShowSwarmNodes;
diff --git a/apps/dokploy/pages/dashboard/swarm.tsx b/apps/dokploy/pages/dashboard/swarm.tsx
index 24fa43268..b294c09bc 100644
--- a/apps/dokploy/pages/dashboard/swarm.tsx
+++ b/apps/dokploy/pages/dashboard/swarm.tsx
@@ -1,6 +1,6 @@
import { ShowServers } from "@/components/dashboard/settings/servers/show-servers";
import SwarmMonitorCard from "@/components/dashboard/swarm/monitoring-card";
-import { ServerOverviewCard } from "@/components/dashboard/swarm/server-card";
+import { ServerOverviewCard } from "@/components/dashboard/swarm/servers/server-card";
import ServersOverview from "@/components/dashboard/swarm/servers/servers-overview";
import ShowApplicationServers from "@/components/dashboard/swarm/servers/show-server";
import ShowSwarmNodes from "@/components/dashboard/swarm/show/show-nodes";