Use a records for the wildcard

This commit is contained in:
Owen
2025-07-17 16:17:01 -07:00
parent e562946308
commit 0a2b1d9e53
3 changed files with 247 additions and 202 deletions

View File

@@ -1266,6 +1266,7 @@
"createDomainName": "Name:",
"createDomainValue": "Value:",
"createDomainCnameRecords": "CNAME Records",
"createDomainARecords": "A Records",
"createDomainRecordNumber": "Record {number}",
"createDomainTxtRecords": "TXT Records",
"createDomainSaveTheseRecords": "Save These Records",

View File

@@ -29,6 +29,7 @@ export type CreateDomainResponse = {
domainId: string;
nsRecords?: string[];
cnameRecords?: { baseDomain: string; value: string }[];
aRecords?: { baseDomain: string; value: string }[];
txtRecords?: { baseDomain: string; value: string }[];
};
@@ -97,6 +98,7 @@ export async function createOrgDomain(
}
let numOrgDomains: OrgDomains[] | undefined;
let aRecords: CreateDomainResponse["aRecords"];
let cnameRecords: CreateDomainResponse["cnameRecords"];
let txtRecords: CreateDomainResponse["txtRecords"];
let nsRecords: CreateDomainResponse["nsRecords"];
@@ -239,7 +241,7 @@ export async function createOrgDomain(
}
];
} else if (type === "wildcard") {
cnameRecords = [
aRecords = [
{
value: `Server IP Address`,
baseDomain: `*.${baseDomain}`
@@ -271,7 +273,8 @@ export async function createOrgDomain(
domainId: returned.domainId,
cnameRecords,
txtRecords,
nsRecords
nsRecords,
aRecords
},
success: true,
error: false,

View File

@@ -205,8 +205,8 @@ export default function CreateDomainForm({
</Alert>
<div className="space-y-4">
{domainType === "ns" &&
createdDomain.nsRecords && (
{createdDomain.nsRecords &&
createdDomain.nsRecords.length > 0 && (
<div>
<h3 className="font-medium mb-3">
{t("createDomainNsRecords")}
@@ -214,9 +214,7 @@ export default function CreateDomainForm({
<InfoSections cols={1}>
<InfoSection>
<InfoSectionTitle>
{t(
"createDomainRecord"
)}
{t("createDomainRecord")}
</InfoSectionTitle>
<InfoSectionContent>
<div className="space-y-2">
@@ -252,9 +250,7 @@ export default function CreateDomainForm({
) => (
<div
className="flex justify-between items-center"
key={
index
}
key={index}
>
<CopyToClipboard
text={
@@ -271,28 +267,17 @@ export default function CreateDomainForm({
</div>
)}
{(domainType == "cname" ||
domainType == "wildcard") && (
<>
{createdDomain.cnameRecords &&
createdDomain.cnameRecords
.length > 0 && (
createdDomain.cnameRecords.length > 0 && (
<div>
<h3 className="font-medium mb-3">
{t(
"createDomainCnameRecords"
)}
{t("createDomainCnameRecords")}
</h3>
<InfoSections cols={1}>
{createdDomain.cnameRecords.map(
(
cnameRecord,
index
) => (
(cnameRecord, index) => (
<InfoSection
key={
index
}
key={index}
>
<InfoSectionTitle>
{t(
@@ -349,25 +334,83 @@ export default function CreateDomainForm({
</div>
)}
{createdDomain.txtRecords &&
createdDomain.txtRecords
.length > 0 && (
{createdDomain.aRecords &&
createdDomain.aRecords.length > 0 && (
<div>
<h3 className="font-medium mb-3">
{t("createDomainARecords")}
</h3>
<InfoSections cols={1}>
{createdDomain.aRecords.map(
(aRecord, index) => (
<InfoSection
key={index}
>
<InfoSectionTitle>
{t(
"createDomainTxtRecords"
"createDomainRecordNumber",
{
number:
index +
1
}
)}
</InfoSectionTitle>
<InfoSectionContent>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
{t(
"createDomainType"
)}
</span>
<span className="text-sm font-mono">
A
</span>
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
{t(
"createDomainName"
)}
</span>
<span className="text-sm font-mono">
{
aRecord.baseDomain
}
</span>
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
{t(
"createDomainValue"
)}
</span>
<span className="text-sm font-mono">
{
aRecord.value
}
</span>
</div>
</div>
</InfoSectionContent>
</InfoSection>
)
)}
</InfoSections>
</div>
)}
{createdDomain.txtRecords &&
createdDomain.txtRecords.length > 0 && (
<div>
<h3 className="font-medium mb-3">
{t("createDomainTxtRecords")}
</h3>
<InfoSections cols={1}>
{createdDomain.txtRecords.map(
(
txtRecord,
index
) => (
(txtRecord, index) => (
<InfoSection
key={
index
}
key={index}
>
<InfoSectionTitle>
{t(
@@ -423,8 +466,6 @@ export default function CreateDomainForm({
</InfoSections>
</div>
)}
</>
)}
</div>
{build == "saas" ||