mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: added clipboard functionality to copy IP address from badge in services pages
This commit is contained in:
@@ -51,7 +51,7 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import React, { useState, useEffect, type ReactElement } from "react";
|
import React, { useState, useEffect, type ReactElement } from "react";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import superjson from "superjson";
|
import superjson from "superjson";
|
||||||
|
|
||||||
type TabState =
|
type TabState =
|
||||||
| "projects"
|
| "projects"
|
||||||
@@ -139,6 +139,13 @@ const Service = (
|
|||||||
<div className="flex flex-col h-fit w-fit gap-2">
|
<div className="flex flex-col h-fit w-fit gap-2">
|
||||||
<div className="flex flex-row h-fit w-fit gap-2">
|
<div className="flex flex-row h-fit w-fit gap-2">
|
||||||
<Badge
|
<Badge
|
||||||
|
className="cursor-pointer"
|
||||||
|
onClick={() => {
|
||||||
|
if (data?.server?.ipAddress) {
|
||||||
|
navigator.clipboard.writeText(data.server.ipAddress);
|
||||||
|
toast.success("IP Address Copied!");
|
||||||
|
}
|
||||||
|
}}
|
||||||
variant={
|
variant={
|
||||||
!data?.serverId
|
!data?.serverId
|
||||||
? "default"
|
? "default"
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import React, { useState, useEffect, type ReactElement } from "react";
|
import React, { useState, useEffect, type ReactElement } from "react";
|
||||||
import superjson from "superjson";
|
import superjson from "superjson";
|
||||||
|
import { toast } from "sonner";
|
||||||
|
|
||||||
type TabState =
|
type TabState =
|
||||||
| "projects"
|
| "projects"
|
||||||
@@ -131,6 +132,13 @@ const Service = (
|
|||||||
<div className="flex flex-col h-fit w-fit gap-2">
|
<div className="flex flex-col h-fit w-fit gap-2">
|
||||||
<div className="flex flex-row h-fit w-fit gap-2">
|
<div className="flex flex-row h-fit w-fit gap-2">
|
||||||
<Badge
|
<Badge
|
||||||
|
className="cursor-pointer"
|
||||||
|
onClick={() => {
|
||||||
|
if (data?.server?.ipAddress) {
|
||||||
|
navigator.clipboard.writeText(data.server.ipAddress);
|
||||||
|
toast.success("IP Address Copied!");
|
||||||
|
}
|
||||||
|
}}
|
||||||
variant={
|
variant={
|
||||||
!data?.serverId
|
!data?.serverId
|
||||||
? "default"
|
? "default"
|
||||||
@@ -142,7 +150,7 @@ const Service = (
|
|||||||
{data?.server?.name || "Dokploy Server"}
|
{data?.server?.name || "Dokploy Server"}
|
||||||
</Badge>
|
</Badge>
|
||||||
{data?.server?.serverStatus === "inactive" && (
|
{data?.server?.serverStatus === "inactive" && (
|
||||||
<TooltipProvider delayDuration={0}>
|
<TooltipProvider>
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<Label className="break-all w-fit flex flex-row gap-1 items-center">
|
<Label className="break-all w-fit flex flex-row gap-1 items-center">
|
||||||
|
|||||||
Reference in New Issue
Block a user