mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-22 07:26:39 +00:00
Add copy IP button to domain details
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/eea8af3c-4b4c-47c8-9c7b-2c74fd45c59b.jpg
This commit is contained in:
@@ -460,68 +460,65 @@ export function DomainDetails({ domain, onBack }: DomainDetailsProps) {
|
|||||||
<Badge variant="outline">{record.type}</Badge>
|
<Badge variant="outline">{record.type}</Badge>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<TooltipProvider>
|
{record.isAutoIP ? (
|
||||||
<Tooltip>
|
record.currentIp ? (
|
||||||
<TooltipTrigger asChild>
|
<TooltipProvider>
|
||||||
<span className="truncate max-w-[150px] inline-block">
|
<Tooltip>
|
||||||
{record.isAutoIP
|
<TooltipTrigger asChild>
|
||||||
? "Auto-managed"
|
<Button
|
||||||
: record.content}
|
variant="ghost"
|
||||||
</span>
|
size="sm"
|
||||||
</TooltipTrigger>
|
className="h-7 px-2 text-xs font-mono"
|
||||||
<TooltipContent>
|
onClick={() => {
|
||||||
<p>
|
navigator.clipboard.writeText(record.currentIp || '');
|
||||||
{record.isAutoIP
|
toast({
|
||||||
? "Content automatically managed by AutoIP"
|
title: "IP copied to clipboard",
|
||||||
: record.content}
|
description: record.currentIp,
|
||||||
</p>
|
duration: 2000
|
||||||
{record.notes && (
|
});
|
||||||
<>
|
}}
|
||||||
<div className="border-t my-1"></div>
|
>
|
||||||
<p className="italic text-xs">{record.notes}</p>
|
<span className="flex items-center gap-1">
|
||||||
</>
|
{record.currentIp.substring(0, 12)}...
|
||||||
)}
|
<Copy className="h-3 w-3" />
|
||||||
</TooltipContent>
|
</span>
|
||||||
</Tooltip>
|
</Button>
|
||||||
</TooltipProvider>
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>
|
||||||
|
<p className="font-mono">{record.currentIp}</p>
|
||||||
|
<p className="text-xs mt-1">Click to copy</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
) : (
|
||||||
|
<span className="text-muted-foreground text-sm">Resolving IP...</span>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<TooltipProvider>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger asChild>
|
||||||
|
<span className="truncate max-w-[150px] inline-block">
|
||||||
|
{record.content}
|
||||||
|
</span>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>
|
||||||
|
<p>{record.content}</p>
|
||||||
|
{record.notes && (
|
||||||
|
<>
|
||||||
|
<div className="border-t my-1"></div>
|
||||||
|
<p className="italic text-xs">{record.notes}</p>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{record.isAutoIP ? (
|
{record.isAutoIP ? (
|
||||||
<div className="flex items-center gap-2">
|
<Badge variant="outline" className="bg-blue-50 text-blue-600 border-blue-200">
|
||||||
<Badge variant="outline" className="bg-blue-50 text-blue-600 border-blue-200">
|
Enabled
|
||||||
Enabled
|
</Badge>
|
||||||
</Badge>
|
|
||||||
{record.currentIp && (
|
|
||||||
<TooltipProvider>
|
|
||||||
<Tooltip>
|
|
||||||
<TooltipTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
size="sm"
|
|
||||||
className="h-7 px-2 text-xs font-mono"
|
|
||||||
onClick={() => {
|
|
||||||
navigator.clipboard.writeText(record.currentIp || '');
|
|
||||||
toast({
|
|
||||||
title: "IP copied to clipboard",
|
|
||||||
description: record.currentIp,
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span className="flex items-center gap-1">
|
|
||||||
{record.currentIp.substring(0, 10)}...
|
|
||||||
<Copy className="h-3 w-3" />
|
|
||||||
</span>
|
|
||||||
</Button>
|
|
||||||
</TooltipTrigger>
|
|
||||||
<TooltipContent>
|
|
||||||
<p className="font-mono">{record.currentIp}</p>
|
|
||||||
<p className="text-xs mt-1">Click to copy</p>
|
|
||||||
</TooltipContent>
|
|
||||||
</Tooltip>
|
|
||||||
</TooltipProvider>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
) : (
|
) : (
|
||||||
<Badge variant="outline" className="bg-gray-50 text-gray-500 border-gray-200">
|
<Badge variant="outline" className="bg-gray-50 text-gray-500 border-gray-200">
|
||||||
Disabled
|
Disabled
|
||||||
|
|||||||
Reference in New Issue
Block a user