From ee3ff18feb4d8f6ac9e5cd148e77f5d9634cf725 Mon Sep 17 00:00:00 2001 From: HarikrishnanD Date: Fri, 26 Sep 2025 14:15:58 +0530 Subject: [PATCH 1/2] fix: correct "Most services" sorting to count total services across environments - Fix sorting logic to count actual services instead of environment count - Projects now properly sort by total service count in descending order - Resolves issue where "Most services" showed ascending order instead of descending -#2691 --- .../components/dashboard/projects/show.tsx | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/components/dashboard/projects/show.tsx b/apps/dokploy/components/dashboard/projects/show.tsx index 12ee3b211..0b4ac3fca 100644 --- a/apps/dokploy/components/dashboard/projects/show.tsx +++ b/apps/dokploy/components/dashboard/projects/show.tsx @@ -96,8 +96,26 @@ export const ShowProjects = () => { new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime(); break; case "services": { - const aTotalServices = a.environments.length; - const bTotalServices = b.environments.length; + const aTotalServices = a.environments.reduce((total, env) => { + return total + + (env.applications?.length || 0) + + (env.mariadb?.length || 0) + + (env.mongo?.length || 0) + + (env.mysql?.length || 0) + + (env.postgres?.length || 0) + + (env.redis?.length || 0) + + (env.compose?.length || 0); + }, 0); + const bTotalServices = b.environments.reduce((total, env) => { + return total + + (env.applications?.length || 0) + + (env.mariadb?.length || 0) + + (env.mongo?.length || 0) + + (env.mysql?.length || 0) + + (env.postgres?.length || 0) + + (env.redis?.length || 0) + + (env.compose?.length || 0); + }, 0); comparison = aTotalServices - bTotalServices; break; } From cbdc4e4a203271e0bdb0dfe68370b80e3cd4c5fe Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 08:48:23 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- apps/dokploy/components/dashboard/projects/show.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/dokploy/components/dashboard/projects/show.tsx b/apps/dokploy/components/dashboard/projects/show.tsx index 0b4ac3fca..783c5bb32 100644 --- a/apps/dokploy/components/dashboard/projects/show.tsx +++ b/apps/dokploy/components/dashboard/projects/show.tsx @@ -97,24 +97,28 @@ export const ShowProjects = () => { break; case "services": { const aTotalServices = a.environments.reduce((total, env) => { - return total + + return ( + total + (env.applications?.length || 0) + (env.mariadb?.length || 0) + (env.mongo?.length || 0) + (env.mysql?.length || 0) + (env.postgres?.length || 0) + (env.redis?.length || 0) + - (env.compose?.length || 0); + (env.compose?.length || 0) + ); }, 0); const bTotalServices = b.environments.reduce((total, env) => { - return total + + return ( + total + (env.applications?.length || 0) + (env.mariadb?.length || 0) + (env.mongo?.length || 0) + (env.mysql?.length || 0) + (env.postgres?.length || 0) + (env.redis?.length || 0) + - (env.compose?.length || 0); + (env.compose?.length || 0) + ); }, 0); comparison = aTotalServices - bTotalServices; break;