@@ -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 6ff6e2a1d..baf64d599 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}
diff --git a/apps/dokploy/server/api/routers/deployment.ts b/apps/dokploy/server/api/routers/deployment.ts
index 1df784063..dcc74226a 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.",