Fix incorrectly hiding SSL cert

This commit is contained in:
Joshen Lim committed 2023-02-15 12:48:19 +08:00
1 parent 88a41e3430
commit f8700ff5c6
1 file changed
+48 -48
@@ -62,13 +62,11 @@ const SSLConfiguration = () => {
}
}
if (!hasAccessToSSLEnforcement) return <></>
return (
<div>
<div className="flex items-center justify-between">
<FormHeader title="SSL Configuration" description="" />
<div className="flex items-center space-x-2 mb-6">
{/* <div className="flex items-center space-x-2 mb-6">
<Link href="https://supabase.com/docs/guides/platform/ssl-enforcement">
<a target="_blank">
<Button type="default" icon={<IconExternalLink />}>
@@ -76,53 +74,55 @@ const SSLConfiguration = () => {
</Button>
</a>
</Link>
</div>
</div> */}
</div>
<FormPanel>
<FormSection
header={
<FormSectionLabel
className="lg:col-span-7"
description={
<div className="space-y-4">
<p className="text-sm text-scale-1000">
Reject non-SSL connections to your database
</p>
{!sslEnforcementConfiguration?.appliedSuccessfully && (
<Alert
withIcon
variant="warning"
title="SSL enforcement was not updated successfully"
>
Please try updating again, or contact{' '}
<Link href="/support/new">
<a target="_blank" className="underline">
support
</a>
</Link>{' '}
if this error persists
</Alert>
)}
</div>
}
>
Enforce SSL on incoming connections
</FormSectionLabel>
}
>
<FormSectionContent loading={false} className="lg:!col-span-5">
<div className="flex items-center justify-end mt-2.5 space-x-2">
{(isLoading || isSubmitting) && (
<IconLoader className="animate-spin" strokeWidth={1.5} size={16} />
)}
<Toggle
checked={isEnforced}
disabled={isLoading || isSubmitting}
onChange={toggleSSLEnforcement}
/>
</div>
</FormSectionContent>
</FormSection>
{hasAccessToSSLEnforcement && (
<FormSection
header={
<FormSectionLabel
className="lg:col-span-7"
description={
<div className="space-y-4">
<p className="text-sm text-scale-1000">
Reject non-SSL connections to your database
</p>
{!sslEnforcementConfiguration?.appliedSuccessfully && (
<Alert
withIcon
variant="warning"
title="SSL enforcement was not updated successfully"
>
Please try updating again, or contact{' '}
<Link href="/support/new">
<a target="_blank" className="underline">
support
</a>
</Link>{' '}
if this error persists
</Alert>
)}
</div>
}
>
Enforce SSL on incoming connections
</FormSectionLabel>
}
>
<FormSectionContent loading={false} className="lg:!col-span-5">
<div className="flex items-center justify-end mt-2.5 space-x-2">
{(isLoading || isSubmitting) && (
<IconLoader className="animate-spin" strokeWidth={1.5} size={16} />
)}
<Toggle
checked={isEnforced}
disabled={isLoading || isSubmitting}
onChange={toggleSSLEnforcement}
/>
</div>
</FormSectionContent>
</FormSection>
)}
<div className="grid grid-cols-1 items-center lg:grid-cols-2 p-8">
<div className="space-y-2">