mirror of
https://github.com/logto-io/logto.git
synced 2025-03-03 22:15:32 -05:00
refactor(console): remove redundant ssl dns config for custom domain (#4012)
This commit is contained in:
parent
81f053dfd8
commit
cd679359e1
1 changed files with 3 additions and 28 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { type Domain, type DomainDnsRecords, type DomainDnsRecord } from '@logto/schemas';
|
import { type Domain } from '@logto/schemas';
|
||||||
|
|
||||||
import DynamicT from '@/components/DynamicT';
|
import DynamicT from '@/components/DynamicT';
|
||||||
import InlineNotification from '@/components/InlineNotification';
|
import InlineNotification from '@/components/InlineNotification';
|
||||||
|
@ -12,32 +12,9 @@ type Props = {
|
||||||
customDomain: Domain;
|
customDomain: Domain;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isSetupSslDnsRecord = ({ type, name }: DomainDnsRecord) =>
|
|
||||||
type.toUpperCase() === 'TXT' && name.includes('_acme-challenge');
|
|
||||||
|
|
||||||
function ActivationProcess({ customDomain }: Props) {
|
function ActivationProcess({ customDomain }: Props) {
|
||||||
const { dnsRecords, status: domainStatus, errorMessage } = customDomain;
|
const { dnsRecords, status: domainStatus, errorMessage } = customDomain;
|
||||||
|
|
||||||
const { verifyDomainDnsRecord, setupSslDnsRecord } = dnsRecords.reduce<{
|
|
||||||
verifyDomainDnsRecord: DomainDnsRecords;
|
|
||||||
setupSslDnsRecord: DomainDnsRecords;
|
|
||||||
}>(
|
|
||||||
(result, record) =>
|
|
||||||
isSetupSslDnsRecord(record)
|
|
||||||
? {
|
|
||||||
...result,
|
|
||||||
setupSslDnsRecord: [...result.setupSslDnsRecord, record],
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
...result,
|
|
||||||
verifyDomainDnsRecord: [...result.verifyDomainDnsRecord, record],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
verifyDomainDnsRecord: [],
|
|
||||||
setupSslDnsRecord: [],
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
{errorMessage && (
|
{errorMessage && (
|
||||||
|
@ -57,16 +34,14 @@ function ActivationProcess({ customDomain }: Props) {
|
||||||
tip="domain.custom.checking_dns_tip"
|
tip="domain.custom.checking_dns_tip"
|
||||||
domainStatus={domainStatus}
|
domainStatus={domainStatus}
|
||||||
>
|
>
|
||||||
<DnsRecordsTable records={verifyDomainDnsRecord} />
|
<DnsRecordsTable records={dnsRecords} />
|
||||||
</Step>
|
</Step>
|
||||||
<Step
|
<Step
|
||||||
step={2}
|
step={2}
|
||||||
title="domain.custom.enable_ssl"
|
title="domain.custom.enable_ssl"
|
||||||
tip="domain.custom.checking_dns_tip"
|
tip="domain.custom.checking_dns_tip"
|
||||||
domainStatus={domainStatus}
|
domainStatus={domainStatus}
|
||||||
>
|
/>
|
||||||
<DnsRecordsTable records={setupSslDnsRecord} />
|
|
||||||
</Step>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue