diff --git a/apps/dokploy/components/dashboard/networks/show-networks.tsx b/apps/dokploy/components/dashboard/networks/show-networks.tsx
index 4e8ef6513..0d8f642b5 100644
--- a/apps/dokploy/components/dashboard/networks/show-networks.tsx
+++ b/apps/dokploy/components/dashboard/networks/show-networks.tsx
@@ -1,10 +1,12 @@
"use client";
-import { Loader2, Network } from "lucide-react";
+import { Loader2, Network, Pencil } from "lucide-react";
import { HandleNetwork } from "@/components/dashboard/networks/handle-network";
+import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Card,
+ CardAction,
CardContent,
CardDescription,
CardHeader,
@@ -27,89 +29,99 @@ export const ShowNetworks = () => {
-
-
-
-
- Networks
-
-
- Manage Docker networks for your organization. Networks can be
- scoped to a server (optional).
-
-
- {networks && networks?.length > 0 && }
-
+
+
+
+ Networks
+
+
+ Manage Docker networks for your organization. Networks can be
+ scoped to a server (optional).
+
+ {networks && networks.length > 0 && (
+
+
+
+ )}
+
-
-
-
- {isLoading ? (
-
- Loading...
-
-
- ) : !networks?.length ? (
-
-
-
-
-
-
No networks yet
-
- Create Docker networks for your organization and
- optionally attach them to a server. Add your first
- network to get started.
-
-
-
-
- ) : (
-
-
-
- Name
- Driver
- Scope
- Internal
- Attachable
- Server
- Created
- Actions
-
-
-
- {networks.map((n) => (
-
-
- {n.name}
-
- {n.driver}
- {n.scope ?? "—"}
- {n.internal ? "Yes" : "No"}
- {n.attachable ? "Yes" : "No"}
-
- {n.serverId ?? "Dokploy server"}
-
-
- {new Date(n.createdAt).toLocaleDateString()}
-
-
-
-
- Edit
-
-
-
-
- ))}
-
-
- )}
-
+ {isLoading ? (
+
+ Loading...
+
-
+ ) : !networks?.length ? (
+
+
+
+
+
+
No networks yet
+
+ Create Docker networks for your organization and optionally
+ attach them to a server. Add your first network to get
+ started.
+
+
+
+
+ ) : (
+
+
+
+
+ Name
+ Driver
+ Scope
+ Internal
+ Attachable
+ Server
+ Created
+
+ Actions
+
+
+
+
+ {networks.map((n) => (
+
+ {n.name}
+
+ {n.driver}
+
+
+ {n.scope ?? "—"}
+
+
+ {n.internal ? "Yes" : "No"}
+
+
+ {n.attachable ? "Yes" : "No"}
+
+
+ {n.server?.name ?? "Dokploy Server"}
+
+
+ {new Date(n.createdAt).toLocaleDateString()}
+
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+ )}
diff --git a/apps/dokploy/server/api/routers/network.ts b/apps/dokploy/server/api/routers/network.ts
index 46da4d79d..cf6503375 100644
--- a/apps/dokploy/server/api/routers/network.ts
+++ b/apps/dokploy/server/api/routers/network.ts
@@ -18,11 +18,18 @@ import {
export const networkRouter = createTRPCRouter({
all: protectedProcedure.query(async ({ ctx }) => {
- const rows = await db
- .select()
- .from(networkTable)
- .where(eq(networkTable.organizationId, ctx.session.activeOrganizationId))
- .orderBy(desc(networkTable.createdAt));
+ const rows = await db.query.network.findMany({
+ where: eq(networkTable.organizationId, ctx.session.activeOrganizationId),
+ with: {
+ server: {
+ columns: {
+ serverId: true,
+ name: true,
+ },
+ },
+ },
+ orderBy: desc(networkTable.createdAt),
+ });
return rows;
}),