From 9c13c29cfa3772b570df0d7e4cf06e40be972958 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Thu, 1 Aug 2024 10:36:20 +0800 Subject: [PATCH] update enable custom domain (new dialog, email verification and fixed issue where cant create new cert) --- .../settings/(components)/dns-info.svelte | 24 ++-- .../projects/[id]/settings/+page.server.ts | 72 +++++++++- .../(app)/projects/[id]/settings/+page.svelte | 133 +++++++++++++----- .../(app)/projects/[id]/settings/schema.ts | 4 + 4 files changed, 188 insertions(+), 45 deletions(-) diff --git a/frontend/src/routes/(app)/projects/[id]/settings/(components)/dns-info.svelte b/frontend/src/routes/(app)/projects/[id]/settings/(components)/dns-info.svelte index efc706d..99b176f 100644 --- a/frontend/src/routes/(app)/projects/[id]/settings/(components)/dns-info.svelte +++ b/frontend/src/routes/(app)/projects/[id]/settings/(components)/dns-info.svelte @@ -1,10 +1,8 @@ @@ -114,45 +132,94 @@
{#if !data.project.enable_custom_domain} - - + + - - - - + + + + + Are you absolutely sure? - - + + Enabling a custom domain will allow you to use your project with a custom domain. - - {#if data.cnameRecord || data.aRecord || data.aaaaRecord} - - {/if} - - - Cancel - { - await fetch('?/enable_custom_domain', { - method: 'POST', - headers: { - 'Content-Type': 'multipart/form-data', - }, - }) - await invalidateAll() - }}> - Continue - - - - + + +
+ + + Add Custom Domain +
+ +
+
+ + + + + Update Project Domain (leave blank to use default) + + +

+ Only include the domain name, not the + protocol. +

+

+ Make sure the domain is pointing to our + server. +

+

+ Please contact us if you need a custom + domain. +

+
+
+
+ +
+
+ + {#if data.cnameRecord || data.aRecord || data.aaaaRecord} + + {/if} + + + + + + + + + {:else} diff --git a/frontend/src/routes/(app)/projects/[id]/settings/schema.ts b/frontend/src/routes/(app)/projects/[id]/settings/schema.ts index 8219456..3c2a14b 100644 --- a/frontend/src/routes/(app)/projects/[id]/settings/schema.ts +++ b/frontend/src/routes/(app)/projects/[id]/settings/schema.ts @@ -12,6 +12,10 @@ export const formSchema = z.object({ .max(7), }) +export const enableCustomDomainFormSchema = z.object({ + enableDomain: z.string(), +}) + export const customDomainFormSchema = z.object({ domain: z.string(), })