mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
feat: refactor add site domain (WIP)
This commit is contained in:
1 parent
c336a31b46
commit
e205812bcd
10 files changed
+246
-144
No files matched your search
+1
-1
@@ -23,7 +23,7 @@
|
||||
"@appwrite.io/pink-icons": "0.25.0",
|
||||
"@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@f57e0157 ",
|
||||
"@appwrite.io/pink-legacy": "^1.0.2",
|
||||
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@eddbab5",
|
||||
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@50282e1",
|
||||
"@popperjs/core": "^2.11.8",
|
||||
"@sentry/sveltekit": "^8.38.0",
|
||||
"@stripe/stripe-js": "^3.5.0",
|
||||
|
||||
Generated
+9
-9
@@ -21,8 +21,8 @@ importers:
|
||||
specifier: ^1.0.2
|
||||
version: 1.0.2
|
||||
'@appwrite.io/pink-svelte':
|
||||
specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@eddbab5
|
||||
version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@eddbab5(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19)
|
||||
specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@50282e1
|
||||
version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@50282e1(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19)
|
||||
'@popperjs/core':
|
||||
specifier: ^2.11.8
|
||||
version: 2.11.8
|
||||
@@ -215,8 +215,8 @@ packages:
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@ac51fcb}
|
||||
version: 1.2.1
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@eddbab56b0e6113533a354772fdaff6fe12066f9':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@eddbab56b0e6113533a354772fdaff6fe12066f9}
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@50282e19b1651dacb859eb440b5f62c48c8d435f':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@50282e19b1651dacb859eb440b5f62c48c8d435f}
|
||||
version: 1.0.0-next.7
|
||||
peerDependencies:
|
||||
svelte: ^4.0.0
|
||||
@@ -236,8 +236,8 @@ packages:
|
||||
'@appwrite.io/pink-legacy@1.0.2':
|
||||
resolution: {integrity: sha512-1AYNcfbV+x0Tyj56CoieSq5g7+u+7F5/LDVN/z+Hx1kp9gj7xc1eT39Dy832xxfihImF6ksjp0FXEMVSBR8cew==}
|
||||
|
||||
'@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@eddbab5':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@eddbab5}
|
||||
'@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@50282e1':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@50282e1}
|
||||
version: 1.0.0-next.85
|
||||
peerDependencies:
|
||||
react-dom: ^18.0.0
|
||||
@@ -4099,7 +4099,7 @@ snapshots:
|
||||
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@ac51fcb': {}
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@eddbab56b0e6113533a354772fdaff6fe12066f9(svelte@4.2.19)':
|
||||
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@50282e19b1651dacb859eb440b5f62c48c8d435f(svelte@4.2.19)':
|
||||
dependencies:
|
||||
svelte: 4.2.19
|
||||
|
||||
@@ -4116,9 +4116,9 @@ snapshots:
|
||||
'@appwrite.io/pink-icons': 1.0.0
|
||||
the-new-css-reset: 1.11.3
|
||||
|
||||
'@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@eddbab5(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19)':
|
||||
'@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@50282e1(react-dom@18.3.1(react@18.3.1))(svelte@4.2.19)':
|
||||
dependencies:
|
||||
'@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@eddbab56b0e6113533a354772fdaff6fe12066f9(svelte@4.2.19)
|
||||
'@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@50282e19b1651dacb859eb440b5f62c48c8d435f(svelte@4.2.19)
|
||||
'@floating-ui/dom': 1.6.13
|
||||
'@melt-ui/pp': 0.3.2(@melt-ui/svelte@0.86.3(svelte@4.2.19))(svelte@4.2.19)
|
||||
'@melt-ui/svelte': 0.86.3(svelte@4.2.19)
|
||||
|
||||
@@ -58,4 +58,6 @@
|
||||
on:invalid={handleInvalid}
|
||||
on:input
|
||||
on:change
|
||||
bind:value />
|
||||
bind:value>
|
||||
<slot name="info" slot="info" />
|
||||
</Input.Select>
|
||||
@@ -13,6 +13,7 @@
|
||||
export let variant: Props['variant'] = 'default';
|
||||
export let size: Props['size'] = 'm';
|
||||
export let external = false;
|
||||
export let icon = false;
|
||||
|
||||
function track() {
|
||||
if (!event) {
|
||||
@@ -33,6 +34,7 @@
|
||||
on:click={track}
|
||||
{href}
|
||||
{disabled}
|
||||
{icon}
|
||||
{variant}
|
||||
{size}
|
||||
target={external ? '_blank' : ''}
|
||||
@@ -40,7 +42,7 @@
|
||||
<slot />
|
||||
</Link.Anchor>
|
||||
{:else}
|
||||
<Link.Button on:click on:mousedown on:click={track} {type} {disabled} {variant} {size}>
|
||||
<Link.Button on:click on:mousedown on:click={track} {type} {disabled} {variant} {size} {icon}>
|
||||
<slot />
|
||||
</Link.Button>
|
||||
{/if}
|
||||
@@ -9,7 +9,7 @@
|
||||
import { Link } from '$lib/elements';
|
||||
import { NewRepository, Repositories } from '$lib/components/git';
|
||||
import ConnectGit from '$lib/components/git/connectGit.svelte';
|
||||
import { BuildRuntime, Framework, type Models } from '@appwrite.io/console';
|
||||
import { Adapter, BuildRuntime, Framework, type Models } from '@appwrite.io/console';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { invalidate } from '$app/navigation';
|
||||
@@ -66,10 +66,14 @@
|
||||
site.buildCommand,
|
||||
site.outputDirectory,
|
||||
site.buildRuntime as BuildRuntime,
|
||||
site.adapter,
|
||||
site.adapter as Adapter,
|
||||
site.fallbackFile,
|
||||
selectedInstallationId,
|
||||
selectedRepository
|
||||
selectedRepository,
|
||||
'main',
|
||||
undefined,
|
||||
undefined,
|
||||
undefined
|
||||
);
|
||||
console.log('test');
|
||||
invalidate(Dependencies.SITE);
|
||||
@@ -83,8 +87,6 @@
|
||||
error = e.message;
|
||||
}
|
||||
}
|
||||
|
||||
$: console.log(selectedInstallationId);
|
||||
</script>
|
||||
|
||||
<Modal
|
||||
|
||||
@@ -157,8 +157,7 @@
|
||||
? `${base}/images/domains/empty-domain-dark.svg`
|
||||
: `${base}/images/domains/empty-domain-light.svg`}
|
||||
title="Use a custom domain for your site"
|
||||
description="Give your site a unique identity and make it easier to find by by assigning it a custom domain.
|
||||
">
|
||||
description="Give your site a unique identity and make it easier to find by by assigning it a custom domain.">
|
||||
<svelte:fragment slot="actions">
|
||||
<Button
|
||||
external
|
||||
|
||||
+151
-121
@@ -8,25 +8,36 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { type Models } from '@appwrite.io/console';
|
||||
import {
|
||||
Badge,
|
||||
Divider,
|
||||
Fieldset,
|
||||
Layout,
|
||||
Typography,
|
||||
Spinner,
|
||||
Input
|
||||
Tooltip,
|
||||
Icon,
|
||||
Card as PinkCard,
|
||||
Empty,
|
||||
Alert
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import RecordsCard from '../recordsCard.svelte';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { sortBranches } from '$lib/stores/vcs';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import InputDomain from '$lib/elements/forms/inputDomain.svelte';
|
||||
import { IconGithub, IconInfo } from '@appwrite.io/pink-icons-svelte';
|
||||
import { LabelCard } from '$lib/components';
|
||||
import { writable } from 'svelte/store';
|
||||
import { ConnectGit } from '$lib/components/git';
|
||||
import ConnectRepoModal from '../../../(components)/connectRepoModal.svelte';
|
||||
import { isCloud } from '$lib/system';
|
||||
|
||||
const backPage = `${base}/project-${$page.params.project}/sites/site-${$page.params.site}/domains`;
|
||||
|
||||
export let data;
|
||||
|
||||
let formComponent: Form;
|
||||
let isSubmitting = writable(false);
|
||||
|
||||
let showConnectRepo = false;
|
||||
|
||||
let domain = '';
|
||||
let domainData: Models.ProxyRule;
|
||||
|
||||
@@ -35,10 +46,12 @@
|
||||
|
||||
let branch = null;
|
||||
|
||||
const domainsOptions = data.domains.rules.map((domain) => ({
|
||||
label: domain.domain,
|
||||
value: domain.domain
|
||||
}));
|
||||
const redirectOptions = data.domains.rules
|
||||
.filter((d) => !d.domain.endsWith($consoleVariables._APP_DOMAIN_SITES))
|
||||
.map((domain) => ({
|
||||
label: domain.domain,
|
||||
value: domain.domain
|
||||
}));
|
||||
|
||||
const statusCodeOptions = [
|
||||
{
|
||||
@@ -66,13 +79,20 @@
|
||||
async function addDomain() {
|
||||
const isNewDomain = data.domains.rules.findIndex((rule) => rule.domain === domain) === -1;
|
||||
const isSubDomain = domain.endsWith(`.${$consoleVariables._APP_DOMAIN_SITES}`);
|
||||
if (redirect) {
|
||||
|
||||
if (behaviour === 'redirect') {
|
||||
try {
|
||||
if (isNewDomain && !isSubDomain) {
|
||||
if (isNewDomain && !isSubDomain && isCloud) {
|
||||
await sdk.forConsole.domains.create($organization.$id, domain);
|
||||
}
|
||||
domainData = await sdk.forProject.proxy.createRedirectRule(domain, redirect);
|
||||
invalidate(Dependencies.SITES_DOMAINS);
|
||||
|
||||
if (isNewDomain && !isSubDomain) {
|
||||
goto(
|
||||
`${base}/project-${$page.params.project}/sites/site-${$page.params.site}/domains/add-domain/verify`
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -81,7 +101,7 @@
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (isNewDomain && !isSubDomain) {
|
||||
if (isNewDomain && !isSubDomain && isCloud) {
|
||||
await sdk.forConsole.domains.create($organization.$id, domain);
|
||||
}
|
||||
domainData = await sdk.forProject.proxy.createSiteRule(
|
||||
@@ -100,69 +120,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function verifyStatus() {
|
||||
try {
|
||||
domainData = await sdk.forProject.proxy.updateRuleVerification(domainData.$id);
|
||||
console.log(domainData);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function back() {
|
||||
try {
|
||||
await sdk.forProject.proxy.deleteRule(domainData.$id);
|
||||
domainData = undefined;
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let behaviour: 'redirect' | 'create' = 'create';
|
||||
$: console.log($consoleVariables);
|
||||
</script>
|
||||
|
||||
<Wizard title="Add domain" href={backPage} column columnSize="s">
|
||||
{#if domainData}
|
||||
{#if domainData.status === 'created'}
|
||||
<RecordsCard domain={domainData}>
|
||||
<Divider />
|
||||
<Layout.Stack direction="row" justifyContent="flex-end">
|
||||
<Button text on:click={back}>Back</Button>
|
||||
<Button secondary on:click={verifyStatus}>Verify</Button>
|
||||
</Layout.Stack>
|
||||
</RecordsCard>
|
||||
{:else if domainData.status === 'verifying'}
|
||||
<Card radius="s">
|
||||
<Layout.Stack gap="s" direction="row" alignItems="center">
|
||||
<Typography.Text variant="l-500">{domainData.domain}</Typography.Text>
|
||||
<Badge variant="secondary" type="success" content="Verified" />
|
||||
<Badge variant="secondary" content="Generating certificate...">
|
||||
<svelte:fragment slot="start">
|
||||
<Spinner size="s" />
|
||||
</svelte:fragment>
|
||||
</Badge>
|
||||
</Layout.Stack>
|
||||
</Card>
|
||||
{:else if domainData.status === 'verified'}
|
||||
<Card radius="s">
|
||||
<Layout.Stack gap="s" direction="row" alignItems="center">
|
||||
<Typography.Text variant="l-500">{domainData.domain}</Typography.Text>
|
||||
<Badge variant="secondary" type="success" content="Verified" />
|
||||
<Badge variant="secondary" type="success" content="Generated certificate" />
|
||||
</Layout.Stack>
|
||||
</Card>
|
||||
{/if}
|
||||
{:else}
|
||||
<Fieldset legend="Configuration">
|
||||
<Form onSubmit={addDomain}>
|
||||
<Layout.Stack gap="xl">
|
||||
<!-- <Input.ComboBox
|
||||
<Wizard title="Add custom domain" href={backPage} column columnSize="s">
|
||||
<Form bind:this={formComponent} onSubmit={addDomain} bind:isSubmitting>
|
||||
<Layout.Stack gap="xxl">
|
||||
<Fieldset legend="Details">
|
||||
<!-- <Input.ComboBox
|
||||
label="Domain"
|
||||
id="domain"
|
||||
name="domain"
|
||||
@@ -170,61 +136,125 @@
|
||||
options={domainsOptions}
|
||||
required
|
||||
placeholder="appwrite.example.com" /> -->
|
||||
<InputDomain
|
||||
label="Domain"
|
||||
id="domain"
|
||||
bind:value={domain}
|
||||
required
|
||||
placeholder="appwrite.example.com" />
|
||||
<InputSelect
|
||||
label="Redirect to"
|
||||
id="redirect"
|
||||
options={[
|
||||
{
|
||||
label: 'No redirect',
|
||||
value: null
|
||||
},
|
||||
...domainsOptions
|
||||
]}
|
||||
bind:value={redirect}
|
||||
required />
|
||||
{#if redirect}
|
||||
<InputDomain
|
||||
label="Domain"
|
||||
id="domain"
|
||||
bind:value={domain}
|
||||
required
|
||||
placeholder="appwrite.example.com" />
|
||||
</Fieldset>
|
||||
|
||||
<Layout.Grid columns={2} columnsXS={1}>
|
||||
<LabelCard
|
||||
value="create"
|
||||
bind:group={behaviour}
|
||||
title="Connect to active deployment">
|
||||
Connect this domain to your active deployment and configure the linked Git
|
||||
branch as needed.
|
||||
</LabelCard>
|
||||
<LabelCard
|
||||
value="redirect"
|
||||
bind:group={behaviour}
|
||||
title="Redirect to another domain">
|
||||
Automatically forward traffic from this domain to another URL of your choice.
|
||||
</LabelCard>
|
||||
</Layout.Grid>
|
||||
|
||||
{#if behaviour === 'create'}
|
||||
<Fieldset legend="Configuration">
|
||||
<Layout.Stack gap="xl">
|
||||
{#if data.branches?.total}
|
||||
{@const sortedBranches = sortBranches(data.branches.branches)}
|
||||
{@const options = sortedBranches.map((branch) => ({
|
||||
label: branch.name,
|
||||
value: branch.name
|
||||
}))}
|
||||
<InputSelect
|
||||
{options}
|
||||
label="Production branch"
|
||||
id="branch"
|
||||
bind:value={branch}
|
||||
placeholder="Select branch" />
|
||||
{:else}
|
||||
<InputSelect
|
||||
disabled
|
||||
options={[{ label: 'main', value: 'main' }]}
|
||||
label="Production branch"
|
||||
id="branch"
|
||||
required
|
||||
value="main"
|
||||
placeholder="Select branch" />
|
||||
|
||||
<Alert.Inline title=" There is no repository connected to your site">
|
||||
<Layout.Stack>
|
||||
<p>
|
||||
The domain will be connected to your active deployment.
|
||||
Connect your Git repository to link a production branch.
|
||||
</p>
|
||||
<div>
|
||||
<Button compact on:click={() => (showConnectRepo = true)}>
|
||||
Connect repository
|
||||
</Button>
|
||||
</div>
|
||||
</Layout.Stack>
|
||||
</Alert.Inline>
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
</Fieldset>
|
||||
|
||||
<!-- {:else if data.site.installationId || data.installations?.total}
|
||||
<PinkCard.Base padding="none" border="dashed">
|
||||
<Empty
|
||||
type="secondary"
|
||||
title="Connect Git repository"
|
||||
description="Link a repository to associate your domain with an active deployment.">
|
||||
<svelte:fragment slot="actions">
|
||||
<Button secondary on:click={() => (showConnectRepo = true)}>
|
||||
<Icon icon={IconGithub} size="s" slot="start" />
|
||||
Connect Git repository
|
||||
</Button>
|
||||
</svelte:fragment>
|
||||
</Empty>
|
||||
</PinkCard.Base>
|
||||
{:else}
|
||||
<ConnectGit callbackState={{ newInstallation: 'true' }} />
|
||||
{/if} -->
|
||||
{:else if behaviour === 'redirect'}
|
||||
<Fieldset legend="Configuration">
|
||||
<Layout.Stack gap="xl">
|
||||
<InputSelect
|
||||
label="Redirect to"
|
||||
id="redirect"
|
||||
placeholder="Select domain"
|
||||
options={redirectOptions}
|
||||
bind:value={redirect}
|
||||
required>
|
||||
<Tooltip slot="info">
|
||||
<Icon icon={IconInfo} size="s" />
|
||||
<span slot="tooltip">
|
||||
Redirect this domain. Domains added to your project will be
|
||||
listed here.
|
||||
</span>
|
||||
</Tooltip>
|
||||
</InputSelect>
|
||||
<InputSelect
|
||||
options={statusCodeOptions}
|
||||
label="Status code"
|
||||
id="code"
|
||||
required
|
||||
bind:value={statusCode}
|
||||
placeholder="Select status code" />
|
||||
{/if}
|
||||
|
||||
{#if data.branches?.total}
|
||||
{@const sortedBranches = sortBranches(data.branches.branches)}
|
||||
{@const options = sortedBranches.map((branch) => ({
|
||||
label: branch.name,
|
||||
value: branch.name
|
||||
}))}
|
||||
<InputSelect
|
||||
disabled={!!redirect}
|
||||
{options}
|
||||
label="Production branch"
|
||||
id="branch"
|
||||
bind:value={branch}
|
||||
placeholder="Select branch" />
|
||||
{/if}
|
||||
|
||||
<Divider />
|
||||
<Layout.Stack alignItems="flex-end">
|
||||
<Button submit>Add</Button>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
</Form>
|
||||
</Fieldset>
|
||||
{/if}
|
||||
|
||||
</Fieldset>
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
</Form>
|
||||
<svelte:fragment slot="footer">
|
||||
<Button secondary href={backPage}>Cancel</Button>
|
||||
{#if domainData}
|
||||
<Button secondary href={backPage}>Go to dashboard</Button>
|
||||
{/if}
|
||||
<Button on:click={() => formComponent.triggerSubmit()} disabled={$isSubmitting}>Add</Button>
|
||||
</svelte:fragment>
|
||||
</Wizard>
|
||||
|
||||
{#if showConnectRepo}
|
||||
<ConnectRepoModal bind:show={showConnectRepo} site={data.site} />
|
||||
{/if}
|
||||
+8
-1
@@ -5,8 +5,15 @@ import { RuleType } from '$lib/stores/sdk';
|
||||
export const load = async ({ parent }) => {
|
||||
const { site } = await parent();
|
||||
|
||||
const [domains, installations] = await Promise.all([
|
||||
sdk.forProject.proxy.listRules([Query.equal('type', RuleType.DEPLOYMENT)]),
|
||||
sdk.forProject.vcs.listInstallations()
|
||||
]);
|
||||
|
||||
return {
|
||||
domains: await sdk.forProject.proxy.listRules([Query.equal('type', RuleType.DEPLOYMENT)]),
|
||||
site,
|
||||
domains,
|
||||
installations,
|
||||
branches:
|
||||
site?.installationId && site?.providerRepositoryId
|
||||
? await sdk.forProject.vcs.listRepositoryBranches(
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
<script lang="ts">
|
||||
import { Badge, Divider, Layout, Spinner, Typography } from '@appwrite.io/pink-svelte';
|
||||
import RecordsCard from '../../recordsCard.svelte';
|
||||
import { Card } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Wizard } from '$lib/layout';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
const backPage = `${base}/project-${$page.params.project}/sites/site-${$page.params.site}/domains`;
|
||||
|
||||
async function verifyStatus() {
|
||||
try {
|
||||
domainData = await sdk.forProject.proxy.updateRuleVerification(domainData.$id);
|
||||
console.log(domainData);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<Wizard title="Add custom domain" href={backPage} column columnSize="s" hideFooter>
|
||||
{#if domainData.status === 'created'}
|
||||
<RecordsCard domain={domainData}>
|
||||
<Divider />
|
||||
<Layout.Stack direction="row" justifyContent="flex-end">
|
||||
<Button secondary on:click={verifyStatus}>Verify</Button>
|
||||
</Layout.Stack>
|
||||
</RecordsCard>
|
||||
{:else if domainData.status === 'verifying'}
|
||||
<Card radius="s">
|
||||
<Layout.Stack gap="s" direction="row" alignItems="center">
|
||||
<Typography.Text variant="l-500">{domainData.domain}</Typography.Text>
|
||||
<Badge variant="secondary" type="success" content="Verified" />
|
||||
<Badge variant="secondary" content="Generating certificate...">
|
||||
<svelte:fragment slot="start">
|
||||
<Spinner size="s" />
|
||||
</svelte:fragment>
|
||||
</Badge>
|
||||
</Layout.Stack>
|
||||
</Card>
|
||||
{:else if domainData.status === 'verified'}
|
||||
<Card radius="s">
|
||||
<Layout.Stack gap="s" direction="row" alignItems="center">
|
||||
<Typography.Text variant="l-500">{domainData.domain}</Typography.Text>
|
||||
<Badge variant="secondary" type="success" content="Verified" />
|
||||
<Badge variant="secondary" type="success" content="Generated certificate" />
|
||||
</Layout.Stack>
|
||||
</Card>
|
||||
{/if}
|
||||
</Wizard>
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Badge, Divider, Icon, Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
import OpenOnMobileModal from '../(components)/openOnMobileModal.svelte';
|
||||
import { timeFromNow } from '$lib/helpers/date';
|
||||
import { IconExternalLink, IconQrcode } from '@appwrite.io/pink-icons-svelte';
|
||||
import { IconQrcode } from '@appwrite.io/pink-icons-svelte';
|
||||
import { protocol } from '$routes/(console)/store';
|
||||
import { type Models } from '@appwrite.io/console';
|
||||
import { Link } from '$lib/elements';
|
||||
@@ -70,12 +70,16 @@
|
||||
direction="row"
|
||||
gap="xl">
|
||||
<Layout.Stack gap="xxs" inline>
|
||||
<Link variant="quiet" href={`${$protocol}${rule.domain}`} size="m" external>
|
||||
<Link
|
||||
variant="quiet"
|
||||
href={`${$protocol}${rule.domain}`}
|
||||
size="m"
|
||||
external
|
||||
icon>
|
||||
<Layout.Stack gap="xs" inline direction="row" alignItems="center">
|
||||
<Trim alternativeTrim>
|
||||
{rule.domain}
|
||||
</Trim>
|
||||
<Icon icon={IconExternalLink} />
|
||||
</Layout.Stack>
|
||||
</Link>
|
||||
<Typography.Caption variant="400" truncate>
|
||||
|
||||
Reference in new issue
Block a user