mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-05 15:57:43 +00:00
Add DNS provider selection to DNS record management
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/d1d58992-6126-4087-9a19-644812ce2f0a.jpg
This commit is contained in:
@@ -77,6 +77,7 @@ const dnsRecordSchema = z.object({
|
||||
isActive: z.boolean().default(true),
|
||||
isAutoIP: z.boolean().default(false),
|
||||
notes: z.string().optional(),
|
||||
providerId: z.string().uuid().optional(),
|
||||
});
|
||||
|
||||
export default function DnsRecordsPage() {
|
||||
@@ -110,6 +111,11 @@ export default function DnsRecordsPage() {
|
||||
queryKey: ["/api/dns-records", domainId],
|
||||
enabled: !!domainId,
|
||||
});
|
||||
|
||||
// Fetch available providers
|
||||
const { data: providers = [] } = useQuery<{ id: string; name: string }[]>({
|
||||
queryKey: ["/api/providers"],
|
||||
});
|
||||
|
||||
// Form for adding/editing a DNS record
|
||||
const form = useForm<z.infer<typeof dnsRecordSchema>>({
|
||||
@@ -123,6 +129,7 @@ export default function DnsRecordsPage() {
|
||||
isActive: true,
|
||||
isAutoIP: false,
|
||||
notes: "",
|
||||
providerId: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -138,6 +145,7 @@ export default function DnsRecordsPage() {
|
||||
isActive: selectedRecord.isActive,
|
||||
isAutoIP: selectedRecord.isAutoIP ?? false,
|
||||
notes: selectedRecord.notes ?? "",
|
||||
providerId: selectedRecord.providerId,
|
||||
});
|
||||
} else {
|
||||
form.reset({
|
||||
@@ -149,6 +157,7 @@ export default function DnsRecordsPage() {
|
||||
isActive: true,
|
||||
isAutoIP: false,
|
||||
notes: "",
|
||||
providerId: undefined,
|
||||
});
|
||||
}
|
||||
}, [selectedRecord, form]);
|
||||
|
||||
Reference in New Issue
Block a user