mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-07-26 11:38:13 +00:00
Fix navigation and DNS record management issues. Improved back button implementation and updated enable/disable functionality for DNS records.
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/ed9cd0f0-32d1-420e-a7ed-01994944d731.jpg
This commit is contained in:
@@ -393,7 +393,15 @@ export function DomainDetails({ domain, onBack }: DomainDetailsProps) {
|
||||
return (
|
||||
<>
|
||||
<div className="mb-6 flex justify-between items-center">
|
||||
<h2 className="text-xl font-semibold">DNS Records for {domain.name}</h2>
|
||||
<div className="flex items-center space-x-4">
|
||||
{onBack && (
|
||||
<Button variant="outline" onClick={onBack} className="h-9">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="mr-2 h-4 w-4"><path d="m15 18-6-6 6-6"/></svg>
|
||||
Back
|
||||
</Button>
|
||||
)}
|
||||
<h2 className="text-xl font-semibold">DNS Records for {domain.name}</h2>
|
||||
</div>
|
||||
<Button onClick={handleAddRecord}>
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
Add Record
|
||||
@@ -477,28 +485,20 @@ export function DomainDetails({ domain, onBack }: DomainDetailsProps) {
|
||||
: "Never"}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{record.isActive ? (
|
||||
<Badge variant="outline" className="bg-green-50 text-green-700 border-green-200">Active</Badge>
|
||||
) : (
|
||||
<Badge variant="secondary">Inactive</Badge>
|
||||
)}
|
||||
<div className="flex items-center gap-2">
|
||||
<Switch
|
||||
checked={record.isActive}
|
||||
onCheckedChange={(checked) => handleToggleActive(record, checked)}
|
||||
className="data-[state=checked]:bg-green-500"
|
||||
size="lg"
|
||||
/>
|
||||
<span className={record.isActive ? "text-green-700 font-medium" : "text-muted-foreground"}>
|
||||
{record.isActive ? "Active" : "Inactive"}
|
||||
</span>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<div className="flex justify-end gap-2">
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Switch
|
||||
checked={record.isActive}
|
||||
onCheckedChange={(checked) => handleToggleActive(record, checked)}
|
||||
className="mx-2"
|
||||
/>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>{record.isActive ? "Disable" : "Enable"} record</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
|
||||
Reference in New Issue
Block a user