From e9322fc900aecb153de7723bbf40079486ab02c5 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 1 Sep 2025 20:58:22 -0600 Subject: [PATCH] refactor: add environment name links to service components for improved navigation and context clarity --- .../services/application/[applicationId].tsx | 4 + .../services/compose/[composeId].tsx | 4 + .../services/mariadb/[mariadbId].tsx | 4 + .../services/mongo/[mongoId].tsx | 4 + .../services/mysql/[mysqlId].tsx | 4 + .../services/postgres/[postgresId].tsx | 324 +++++++++++------- .../services/redis/[redisId].tsx | 5 + 7 files changed, 218 insertions(+), 131 deletions(-) diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/application/[applicationId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/application/[applicationId].tsx index 920eef81b..2a1c22b1b 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/application/[applicationId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/application/[applicationId].tsx @@ -100,6 +100,10 @@ const Service = ( name: data?.environment.project.name || "", href: `/dashboard/project/${projectId}`, }, + { + name: data?.environment?.name || "", + href: `/dashboard/project/${projectId}/environment/${environmentId}`, + }, { name: data?.name || "", href: `/dashboard/project/${projectId}/environment/${environmentId}/services/application/${applicationId}`, diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/compose/[composeId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/compose/[composeId].tsx index 9bae299bf..c586dc66c 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/compose/[composeId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/compose/[composeId].tsx @@ -91,6 +91,10 @@ const Service = ( name: data?.environment?.project?.name || "", href: `/dashboard/project/${projectId}`, }, + { + name: data?.environment?.name || "", + href: `/dashboard/project/${projectId}/environment/${environmentId}`, + }, { name: data?.name || "", href: `/dashboard/project/${projectId}/environment/${environmentId}/services/compose/${composeId}`, diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mariadb/[mariadbId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mariadb/[mariadbId].tsx index da10ade14..3bb18fe4e 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mariadb/[mariadbId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mariadb/[mariadbId].tsx @@ -72,6 +72,10 @@ const Mariadb = ( name: data?.environment?.project?.name || "", href: `/dashboard/project/${projectId}`, }, + { + name: data?.environment?.name || "", + href: `/dashboard/project/${projectId}/environment/${environmentId}`, + }, { name: data?.name || "", href: `/dashboard/project/${projectId}/environment/${environmentId}/services/mariadb/${mariadbId}`, diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mongo/[mongoId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mongo/[mongoId].tsx index ae74b1e9e..8d250a7d3 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mongo/[mongoId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mongo/[mongoId].tsx @@ -72,6 +72,10 @@ const Mongo = ( name: data?.environment?.project?.name || "", href: `/dashboard/project/${projectId}`, }, + { + name: data?.environment?.name || "", + href: `/dashboard/project/${projectId}/environment/${environmentId}`, + }, { name: data?.name || "", href: `/dashboard/project/${projectId}/environment/${environmentId}/services/mongo/${mongoId}`, diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mysql/[mysqlId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mysql/[mysqlId].tsx index cddc022e0..093453a0d 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mysql/[mysqlId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/mysql/[mysqlId].tsx @@ -71,6 +71,10 @@ const MySql = ( name: data?.environment?.project?.name || "", href: `/dashboard/project/${projectId}`, }, + { + name: data?.environment?.name || "", + href: `/dashboard/project/${projectId}/environment/${environmentId}`, + }, { name: data?.name || "", href: `/dashboard/project/${projectId}/environment/${environmentId}/services/mysql/${mysqlId}`, diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/postgres/[postgresId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/postgres/[postgresId].tsx index 3cb5134c9..41522516e 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/postgres/[postgresId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/postgres/[postgresId].tsx @@ -71,15 +71,23 @@ const Postgresql = ( name: data?.environment?.project?.name || "", href: `/dashboard/project/${projectId}`, }, + { + name: data?.environment?.name || "", + href: + `/dashboard/project/${projectId}/environment/${environmentId}`, + }, { name: data?.name || "", - href: `/dashboard/project/${projectId}/environment/${environmentId}/services/postgres/${postgresId}`, + href: + `/dashboard/project/${projectId}/environment/${environmentId}/services/postgres/${postgresId}`, }, ]} /> - Database: {data?.name} - {data?.environment?.project?.name} | Dokploy + Database: {data?.name} - {data?.environment?.project?.name} + {" "} + | Dokploy
@@ -90,7 +98,9 @@ const Postgresql = (
- +
@@ -98,7 +108,9 @@ const Postgresql = ( {data?.name} {data?.description && ( - {data?.description} + + {data?.description} + )} @@ -108,17 +120,17 @@ const Postgresql = (
{data?.server?.name || "Dokploy Server"} - {data?.server?.serverStatus === "inactive" && ( + {data?.server?.serverStatus === + "inactive" && ( @@ -132,9 +144,11 @@ const Postgresql = ( side="top" > - You cannot, deploy this application because the - server is inactive, please upgrade your plan to add - more servers. + You cannot, deploy this + application because the + server is inactive, + please upgrade your plan + to add more servers. @@ -144,132 +158,178 @@ const Postgresql = (
- {(auth?.role === "owner" || auth?.canDeleteServices) && ( - + {(auth?.role === "owner" || + auth?.canDeleteServices) && ( + )}
- {data?.server?.serverStatus === "inactive" ? ( -
-
- - - This service is hosted on the server {data.server.name}, - but this server has been disabled because your current - plan doesn't include enough servers. Please purchase more - servers to regain access to this application. - - - Go to{" "} - - Billing - - + {data?.server?.serverStatus === "inactive" + ? ( +
+
+ + + This service is hosted on the + server{" "} + {data.server.name}, but this + server has been disabled because + your current plan doesn't + include enough servers. Please + purchase more servers to regain + access to this application. + + + Go to{" "} + + Billing + + +
-
- ) : ( - { - setSab(e as TabState); - const newPath = `/dashboard/project/${projectId}/environment/${environmentId}/services/postgres/${postgresId}?tab=${e}`; + ) + : ( + { + setSab(e as TabState); + const newPath = + `/dashboard/project/${projectId}/environment/${environmentId}/services/postgres/${postgresId}?tab=${e}`; - router.push(newPath, undefined, { shallow: true }); - }} - > -
- +
+ - General - Environment - Logs - {((data?.serverId && isCloud) || !data?.server) && ( - Monitoring - )} - Backups - Advanced - -
- - -
- - - -
-
- -
- -
-
- -
-
- {data?.serverId && isCloud ? ( - - ) : ( - <> - - )} + > + + General + + + Environment + + + Logs + + {((data?.serverId && isCloud) || + !data?.server) && ( + + Monitoring + + )} + + Backups + + + Advanced + + +
+ + +
+ + +
-
-
- -
- -
-
- -
- -
-
- -
- -
-
- - )} + + +
+ +
+
+ +
+
+ {data?.serverId && isCloud + ? ( + + ) + : ( + <> + + + )} +
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + )}
@@ -284,7 +344,9 @@ Postgresql.getLayout = (page: ReactElement) => { }; export async function getServerSideProps( - ctx: GetServerSidePropsContext<{ postgresId: string; activeTab: TabState; environmentId: string }>, + ctx: GetServerSidePropsContext< + { postgresId: string; activeTab: TabState; environmentId: string } + >, ) { const { query, params, req, res } = ctx; const activeTab = query.tab; diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/redis/[redisId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/redis/[redisId].tsx index 9039a9711..c7c79237f 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/redis/[redisId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/redis/[redisId].tsx @@ -71,6 +71,11 @@ const Redis = ( name: data?.environment?.project?.name || "", href: `/dashboard/project/${projectId}`, }, + { + name: data?.environment?.name || "", + href: + `/dashboard/project/${projectId}/environment/${environmentId}`, + }, { name: data?.name || "", href: `/dashboard/project/${projectId}/environment/${environmentId}/services/redis/${redisId}`,