refactor domain wizard

This commit is contained in:
Arman committed 2025-02-14 18:09:25 +01:00
1 parent 98e95456dd
commit 8bc29b9928
2 files changed
+59 -50

No files matched your search

@@ -4,13 +4,11 @@
import Card from '$lib/components/card.svelte';
import { Button, Form } from '$lib/elements/forms';
import { InputDomain } from '$lib/elements/forms/index.js';
import Link from '$lib/elements/link.svelte';
import { Wizard } from '$lib/layout';
import { addNotification } from '$lib/stores/notifications';
import { sdk } from '$lib/stores/sdk';
import { ResourceType, type Models } from '@appwrite.io/console';
import {
Alert,
Badge,
Divider,
Fieldset,
@@ -69,7 +67,7 @@
}
</script>
<Wizard title="Add domain" href={backPage} hideAside>
<Wizard title="Add domain" href={backPage} column columnSize="s">
{#if domainData}
{#if domainData.status === 'created'}
<RecordsCard domain={domainData}>
@@ -102,25 +100,22 @@
{/if}
{:else}
<Fieldset legend="Configuration">
<Layout.Stack gap="l">
<Form onSubmit={addDomain}>
<Layout.Stack gap="s" direction="row" alignItems="flex-end">
<InputDomain
label="Domain"
id="domain"
name="domain"
bind:value={domain}
required
placeholder="appwrite.example.com" />
<Button secondary submit>Add</Button>
<Form onSubmit={addDomain}>
<Layout.Stack gap="xl">
<InputDomain
label="Domain"
id="domain"
name="domain"
bind:value={domain}
required
placeholder="appwrite.example.com" />
<Divider />
<Layout.Stack alignItems="flex-end">
<Button submit>Add</Button>
</Layout.Stack>
</Form>
<Alert.Inline title="Domain providers and DNS settings" hideActions>
A list of all domain providers and their DNS setting is available <Link href="#"
>here</Link
>.
</Alert.Inline>
</Layout.Stack>
</Layout.Stack>
</Form>
</Fieldset>
{/if}
@@ -1,38 +1,52 @@
<script lang="ts">
import { Copy } from '$lib/components';
import Card from '$lib/components/card.svelte';
import { Link } from '$lib/elements';
import type { Models } from '@appwrite.io/console';
import { Badge, Layout, Typography, Table } from '@appwrite.io/pink-svelte';
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
import { Badge, Layout, Typography, Table, Fieldset, Icon } from '@appwrite.io/pink-svelte';
export let domain: Models.ProxyRule;
</script>
<Card radius="s" padding="s" isTile>
<Layout.Stack gap="s">
<Layout.Stack gap="s" direction="row" alignItems="center">
<Typography.Text variant="l-500">{domain.domain}</Typography.Text>
<Badge variant="secondary" type="warning" content="Pending verification" />
</Layout.Stack>
<p>
Add the following record with your DNS provider. Note that changes may take up to 48
hours to take effect. You can periodically check the verification status in your domain
settings.
</p>
<Fieldset legend="Verification">
<Layout.Stack gap="xl">
<Layout.Stack gap="xl">
<Layout.Stack gap="s">
<Layout.Stack gap="s" direction="row" alignItems="center">
<Typography.Text variant="l-500">{domain.domain}</Typography.Text>
<Badge variant="secondary" type="warning" content="Pending verification" />
</Layout.Stack>
<Typography.Text variant="m-400">
Add the following nameservers on your DNS provider. Note that DNS changes may
take time to propagate fully.
</Typography.Text>
</Layout.Stack>
<Table.Root>
<svelte:fragment slot="header">
<Table.Header.Cell>Type</Table.Header.Cell>
<Table.Header.Cell>Name</Table.Header.Cell>
<Table.Header.Cell>Value</Table.Header.Cell>
</svelte:fragment>
<Table.Row>
<Table.Cell>CNAME</Table.Cell>
<Table.Cell>{domain.domain}</Table.Cell>
<Table.Cell>
<Copy value={globalThis?.location?.origin}>{globalThis?.location?.origin}</Copy>
</Table.Cell>
</Table.Row>
</Table.Root>
<Table.Root>
<svelte:fragment slot="header">
<Table.Header.Cell>Type</Table.Header.Cell>
<Table.Header.Cell>Name</Table.Header.Cell>
<Table.Header.Cell>Value</Table.Header.Cell>
</svelte:fragment>
<Table.Row>
<Table.Cell>CNAME</Table.Cell>
<Table.Cell>{domain.domain}</Table.Cell>
<Table.Cell>
<Copy value={globalThis?.location?.origin}
>{globalThis?.location?.origin}</Copy>
</Table.Cell>
</Table.Row>
</Table.Root>
<Layout.Stack gap="s" direction="row" alignItems="center">
<Icon icon={IconInfo} size="s" color="--color-fgcolor-neutral-secondary" />
<Typography.Text variant="m-400" color="--color-fgcolor-neutral-secondary">
A list of all domain providers and their DNS setting is available <Link
variant="muted"
href="#">here</Link
>.
</Typography.Text>
</Layout.Stack>
</Layout.Stack>
<slot />
</Layout.Stack>
<slot />
</Card>
</Fieldset>