From f9dedd979ee2572092f10462f84182ef7e28e6fd Mon Sep 17 00:00:00 2001 From: Luka Klacar Date: Sat, 28 Feb 2026 23:12:31 +0100 Subject: [PATCH] fix: Fixed service card behavior #3837 --- .../environment/[environmentId].tsx | 182 +++++++++--------- 1 file changed, 90 insertions(+), 92 deletions(-) diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId].tsx index af901311e..37a5364bb 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId].tsx @@ -23,7 +23,7 @@ import type { InferGetServerSidePropsType, } from "next"; import Head from "next/head"; -import { useRouter } from "next/router"; +import Link from "next/link"; import { type ReactElement, useEffect, useMemo, useState } from "react"; import { toast } from "sonner"; import superjson from "superjson"; @@ -366,7 +366,6 @@ const EnvironmentPage = ( environmentId, }); const { data: allProjects } = api.project.all.useQuery(); - const router = useRouter(); const [isMoveDialogOpen, setIsMoveDialogOpen] = useState(false); const [selectedTargetProject, setSelectedTargetProject] = @@ -420,6 +419,7 @@ const EnvironmentPage = ( }; const handleServiceSelect = (serviceId: string, event: React.MouseEvent) => { + event.preventDefault(); event.stopPropagation(); setSelectedServices((prev) => prev.includes(serviceId) @@ -1471,101 +1471,99 @@ const EnvironmentPage = (
{filteredServices?.map((service) => ( - { - router.push( - `/dashboard/project/${projectId}/environment/${environmentId}/services/${service.type}/${service.id}`, - ); - }} - className="flex flex-col group relative cursor-pointer bg-transparent transition-colors hover:bg-border" + href={`/dashboard/project/${projectId}/environment/${environmentId}/services/${service.type}/${service.id}`} + className="block" > - {service.serverId && ( -
- -
- )} -
- -
- -
- handleServiceSelect(service.id, e) - } - > -
- -
-
- - - -
-
- - {service.name} - - {service.description && ( - - {service.description} - - )} -
- - - {service.type === "postgres" && ( - - )} - {service.type === "redis" && ( - - )} - {service.type === "mariadb" && ( - - )} - {service.type === "mongo" && ( - - )} - {service.type === "mysql" && ( - - )} - {service.type === "application" && ( - - )} - {service.type === "compose" && ( - - )} - + + {service.serverId && ( +
+
- - - -
- {service.serverName && ( -
- - - {service.serverName} + )} +
+ +
+ +
+ handleServiceSelect(service.id, e) + } + > +
+ +
+
+ + + +
+
+ + {service.name} + + {service.description && ( + + {service.description} + + )} +
+ + + {service.type === "postgres" && ( + + )} + {service.type === "redis" && ( + + )} + {service.type === "mariadb" && ( + + )} + {service.type === "mongo" && ( + + )} + {service.type === "mysql" && ( + + )} + {service.type === "application" && ( + + )} + {service.type === "compose" && ( + + )}
- )} - - Created - -
- - + + + +
+ {service.serverName && ( +
+ + + {service.serverName} + +
+ )} + + Created + +
+
+ + ))}