From a6b1d6c6a65f9f233aefc235ba044712f0375290 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sun, 5 Jul 2026 16:33:42 -0600 Subject: [PATCH 1/2] feat(databases): add copy button to User and Database Name fields Adds an enableCopyButton prop to the Input component and uses it on the User, Database Name, and Internal Host fields across Postgres, MySQL, MariaDB, MongoDB, Redis, and Libsql credential views. Closes #4495 --- .../show-internal-libsql-credentials.tsx | 4 +- .../show-internal-mariadb-credentials.tsx | 6 +- .../show-internal-mongo-credentials.tsx | 4 +- .../show-internal-mysql-credentials.tsx | 6 +- .../show-internal-postgres-credentials.tsx | 6 +- .../show-internal-redis-credentials.tsx | 4 +- apps/dokploy/components/ui/input.tsx | 99 ++++++++++++------- 7 files changed, 76 insertions(+), 53 deletions(-) diff --git a/apps/dokploy/components/dashboard/libsql/general/show-internal-libsql-credentials.tsx b/apps/dokploy/components/dashboard/libsql/general/show-internal-libsql-credentials.tsx index bcdc75a25f..dbd344d991 100644 --- a/apps/dokploy/components/dashboard/libsql/general/show-internal-libsql-credentials.tsx +++ b/apps/dokploy/components/dashboard/libsql/general/show-internal-libsql-credentials.tsx @@ -28,7 +28,7 @@ export const ShowInternalLibsqlCredentials = ({ libsqlId }: Props) => {
- +
@@ -71,7 +71,7 @@ export const ShowInternalLibsqlCredentials = ({ libsqlId }: Props) => {
- +
diff --git a/apps/dokploy/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx b/apps/dokploy/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx index 04d431fa1e..7e649224e4 100644 --- a/apps/dokploy/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx +++ b/apps/dokploy/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx @@ -25,11 +25,11 @@ export const ShowInternalMariadbCredentials = ({ mariadbId }: Props) => {
- +
- +
@@ -79,7 +79,7 @@ export const ShowInternalMariadbCredentials = ({ mariadbId }: Props) => {
- +
diff --git a/apps/dokploy/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx b/apps/dokploy/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx index ef38fe3cbc..e9fa28d969 100644 --- a/apps/dokploy/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx +++ b/apps/dokploy/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx @@ -25,7 +25,7 @@ export const ShowInternalMongoCredentials = ({ mongoId }: Props) => {
- +
@@ -55,7 +55,7 @@ export const ShowInternalMongoCredentials = ({ mongoId }: Props) => {
- +
diff --git a/apps/dokploy/components/dashboard/mysql/general/show-internal-mysql-credentials.tsx b/apps/dokploy/components/dashboard/mysql/general/show-internal-mysql-credentials.tsx index 39937badde..eb578871b6 100644 --- a/apps/dokploy/components/dashboard/mysql/general/show-internal-mysql-credentials.tsx +++ b/apps/dokploy/components/dashboard/mysql/general/show-internal-mysql-credentials.tsx @@ -25,11 +25,11 @@ export const ShowInternalMysqlCredentials = ({ mysqlId }: Props) => {
- +
- +
@@ -79,7 +79,7 @@ export const ShowInternalMysqlCredentials = ({ mysqlId }: Props) => {
- +
diff --git a/apps/dokploy/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx b/apps/dokploy/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx index 3d1b1032e8..d58a835d4b 100644 --- a/apps/dokploy/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx +++ b/apps/dokploy/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx @@ -25,11 +25,11 @@ export const ShowInternalPostgresCredentials = ({ postgresId }: Props) => {
- +
- +
@@ -57,7 +57,7 @@ export const ShowInternalPostgresCredentials = ({ postgresId }: Props) => {
- +
diff --git a/apps/dokploy/components/dashboard/redis/general/show-internal-redis-credentials.tsx b/apps/dokploy/components/dashboard/redis/general/show-internal-redis-credentials.tsx index 3dd6814a24..1913d2b68d 100644 --- a/apps/dokploy/components/dashboard/redis/general/show-internal-redis-credentials.tsx +++ b/apps/dokploy/components/dashboard/redis/general/show-internal-redis-credentials.tsx @@ -25,7 +25,7 @@ export const ShowInternalRedisCredentials = ({ redisId }: Props) => {
- +
@@ -53,7 +53,7 @@ export const ShowInternalRedisCredentials = ({ redisId }: Props) => {
- +
diff --git a/apps/dokploy/components/ui/input.tsx b/apps/dokploy/components/ui/input.tsx index 6ff6e2a1dc..baf64d599f 100644 --- a/apps/dokploy/components/ui/input.tsx +++ b/apps/dokploy/components/ui/input.tsx @@ -1,13 +1,17 @@ -import { EyeIcon, EyeOffIcon, RefreshCcw } from "lucide-react"; +import copy from "copy-to-clipboard"; +import { Clipboard, EyeIcon, EyeOffIcon, RefreshCcw } from "lucide-react"; import * as React from "react"; +import { toast } from "sonner"; import { generateRandomPassword } from "@/lib/password-utils"; import { cn } from "@/lib/utils"; +import { Button } from "./button"; export interface InputProps extends React.ComponentProps<"input"> { errorMessage?: string; enablePasswordGenerator?: boolean; passwordGeneratorLength?: number; + enableCopyButton?: boolean; } function Input({ @@ -16,6 +20,7 @@ function Input({ errorMessage, enablePasswordGenerator = false, passwordGeneratorLength, + enableCopyButton = false, ref, ...props }: InputProps) { @@ -65,49 +70,67 @@ function Input({ input.dispatchEvent(new Event("input", { bubbles: true })); }; - return ( - <> -
- - {isPassword && ( -
- {shouldShowGenerator && ( - - )} + const handleCopy = () => { + copy(inputRef.current?.value || ""); + toast.success("Value is copied to clipboard"); + }; + + const inputElement = ( +
+ + {isPassword && ( +
+ {shouldShowGenerator && ( -
- )} -
+ )} + +
+ )} +
+ ); + + return ( + <> + {enableCopyButton ? ( +
+ {inputElement} + +
+ ) : ( + inputElement + )} {errorMessage && ( {errorMessage} From d8a907c3415a76cc5b89af286726469aae070b31 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 5 Jul 2026 22:34:11 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- apps/dokploy/server/api/routers/deployment.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/server/api/routers/deployment.ts b/apps/dokploy/server/api/routers/deployment.ts index 1df7840632..dcc74226a7 100644 --- a/apps/dokploy/server/api/routers/deployment.ts +++ b/apps/dokploy/server/api/routers/deployment.ts @@ -136,7 +136,9 @@ export const deploymentRouter = createTRPCRouter({ }); } else if (schedule.serverId) { const targetServer = await findServerById(schedule.serverId); - if (targetServer.organizationId !== ctx.session.activeOrganizationId) { + if ( + targetServer.organizationId !== ctx.session.activeOrganizationId + ) { throw new TRPCError({ code: "UNAUTHORIZED", message: "You don't have access to this schedule.",