From 59cbc8ee0d8b560c7d5a265e199422b0761f13e9 Mon Sep 17 00:00:00 2001
From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
Date: Mon, 1 Sep 2025 21:09:30 -0600
Subject: [PATCH] refactor: update environment selector and API routes to
utilize environmentId for service management; enhance UI with Badge component
for production environments
---
.../project/advanced-environment-selector.tsx | 22 +--
.../environment/[environmentId].tsx | 126 +++++++++++++-----
.../dokploy/server/api/routers/application.ts | 10 +-
apps/dokploy/server/api/routers/compose.ts | 10 +-
apps/dokploy/server/api/routers/mariadb.ts | 10 +-
apps/dokploy/server/api/routers/mongo.ts | 10 +-
apps/dokploy/server/api/routers/mysql.ts | 10 +-
apps/dokploy/server/api/routers/postgres.ts | 10 +-
apps/dokploy/server/api/routers/redis.ts | 10 +-
9 files changed, 136 insertions(+), 82 deletions(-)
diff --git a/apps/dokploy/components/dashboard/project/advanced-environment-selector.tsx b/apps/dokploy/components/dashboard/project/advanced-environment-selector.tsx
index b5cb9aa31..fa7ab47e9 100644
--- a/apps/dokploy/components/dashboard/project/advanced-environment-selector.tsx
+++ b/apps/dokploy/components/dashboard/project/advanced-environment-selector.tsx
@@ -23,6 +23,7 @@ import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { toast } from "sonner";
import { ChevronDownIcon, PlusIcon, PencilIcon, TrashIcon } from "lucide-react";
+import { Badge } from "@/components/ui/badge";
interface Environment {
environmentId: string;
@@ -165,9 +166,9 @@ export const AdvancedEnvironmentSelector = ({
{currentEnv?.name || "Select Environment"}
{currentEnv?.name === "production" && (
-
+
Prod
-
+
)}
@@ -189,9 +190,9 @@ export const AdvancedEnvironmentSelector = ({
{environment.name}
{environment.name === "production" && (
-
+
Prod
-
+
)}
{environment.environmentId === currentEnvironmentId && (
@@ -241,7 +242,6 @@ export const AdvancedEnvironmentSelector = ({
- {/* Create Environment Dialog */}