Merge branch 'dev' of github.com:fosrl/pangolin into dev

This commit is contained in:
Owen 2025-07-15 15:52:37 -07:00
commit 65a4f7af28
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
3 changed files with 73 additions and 35 deletions

View file

@ -1255,5 +1255,20 @@
"securityKeyRemoveTitle": "Remove Security Key",
"securityKeyRemoveDescription": "Enter your password to remove the security key \"{name}\"",
"securityKeyNoKeysRegistered": "No security keys registered",
"securityKeyNoKeysDescription": "Add a security key to enhance your account security"
"securityKeyNoKeysDescription": "Add a security key to enhance your account security",
"createDomainRequired": "Domain is required",
"createDomainAddDnsRecords": "Add DNS Records",
"createDomainAddDnsRecordsDescription": "Add the following DNS records to your domain provider to complete the setup.",
"createDomainNsRecords": "NS Records",
"createDomainRecord": "Record",
"createDomainType": "Type:",
"createDomainName": "Name:",
"createDomainValue": "Value:",
"createDomainCnameRecords": "CNAME Records",
"createDomainRecordNumber": "Record {number}",
"createDomainTxtRecords": "TXT Records",
"createDomainSaveTheseRecords": "Save These Records",
"createDomainSaveTheseRecordsDescription": "Make sure to save these DNS records as you will not see them again.",
"createDomainDnsPropagation": "DNS Propagation",
"createDomainDnsPropagationDescription": "DNS changes may take some time to propagate across the internet. This can take anywhere from a few minutes to 48 hours, depending on your DNS provider and TTL settings."
}

View file

@ -39,6 +39,38 @@ export async function deleteAccountDomain(
let numOrgDomains: OrgDomains[] | undefined;
await db.transaction(async (trx) => {
const [existing] = await trx
.select()
.from(orgDomains)
.where(
and(
eq(orgDomains.orgId, orgId),
eq(orgDomains.domainId, domainId)
)
)
.innerJoin(
domains,
eq(orgDomains.domainId, domains.domainId)
);
if (!existing) {
return next(
createHttpError(
HttpCode.NOT_FOUND,
"Domain not found for this account"
)
);
}
if (existing.domains.configManaged) {
return next(
createHttpError(
HttpCode.BAD_REQUEST,
"Cannot delete a domain that is managed by the config"
)
);
}
await trx
.delete(orgDomains)
.where(

View file

@ -197,11 +197,10 @@ export default function CreateDomainForm({
<Alert variant="default">
<InfoIcon className="h-4 w-4" />
<AlertTitle className="font-semibold">
Add DNS Records
{t("createDomainAddDnsRecords")}
</AlertTitle>
<AlertDescription>
Add the following DNS records to your domain
provider to complete the setup.
{t("createDomainAddDnsRecordsDescription")}
</AlertDescription>
</Alert>
@ -210,18 +209,18 @@ export default function CreateDomainForm({
createdDomain.nsRecords && (
<div>
<h3 className="font-medium mb-3">
NS Records
{t("createDomainNsRecords")}
</h3>
<InfoSections cols={1}>
<InfoSection>
<InfoSectionTitle>
Record
{t("createDomainRecord")}
</InfoSectionTitle>
<InfoSectionContent>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
Type:
{t("createDomainType")}
</span>
<span className="text-sm font-mono">
NS
@ -229,14 +228,14 @@ export default function CreateDomainForm({
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
Name:
{t("createDomainName")}
</span>
<span className="text-sm font-mono">
{baseDomain}
</span>
</div>
<span className="text-sm font-medium">
Value:
{t("createDomainValue")}
</span>
{createdDomain.nsRecords.map(
(
@ -272,7 +271,7 @@ export default function CreateDomainForm({
.length > 0 && (
<div>
<h3 className="font-medium mb-3">
CNAME Records
{t("createDomainCnameRecords")}
</h3>
<InfoSections cols={1}>
{createdDomain.cnameRecords.map(
@ -285,16 +284,14 @@ export default function CreateDomainForm({
index
}
>
<InfoSectionTitle>
Record{" "}
{index +
1}
</InfoSectionTitle>
<InfoSectionTitle>
{t("createDomainRecordNumber", { number: index + 1 })}
</InfoSectionTitle>
<InfoSectionContent>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
Type:
{t("createDomainType")}
</span>
<span className="text-sm font-mono">
CNAME
@ -302,7 +299,7 @@ export default function CreateDomainForm({
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
Name:
{t("createDomainName")}
</span>
<span className="text-sm font-mono">
{
@ -312,7 +309,7 @@ export default function CreateDomainForm({
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
Value:
{t("createDomainValue")}
</span>
<CopyToClipboard
text={
@ -334,7 +331,7 @@ export default function CreateDomainForm({
.length > 0 && (
<div>
<h3 className="font-medium mb-3">
TXT Records
{t("createDomainTxtRecords")}
</h3>
<InfoSections cols={1}>
{createdDomain.txtRecords.map(
@ -347,16 +344,14 @@ export default function CreateDomainForm({
index
}
>
<InfoSectionTitle>
Record{" "}
{index +
1}
</InfoSectionTitle>
<InfoSectionTitle>
{t("createDomainRecordNumber", { number: index + 1 })}
</InfoSectionTitle>
<InfoSectionContent>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
Type:
{t("createDomainType")}
</span>
<span className="text-sm font-mono">
TXT
@ -364,7 +359,7 @@ export default function CreateDomainForm({
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
Name:
{t("createDomainName")}
</span>
<span className="text-sm font-mono">
{
@ -374,7 +369,7 @@ export default function CreateDomainForm({
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
Value:
{t("createDomainValue")}
</span>
<CopyToClipboard
text={
@ -399,11 +394,10 @@ export default function CreateDomainForm({
<Alert variant="destructive">
<AlertTriangle className="h-4 w-4" />
<AlertTitle className="font-semibold">
Save These Records
{t("createDomainSaveTheseRecords")}
</AlertTitle>
<AlertDescription>
Make sure to save these DNS records
as you will not see them again.
{t("createDomainSaveTheseRecordsDescription")}
</AlertDescription>
</Alert>
))}
@ -411,13 +405,10 @@ export default function CreateDomainForm({
<Alert variant="info">
<AlertTriangle className="h-4 w-4" />
<AlertTitle className="font-semibold">
DNS Propagation
{t("createDomainDnsPropagation")}
</AlertTitle>
<AlertDescription>
DNS changes may take some time to propagate
across the internet. This can take anywhere
from a few minutes to 48 hours, depending on
your DNS provider and TTL settings.
{t("createDomainDnsPropagationDescription")}
</AlertDescription>
</Alert>
</div>