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", "securityKeyRemoveTitle": "Remove Security Key",
"securityKeyRemoveDescription": "Enter your password to remove the security key \"{name}\"", "securityKeyRemoveDescription": "Enter your password to remove the security key \"{name}\"",
"securityKeyNoKeysRegistered": "No security keys registered", "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; let numOrgDomains: OrgDomains[] | undefined;
await db.transaction(async (trx) => { 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 await trx
.delete(orgDomains) .delete(orgDomains)
.where( .where(

View file

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