mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: use correct sdk, update imports, delte old code
This commit is contained in:
1 parent
8485e38c33
commit
eedc976c0f
28 files changed
+53
-2595
No files matched your search
+15
-15
@@ -1,7 +1,7 @@
|
||||
import type { DnsRecord } from '$lib/sdk/domains';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export async function createRecord(record: Partial<DnsRecord>, domainId: string) {
|
||||
export async function createRecord(record: Partial<Models.DnsRecord>, domainId: string) {
|
||||
switch (record.type) {
|
||||
case 'A':
|
||||
return await sdk.forConsole.domains.createRecordA(
|
||||
@@ -40,8 +40,8 @@ export async function createRecord(record: Partial<DnsRecord>, domainId: string)
|
||||
return await sdk.forConsole.domains.createRecordTXT(
|
||||
domainId,
|
||||
record.name,
|
||||
record.value,
|
||||
record.ttl,
|
||||
record.value,
|
||||
record?.comment || undefined
|
||||
);
|
||||
case 'NS':
|
||||
@@ -91,16 +91,16 @@ export async function createRecord(record: Partial<DnsRecord>, domainId: string)
|
||||
}
|
||||
|
||||
export type ParsedRecords = {
|
||||
A: Partial<DnsRecord>[];
|
||||
AAAA: Partial<DnsRecord>[];
|
||||
CNAME: Partial<DnsRecord>[];
|
||||
MX: Partial<DnsRecord>[];
|
||||
TXT: Partial<DnsRecord>[];
|
||||
NS: Partial<DnsRecord>[];
|
||||
SRV: Partial<DnsRecord>[];
|
||||
CAA: Partial<DnsRecord>[];
|
||||
PTR: Partial<DnsRecord>[];
|
||||
HTTPS: Partial<DnsRecord>[];
|
||||
ALIAS: Partial<DnsRecord>[];
|
||||
[key: string]: Partial<DnsRecord>[];
|
||||
A: Partial<Models.DnsRecord>[];
|
||||
AAAA: Partial<Models.DnsRecord>[];
|
||||
CNAME: Partial<Models.DnsRecord>[];
|
||||
MX: Partial<Models.DnsRecord>[];
|
||||
TXT: Partial<Models.DnsRecord>[];
|
||||
NS: Partial<Models.DnsRecord>[];
|
||||
SRV: Partial<Models.DnsRecord>[];
|
||||
CAA: Partial<Models.DnsRecord>[];
|
||||
PTR: Partial<Models.DnsRecord>[];
|
||||
HTTPS: Partial<Models.DnsRecord>[];
|
||||
ALIAS: Partial<Models.DnsRecord>[];
|
||||
[key: string]: Partial<Models.DnsRecord>[];
|
||||
};
|
||||
@@ -1,50 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { WizardWithSteps } from '$lib/layout';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { wizard } from '$lib/stores/wizard';
|
||||
import type { WizardStepsType } from '$lib/layout/wizardWithSteps.svelte';
|
||||
import { dependencyStore, domain } from './wizard/store';
|
||||
import Step1 from './wizard/step1.svelte';
|
||||
import Step2 from './wizard/step2.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { page } from '$app/state';
|
||||
import { realtime } from '$lib/stores/sdk';
|
||||
|
||||
onMount(() => {
|
||||
domain.set({ $id: '', domain: '' });
|
||||
|
||||
return realtime
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.subscribe<Models.ProxyRule>('console', (message) => {
|
||||
if (
|
||||
message.channels.includes(`projects.${page.params.project}`) &&
|
||||
message.events.includes('rules.*')
|
||||
) {
|
||||
domain.set(message.payload);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
async function onFinish() {
|
||||
await invalidate($dependencyStore);
|
||||
wizard.hide();
|
||||
}
|
||||
|
||||
const stepsComponents: WizardStepsType = new Map();
|
||||
stepsComponents.set(1, {
|
||||
label: 'Add domain',
|
||||
component: Step1
|
||||
});
|
||||
stepsComponents.set(2, {
|
||||
label: 'Configuration',
|
||||
component: Step2
|
||||
});
|
||||
</script>
|
||||
|
||||
<WizardWithSteps
|
||||
title="Create domain"
|
||||
steps={stepsComponents}
|
||||
finalAction="Go to console"
|
||||
on:exit={onFinish}
|
||||
on:finish={onFinish} />
|
||||
@@ -1,51 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import type { Dependencies } from '$lib/constants';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let showDelete = false;
|
||||
export let selectedDomain: Models.ProxyRule;
|
||||
export let dependency: Dependencies;
|
||||
|
||||
let error: string;
|
||||
|
||||
function getCorrectMessage(): string {
|
||||
const resourceType = selectedDomain.type;
|
||||
switch (resourceType) {
|
||||
case 'api':
|
||||
return `access ${resourceType}`;
|
||||
case 'deployment':
|
||||
return `view your ${resourceType}`;
|
||||
case 'redirect':
|
||||
return `view your ${resourceType} `;
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteDomain() {
|
||||
try {
|
||||
await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.deleteRule(selectedDomain.$id);
|
||||
await invalidate(dependency);
|
||||
showDelete = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${selectedDomain.domain} has been deleted`
|
||||
});
|
||||
trackEvent(Submit.DomainDelete);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.DomainDelete);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<Confirm onSubmit={deleteDomain} title="Delete domain" bind:open={showDelete} bind:error>
|
||||
<p data-private>Are you sure you want to delete <b>{selectedDomain?.domain}</b>?</p>
|
||||
<p>You will no longer be able to {getCorrectMessage()} by visiting this domain.</p>
|
||||
</Confirm>
|
||||
@@ -1,186 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { Empty, Modal, SearchQuery } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { onMount } from 'svelte';
|
||||
import { dependencyStore } from './wizard/store';
|
||||
import { toLocaleDate } from '$lib/helpers/date';
|
||||
import { wizard } from '$lib/stores/wizard';
|
||||
import type { Dependencies } from '$lib/constants';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import Create from './create.svelte';
|
||||
import Delete from './delete.svelte';
|
||||
import Retry from './wizard/retry.svelte';
|
||||
import { canWriteRules } from '$lib/stores/roles';
|
||||
import {
|
||||
Layout,
|
||||
Table,
|
||||
Link,
|
||||
Icon,
|
||||
Badge,
|
||||
Popover,
|
||||
ActionMenu
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import {
|
||||
IconCheckCircle,
|
||||
IconDotsHorizontal,
|
||||
IconExclamationCircle,
|
||||
IconPlus,
|
||||
IconRefresh,
|
||||
IconTrash
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import { page } from '$app/state';
|
||||
import { base } from '$app/paths';
|
||||
|
||||
export let rules: Models.ProxyRuleList;
|
||||
export let dependency: Dependencies;
|
||||
|
||||
let showDelete = false;
|
||||
let showRetry = false;
|
||||
let selectedDomain: Models.ProxyRule;
|
||||
let retryError = null;
|
||||
|
||||
onMount(() => {
|
||||
dependencyStore.set(dependency);
|
||||
});
|
||||
|
||||
function openWizard() {
|
||||
wizard.start(Create);
|
||||
}
|
||||
|
||||
function openRetry(rule: Models.ProxyRule) {
|
||||
retryError = null;
|
||||
selectedDomain = rule;
|
||||
showRetry = true;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if $canWriteRules}
|
||||
<Layout.Stack direction="row" justifyContent="space-between">
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<SearchQuery placeholder="Search by name" />
|
||||
</Layout.Stack>
|
||||
<Layout.Stack direction="row" alignItems="center" justifyContent="flex-end">
|
||||
<Button
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/settings/domains/create`}
|
||||
event="create_user"
|
||||
size="s">
|
||||
<Icon size="s" icon={IconPlus} slot="start" />
|
||||
<span class="text">Create domain</span>
|
||||
</Button>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
{/if}
|
||||
{#if rules.total}
|
||||
<Table.Root
|
||||
let:root
|
||||
columns={[
|
||||
{ id: 'name' },
|
||||
{ id: 'verification' },
|
||||
{ id: 'certificate' },
|
||||
{ id: 'action', width: 20, hide: !$canWriteRules }
|
||||
]}>
|
||||
<svelte:fragment slot="header" let:root>
|
||||
<Table.Header.Cell column="name" {root}>Name</Table.Header.Cell>
|
||||
<Table.Header.Cell column="verification" {root}>Verification status</Table.Header.Cell>
|
||||
<Table.Header.Cell column="certificate" {root}>Certificate status</Table.Header.Cell>
|
||||
<Table.Header.Cell column="action" {root} />
|
||||
</svelte:fragment>
|
||||
{#each rules.rules as domain}
|
||||
<Table.Row.Base {root}>
|
||||
<Table.Cell column="name" {root}>
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<Link.Anchor href={`https://${domain.domain}`} target="_blank">
|
||||
{domain.domain}
|
||||
</Link.Anchor>
|
||||
</Layout.Stack>
|
||||
</Table.Cell>
|
||||
<Table.Cell column="verification" {root}>
|
||||
{#if domain.status === 'created'}
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<Badge variant="secondary" content="failed" type="error">
|
||||
<Icon slot="start" size="s" icon={IconExclamationCircle} />
|
||||
</Badge>
|
||||
<Link.Button variant="muted" on:click={() => openRetry(domain)}>
|
||||
Retry
|
||||
</Link.Button>
|
||||
</Layout.Stack>
|
||||
{:else}
|
||||
<Badge content="verified" variant="secondary" type="success">
|
||||
<Icon slot="start" size="s" icon={IconCheckCircle} />
|
||||
</Badge>
|
||||
{/if}
|
||||
</Table.Cell>
|
||||
<Table.Cell column="certificate" {root}>
|
||||
{#if domain.status === 'unverified'}
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<Badge variant="secondary" content="failed" type="error">
|
||||
<Icon slot="start" size="s" icon={IconExclamationCircle} />
|
||||
</Badge>
|
||||
<Link.Button variant="muted" on:click={() => openRetry(domain)}>
|
||||
Retry
|
||||
</Link.Button>
|
||||
</Layout.Stack>
|
||||
{:else if domain.status === 'verified'}
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<Badge content="generated" variant="secondary" type="success">
|
||||
<Icon slot="start" size="s" icon={IconCheckCircle} />
|
||||
</Badge>
|
||||
{#if domain.renewAt}
|
||||
<span class="u-text-color-gray">
|
||||
Auto-renewal: {toLocaleDate(domain.renewAt)}
|
||||
</span>
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
{:else}
|
||||
<Badge content="blocked by verification" variant="secondary" type="warning">
|
||||
<Icon slot="start" size="s" icon={IconExclamationCircle} />
|
||||
</Badge>
|
||||
{/if}
|
||||
</Table.Cell>
|
||||
<Table.Cell column="action" {root}>
|
||||
<Popover let:toggle placement="bottom-start" padding="none">
|
||||
<Button text icon ariaLabel="more options" on:click={toggle}>
|
||||
<Icon icon={IconDotsHorizontal} size="s" />
|
||||
</Button>
|
||||
<ActionMenu.Root slot="tooltip">
|
||||
{#if domain.status !== 'verified'}
|
||||
<ActionMenu.Item.Button
|
||||
leadingIcon={IconRefresh}
|
||||
on:click={() => openRetry(domain)}>
|
||||
{domain.status === 'unverified'
|
||||
? 'Retry generation'
|
||||
: 'Retry verification'}
|
||||
</ActionMenu.Item.Button>
|
||||
{/if}
|
||||
<ActionMenu.Item.Button
|
||||
leadingIcon={IconTrash}
|
||||
on:click={() => {
|
||||
selectedDomain = domain;
|
||||
showDelete = true;
|
||||
}}>
|
||||
Delete
|
||||
</ActionMenu.Item.Button>
|
||||
</ActionMenu.Root>
|
||||
</Popover>
|
||||
</Table.Cell>
|
||||
</Table.Row.Base>
|
||||
{/each}
|
||||
</Table.Root>
|
||||
{:else}
|
||||
<Empty
|
||||
single
|
||||
href="https://appwrite.io/docs/advanced/platform/custom-domains"
|
||||
target="domain"
|
||||
on:click={openWizard} />
|
||||
{/if}
|
||||
|
||||
<Delete bind:showDelete bind:selectedDomain {dependency} />
|
||||
<Modal
|
||||
bind:show={showRetry}
|
||||
bind:error={retryError}
|
||||
title={`Retry ${selectedDomain?.status === 'unverified' ? 'certificate generation' : 'verification'}`}>
|
||||
<Retry domain={selectedDomain} on:error={(e) => (retryError = e.detail)} />
|
||||
<svelte:fragment slot="footer">
|
||||
<Button secondary on:click={() => (showRetry = false)}>Close</Button>
|
||||
</svelte:fragment>
|
||||
</Modal>
|
||||
@@ -1,2 +0,0 @@
|
||||
export { default as ProxyRulesPage } from './index.svelte';
|
||||
export { default as Retry } from './wizard/retry.svelte';
|
||||
@@ -1,38 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { Copy } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Table } from '@appwrite.io/pink-svelte';
|
||||
import { domain } from './store';
|
||||
import { getProjectEndpoint } from '$lib/helpers/project';
|
||||
|
||||
$: parts = $domain.domain.split('.');
|
||||
$: registerable = [parts[parts.length - 2], parts[parts.length - 1]].join('.');
|
||||
$: cnameValue = $domain.domain.replace('.' + registerable, '');
|
||||
|
||||
$: target = new URL(getProjectEndpoint()).hostname;
|
||||
</script>
|
||||
|
||||
<Table.Root
|
||||
let:root
|
||||
columns={[{ id: 'type' }, { id: 'name' }, { id: 'value' }, { id: 'action', width: 40 }]}>
|
||||
<svelte:fragment slot="header" let:root>
|
||||
<Table.Header.Cell column="type" {root}>Type</Table.Header.Cell>
|
||||
<Table.Header.Cell column="name" {root}>Name</Table.Header.Cell>
|
||||
<Table.Header.Cell column="value" {root}>Value</Table.Header.Cell>
|
||||
<Table.Header.Cell column="action" {root} />
|
||||
</svelte:fragment>
|
||||
<Table.Row.Base {root}>
|
||||
<Table.Cell column="type" {root}>CNAME</Table.Cell>
|
||||
<Table.Cell column="name" {root}>{cnameValue}</Table.Cell>
|
||||
<Table.Cell column="value" {root}>
|
||||
{target}
|
||||
</Table.Cell>
|
||||
<Table.Cell column="action" {root}>
|
||||
<Button text>
|
||||
<Copy value={target}>
|
||||
<span class="icon-duplicate" aria-hidden="true"></span>
|
||||
</Copy>
|
||||
</Button>
|
||||
</Table.Cell>
|
||||
</Table.Row.Base>
|
||||
</Table.Root>
|
||||
@@ -1,92 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import CnameTable from './cnameTable.svelte';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { Code } from '$lib/components';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Card, Icon, Layout, Link, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { IconExclamationCircle } from '@appwrite.io/pink-icons-svelte';
|
||||
import { page } from '$app/state';
|
||||
|
||||
let retrying = false;
|
||||
export let showTitle = true;
|
||||
export let domain: Models.ProxyRule;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
async function retry() {
|
||||
try {
|
||||
retrying = true;
|
||||
domain = await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.updateRuleVerification(domain.$id);
|
||||
invalidate(Dependencies.FUNCTION_DOMAINS);
|
||||
addNotification({
|
||||
message:
|
||||
domain.status === 'unverified'
|
||||
? 'Domain certificate has been generated successfully'
|
||||
: 'Domain has been verified successfully',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent(Submit.DomainUpdateVerification);
|
||||
} catch (error) {
|
||||
dispatch('error', error.message);
|
||||
trackError(error, Submit.DomainUpdateVerification);
|
||||
} finally {
|
||||
retrying = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if domain.status === 'created'}
|
||||
<Card.Base variant="secondary" padding="s">
|
||||
<Layout.Stack gap="s" direction="row" justifyContent="space-between" wrap="wrap">
|
||||
{#if showTitle}
|
||||
<b>{domain.domain}</b>
|
||||
{/if}
|
||||
<Layout.Stack direction="row" gap="s" inline alignItems="center">
|
||||
<Icon color="--web-red-500" size="s" icon={IconExclamationCircle} />
|
||||
<Typography.Text>Verification failed</Typography.Text>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
</Card.Base>
|
||||
<Typography.Text>
|
||||
In order to continue, set the following record on your DNS provider. DNS records may take up
|
||||
to 48 hours to propagate. Please retry over the next 48 hours, but if verification still
|
||||
fails, please <Link.Anchor
|
||||
href="https://appwrite.io/discord"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">contact support</Link.Anchor
|
||||
>.
|
||||
</Typography.Text>
|
||||
<CnameTable />
|
||||
{:else if domain.status === 'unverified'}
|
||||
<div class="u-flex u-gap-8 u-cross-center">
|
||||
<span class="icon-exclamation-circle u-color-text-danger" aria-hidden="true"></span>
|
||||
<p class="u-stretch">Generation failed</p>
|
||||
<Button secondary on:click={retry} disabled={retrying}>
|
||||
{#if retrying}
|
||||
<div class="loader u-text-color-gray"></div>
|
||||
{:else}
|
||||
Retry
|
||||
{/if}
|
||||
</Button>
|
||||
</div>
|
||||
<Typography.Text>
|
||||
In order to continue, set the following record on your DNS provider. DNS records may take up
|
||||
to 48 hours to propagate. Please retry over the next 48 hours, but if verification still
|
||||
fails, please <Link.Anchor
|
||||
href="https://appwrite.io/discord"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">contact support</Link.Anchor
|
||||
>.
|
||||
</Typography.Text>
|
||||
{#if domain?.logs}
|
||||
<Code language="sh" withCopy code={domain.logs} />
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -1,83 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Button, InputDomain } from '$lib/elements/forms';
|
||||
import { WizardStep } from '$lib/layout';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { isSelfHosted } from '$lib/system';
|
||||
import { func } from '$routes/(console)/project-[region]-[project]/functions/function-[function]/store';
|
||||
import { domain } from './store';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import { Alert } from '@appwrite.io/pink-svelte';
|
||||
import { page } from '$app/state';
|
||||
|
||||
let error = null;
|
||||
const isDomainsEnabled = $consoleVariables?._APP_DOMAIN_ENABLED === true;
|
||||
|
||||
async function createDomain() {
|
||||
try {
|
||||
if ($domain.$id) {
|
||||
await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.deleteRule($domain.$id);
|
||||
}
|
||||
|
||||
$domain = await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.createFunctionRule($domain.domain, $func.$id);
|
||||
|
||||
trackEvent(Submit.DomainCreate);
|
||||
} catch (e) {
|
||||
error = true;
|
||||
trackError(e.message, Submit.DomainCreate);
|
||||
throw new Error(e.message);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<WizardStep beforeSubmit={createDomain}>
|
||||
<svelte:fragment slot="title">Domain</svelte:fragment>
|
||||
<svelte:fragment slot="subtitle">
|
||||
Use your self-owned domain as the endpoint of your Appwrite API. <a
|
||||
href="https://appwrite.io/docs/advanced/platform/custom-domains"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="link">Learn more</a
|
||||
>.
|
||||
</svelte:fragment>
|
||||
|
||||
<InputDomain
|
||||
id="domain"
|
||||
label="Domain"
|
||||
placeholder="appwrite.example.com"
|
||||
autocomplete={false}
|
||||
required
|
||||
bind:value={$domain.domain} />
|
||||
|
||||
{#if error}
|
||||
<div class="common-section">
|
||||
<p>
|
||||
You can find a list of domain providers and their DNS setting documentation <a
|
||||
class="link"
|
||||
href="https://appwrite.io/docs/advanced/platform/custom-domains#cname-record"
|
||||
target="_blank"
|
||||
rel="noreferrer">here</a
|
||||
>. If your domain provider isn't listed, please contact us, and we'll include their
|
||||
settings as well.
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
{#if isSelfHosted && !isDomainsEnabled}
|
||||
<Alert.Inline status="info" title="Adding a domain to a self-hosted instance">
|
||||
To add a domain to a locally hosted Appwrite project, you must first configure your
|
||||
server domain.
|
||||
<svelte:fragment slot="actions">
|
||||
<Button
|
||||
href="https://appwrite.io/docs/advanced/self-hosting/functions#git"
|
||||
external
|
||||
text>
|
||||
Learn more
|
||||
</Button>
|
||||
</svelte:fragment>
|
||||
</Alert.Inline>
|
||||
{/if}
|
||||
</WizardStep>
|
||||
@@ -1,54 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { WizardStep } from '$lib/layout';
|
||||
import { domain } from './store';
|
||||
import Retry from './retry.svelte';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Box } from '$lib/components';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
function onRetryError(event: CustomEvent<string>) {
|
||||
addNotification({
|
||||
message: event.detail,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: @arman, please confirm that its no longer partial at this point.
|
||||
function domainAsProxyRule(): Models.ProxyRule {
|
||||
return $domain as Models.ProxyRule;
|
||||
}
|
||||
</script>
|
||||
|
||||
<WizardStep>
|
||||
<svelte:fragment slot="title">{$domain.domain}</svelte:fragment>
|
||||
|
||||
<div class="boxes-wrapper u-margin-block-start-24">
|
||||
{#if $domain.status === 'created'}
|
||||
<Retry domain={domainAsProxyRule()} on:error={onRetryError} showTitle={false} />
|
||||
{:else}
|
||||
<div class="u-flex u-gap-8 u-cross-center">
|
||||
<span class="icon-check u-color-text-success" aria-hidden="true"></span>
|
||||
<p class="u-stretch">Domain verified</p>
|
||||
</div>
|
||||
{/if}
|
||||
<Box>
|
||||
<div class="u-flex u-gap-8 u-cross-center">
|
||||
{#if $domain.status === 'verifying'}
|
||||
<div
|
||||
class="loader"
|
||||
style="color: hsl(var(--color-neutral-50)); inline-size: 1.25rem; block-size: 1.25rem">
|
||||
</div>
|
||||
<p class="u-stretch">Generating certificate</p>
|
||||
{:else if $domain.status === 'verified'}
|
||||
<span class="icon-check u-color-text-success" aria-hidden="true"></span>
|
||||
<p class="u-stretch">Certificate generated</p>
|
||||
{:else}
|
||||
<span class="icon-clock u-text-color-gray" aria-hidden="true"></span>
|
||||
<p class="u-stretch">
|
||||
Certificate generation will begin after domain verification
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</Box>
|
||||
</div>
|
||||
</WizardStep>
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { writable } from 'svelte/store';
|
||||
import type { Dependencies } from '$lib/constants';
|
||||
|
||||
export const domain = writable<Partial<Models.ProxyRule>>({ $id: '', domain: '' });
|
||||
export const dependencyStore = writable<Dependencies>();
|
||||
File diff suppressed because it is too large.
Load diff
@@ -20,11 +20,11 @@ import {
|
||||
Users,
|
||||
Vcs,
|
||||
Sites,
|
||||
Tokens
|
||||
Tokens,
|
||||
Domains
|
||||
} from '@appwrite.io/console';
|
||||
import { Billing } from '../sdk/billing';
|
||||
import { Backups } from '../sdk/backups';
|
||||
import { Domains } from '$lib/sdk/domains';
|
||||
import { Sources } from '$lib/sdk/sources';
|
||||
import {
|
||||
REGION_FRA,
|
||||
|
||||
@@ -29,18 +29,18 @@
|
||||
import { queries } from '$lib/components/filters';
|
||||
import SearchQuery from '$lib/components/searchQuery.svelte';
|
||||
import { app } from '$lib/stores/app';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import { columns } from './store';
|
||||
import { View } from '$lib/helpers/load';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let data;
|
||||
|
||||
let showDelete = false;
|
||||
let showRetry = false;
|
||||
let selectedDomain: Domain = null;
|
||||
let selectedDomain: Models.Domain = null;
|
||||
|
||||
const isDomainVerified = (domain: Domain) => {
|
||||
const isDomainVerified = (domain: Models.Domain) => {
|
||||
return domain.nameservers.toLocaleLowerCase() === 'appwrite';
|
||||
};
|
||||
</script>
|
||||
@@ -103,7 +103,7 @@
|
||||
{:else if column.id === 'nameservers'}
|
||||
{domain.nameservers || '-'}
|
||||
{:else if column.id === 'expiry_date'}
|
||||
{domain?.expiry ? toLocaleDateTime(domain.expiry) : '-'}
|
||||
{domain?.expire ? toLocaleDateTime(domain.expire) : '-'}
|
||||
{:else if column.id === 'renewal'}
|
||||
{domain?.renewal ? toLocaleDateTime(domain.renewal) : '-'}
|
||||
{:else if column.id === 'auto_renewal'}
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
import RecordsCard from '../recordsCard.svelte';
|
||||
import { afterNavigate, invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
let backPage = `${base}/organization-${page.params.organization}/domains`;
|
||||
|
||||
let domainName = '';
|
||||
let domain: Domain;
|
||||
let domain: Models.Domain;
|
||||
|
||||
async function addDomain() {
|
||||
try {
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Confirm } from '$lib/components';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Domain;
|
||||
export let selectedDomain: Models.Domain;
|
||||
|
||||
let error = '';
|
||||
let domainsList = `${base}/organization-${page.params.organization}/domains`;
|
||||
|
||||
+2
-2
@@ -7,15 +7,15 @@
|
||||
import { capitalize } from '$lib/helpers/string';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { page } from '$app/state';
|
||||
import type { DnsRecordsList } from '$lib/sdk/domains';
|
||||
import { presets } from './store';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { createRecord } from '$lib/helpers/domains';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let show = false;
|
||||
export let selectedPreset: (typeof presets)[number];
|
||||
let records: DnsRecordsList;
|
||||
let records: Models.DnsRecordsList;
|
||||
let error = '';
|
||||
async function fetchPreset() {
|
||||
switch (selectedPreset.toLowerCase()) {
|
||||
|
||||
+2
-2
@@ -6,10 +6,10 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Confirm } from '$lib/components';
|
||||
import { page } from '$app/state';
|
||||
import type { DnsRecord } from '$lib/sdk/domains';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let show = false;
|
||||
export let selectedRecord: DnsRecord;
|
||||
export let selectedRecord: Models.DnsRecord;
|
||||
|
||||
let error = '';
|
||||
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { UsageCard } from '$lib/components';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { toLocaleDate } from '$lib/helpers/date';
|
||||
import { Layout, Status } from '@appwrite.io/pink-svelte';
|
||||
import { Link } from '$lib/elements';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
let { domain, retryVerification }: { domain: Domain; retryVerification: () => void } = $props();
|
||||
let { domain, retryVerification }: { domain: Models.Domain; retryVerification: () => void } =
|
||||
$props();
|
||||
|
||||
const isDomainVerified = domain.nameservers.toLocaleLowerCase() === 'appwrite';
|
||||
|
||||
@@ -23,7 +24,7 @@
|
||||
description: 'Nameservers'
|
||||
},
|
||||
{
|
||||
value: domain?.expiry ? toLocaleDate(domain.expiry) : '-',
|
||||
value: domain?.expire ? toLocaleDate(domain.expire) : '-',
|
||||
description: 'Expiry date'
|
||||
},
|
||||
{
|
||||
|
||||
+2
-2
@@ -4,12 +4,12 @@
|
||||
import { CardGrid } from '$lib/components';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button, InputSelect } from '$lib/elements/forms';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import type { OrganizationList } from '$lib/stores/organization';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let domain: Domain;
|
||||
export let domain: Models.Domain;
|
||||
export let organizations: OrganizationList;
|
||||
let selectedOrg: string = null;
|
||||
|
||||
|
||||
+2
-2
@@ -2,10 +2,10 @@
|
||||
import { BoxAvatar, CardGrid } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import Delete from '../../deleteDomainModal.svelte';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
|
||||
export let domain: Domain;
|
||||
export let domain: Models.Domain;
|
||||
let show = false;
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { page } from '$app/stores';
|
||||
import type { Column } from '$lib/helpers/types';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { derived, writable } from 'svelte/store';
|
||||
|
||||
export const domain = derived(page, ($page) => $page.data.domain as Domain);
|
||||
export const domain = derived(page, ($page) => $page.data.domain as Models.Domain);
|
||||
export const columns = writable<Column[]>([
|
||||
{ id: 'name', title: 'Name', type: 'string', width: { min: 150 } },
|
||||
{ id: 'type', title: 'Type', type: 'string', width: 125 },
|
||||
|
||||
+2
-2
@@ -20,15 +20,15 @@
|
||||
import { columns } from './store';
|
||||
import DeleteRecordModal from './deleteRecordModal.svelte';
|
||||
import EditRecordModal from './updateRecordModal.svelte';
|
||||
import type { DnsRecord } from '$lib/sdk/domains';
|
||||
import DualTimeView from '$lib/components/dualTimeView.svelte';
|
||||
import type { PageData } from './$types';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
let showEdit = false;
|
||||
let showDelete = false;
|
||||
let selectedRecord: DnsRecord = null;
|
||||
let selectedRecord: Models.DnsRecord = null;
|
||||
</script>
|
||||
|
||||
<Layout.Stack>
|
||||
|
||||
+2
-2
@@ -13,15 +13,15 @@
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { symmetricDifference } from '$lib/helpers/array';
|
||||
import { deepClone } from '$lib/helpers/object';
|
||||
import type { DnsRecord } from '$lib/sdk/domains';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { page } from '$app/state';
|
||||
import { recordTypes } from './store';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let show = false;
|
||||
export let selectedRecord: DnsRecord;
|
||||
export let selectedRecord: Models.DnsRecord;
|
||||
|
||||
let record = deepClone(selectedRecord);
|
||||
let error = '';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Link } from '$lib/elements';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
@@ -19,8 +18,9 @@
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { goto } from '$app/navigation';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let domain: Domain;
|
||||
export let domain: Models.Domain;
|
||||
|
||||
let verified = undefined;
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Input, InteractiveText, Layout, Table, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { Link } from '$lib/elements';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Domain;
|
||||
export let selectedDomain: Models.Domain;
|
||||
const nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
|
||||
'ns1.appwrite.io',
|
||||
'ns2.appwrite.io'
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { Dependencies } from '$lib/constants.js';
|
||||
import type { DomainsList } from '$lib/sdk/domains.js';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export const load = async ({ depends }) => {
|
||||
depends(Dependencies.DOMAINS);
|
||||
|
||||
let domainsList: DomainsList;
|
||||
let domainsList: Models.DomainsList;
|
||||
if (isCloud) {
|
||||
domainsList = await sdk.forConsole.domains.list();
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { Dependencies } from '$lib/constants.js';
|
||||
import type { DomainsList } from '$lib/sdk/domains.js';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export const load = async ({ depends }) => {
|
||||
depends(Dependencies.DOMAINS);
|
||||
|
||||
let domainsList: DomainsList;
|
||||
let domainsList: Models.DomainsList;
|
||||
if (isCloud) {
|
||||
domainsList = await sdk.forConsole.domains.list();
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { Dependencies } from '$lib/constants.js';
|
||||
import type { DomainsList } from '$lib/sdk/domains';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export const load = async ({ parent, depends }) => {
|
||||
const { site } = await parent();
|
||||
depends(Dependencies.SITES_DOMAINS);
|
||||
|
||||
let domainsList: DomainsList;
|
||||
let domainsList: Models.DomainsList;
|
||||
|
||||
if (isCloud) {
|
||||
domainsList = await sdk.forConsole.domains.list();
|
||||
|
||||
Reference in new issue
Block a user