Skip to content

Commit a50f958

Browse files
authored
feat(settings): add copy button to server IP in web server settings (Dokploy#4397)
1 parent 1fdbe87 commit a50f958

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎apps/dokploy/components/dashboard/settings/web-server.tsx‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ServerIcon } from "lucide-react";
1+
import { CopyIcon, ServerIcon } from "lucide-react";
22
import {
33
Card,
44
CardContent,
@@ -7,6 +7,8 @@ import {
77
CardTitle,
88
} from "@/components/ui/card";
99
import { api } from "@/utils/api";
10+
import copy from "copy-to-clipboard";
11+
import { toast } from "sonner";
1012
import { ShowDokployActions } from "./servers/actions/show-dokploy-actions";
1113
import { ShowStorageActions } from "./servers/actions/show-storage-actions";
1214
import { ShowTraefikActions } from "./servers/actions/show-traefik-actions";
@@ -49,8 +51,17 @@ export const WebServer = () => {
4951
</div>
5052

5153
<div className="flex items-center flex-wrap justify-between gap-4">
52-
<span className="text-sm text-muted-foreground">
54+
<span className="text-sm text-muted-foreground flex items-center gap-1.5">
5355
Server IP: {webServerSettings?.serverIp}
56+
{webServerSettings?.serverIp && (
57+
<CopyIcon
58+
className="size-3.5 cursor-pointer hover:text-foreground transition-colors"
59+
onClick={() => {
60+
copy(webServerSettings.serverIp ?? "");
61+
toast.success("Copied to clipboard");
62+
}}
63+
/>
64+
)}
5465
</span>
5566
<span className="text-sm text-muted-foreground">
5667
Version: {dokployVersion}

0 commit comments

Comments
 (0)