From 1617d07fbd62ea0e39b4e54f8369a0310e8034de Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 11 Aug 2026 01:55:42 -0600 Subject: [PATCH] refactor: move cluster nodes into docker dashboard swarm tab - Add Nodes sub-tab under Docker > Swarm (visible with organization.update permission) - Remove Cluster item from settings sidebar and delete /dashboard/settings/cluster page - Point internal cluster links to /dashboard/docker?tab=swarm&subtab=nodes - Make ShowNodes card full-width to match the other docker tabs --- .../cluster/show-cluster-settings.tsx | 2 +- .../settings/cluster/nodes/show-nodes.tsx | 2 +- .../swarm/containers/empty-states.tsx | 10 ++-- .../containers/show-swarm-containers.tsx | 2 +- .../dashboard/swarm/monitoring-card.tsx | 4 +- apps/dokploy/components/layouts/side.tsx | 8 --- apps/dokploy/pages/dashboard/docker.tsx | 39 +++++++++++- .../pages/dashboard/settings/cluster.tsx | 59 ------------------- 8 files changed, 48 insertions(+), 78 deletions(-) delete mode 100644 apps/dokploy/pages/dashboard/settings/cluster.tsx diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx b/apps/dokploy/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx index 95f849480..ae3392473 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx @@ -187,7 +187,7 @@ export const ShowClusterSettings = ({ id, type }: Props) => { To use a cluster feature, you need to configure at least a registry first. Please, go to{" "} Settings diff --git a/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes.tsx b/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes.tsx index c7f580caa..1991d57d2 100644 --- a/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes.tsx +++ b/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes.tsx @@ -58,7 +58,7 @@ export const ShowNodes = ({ serverId }: Props) => { const haveAtLeastOneRegistry = !!(registry && registry?.length > 0); return (
- +
diff --git a/apps/dokploy/components/dashboard/swarm/containers/empty-states.tsx b/apps/dokploy/components/dashboard/swarm/containers/empty-states.tsx index 306b2f808..2e67954fe 100644 --- a/apps/dokploy/components/dashboard/swarm/containers/empty-states.tsx +++ b/apps/dokploy/components/dashboard/swarm/containers/empty-states.tsx @@ -35,7 +35,7 @@ export const DocLinks = () => ( Cluster Settings @@ -85,7 +85,7 @@ export const SwarmNotAvailable = ({
  • Check the{" "} Cluster Settings @@ -130,7 +130,7 @@ export const ServicesError = ({
  • Network connectivity issues to a remote server — check{" "} Cluster Settings @@ -183,7 +183,7 @@ export const NoServices = ({ nodeCount, onRefresh }: NoServicesProps) => ( Worker nodes need to pull images from a shared registry. Configure one in{" "} Cluster Settings @@ -255,7 +255,7 @@ export const NoRunningContainers = ({
  • Images can't be pulled on worker nodes — verify your{" "} registry configuration diff --git a/apps/dokploy/components/dashboard/swarm/containers/show-swarm-containers.tsx b/apps/dokploy/components/dashboard/swarm/containers/show-swarm-containers.tsx index 4c4c5e2be..303609487 100644 --- a/apps/dokploy/components/dashboard/swarm/containers/show-swarm-containers.tsx +++ b/apps/dokploy/components/dashboard/swarm/containers/show-swarm-containers.tsx @@ -303,7 +303,7 @@ export const ShowSwarmContainers = ({ serverId }: Props) => {

    Manage nodes in{" "} Cluster Settings diff --git a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx index 01ee03e80..2ad6b68a1 100644 --- a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx +++ b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx @@ -51,7 +51,9 @@ export default function SwarmMonitorCard({ serverId }: Props) { {!serverId && (

  • + {canManageCluster && ( + + + + )} diff --git a/apps/dokploy/pages/dashboard/settings/cluster.tsx b/apps/dokploy/pages/dashboard/settings/cluster.tsx deleted file mode 100644 index 8505272b9..000000000 --- a/apps/dokploy/pages/dashboard/settings/cluster.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { validateRequest } from "@dokploy/server"; -import { createServerSideHelpers } from "@trpc/react-query/server"; -import type { GetServerSidePropsContext } from "next"; -import type { ReactElement } from "react"; -import superjson from "superjson"; -import { ShowNodes } from "@/components/dashboard/settings/cluster/nodes/show-nodes"; -import { DashboardLayout } from "@/components/layouts/dashboard-layout"; -import { ServerFilter } from "@/components/shared/server-filter"; -import { appRouter } from "@/server/api/root"; - -const Page = () => { - return ( - - {(serverId) => ( -
    - -
    - )} -
    - ); -}; - -export default Page; - -Page.getLayout = (page: ReactElement) => { - return {page}; -}; -export async function getServerSideProps( - ctx: GetServerSidePropsContext<{ serviceId: string }>, -) { - const { req, res } = ctx; - const { user, session } = await validateRequest(ctx.req); - if (!user || user.role === "member") { - return { - redirect: { - permanent: false, - destination: "/", - }, - }; - } - const helpers = createServerSideHelpers({ - router: appRouter, - ctx: { - req: req as any, - res: res as any, - db: null as any, - session: session as any, - user: user as any, - }, - transformer: superjson, - }); - await helpers.user.get.prefetch(); - - return { - props: { - trpcState: helpers.dehydrate(), - }, - }; -}