mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
update: rename all domain vars to proxy if ProxyRule type for clarity in functions.
This commit is contained in:
1 parent
737aeb4227
commit
289d9fc94c
6 files changed
+35
-36
No files matched your search
+3
-3
@@ -18,7 +18,7 @@
|
||||
|
||||
let showDelete = $state(false);
|
||||
let showRetry = $state(false);
|
||||
let selectedDomain: Models.ProxyRule = null;
|
||||
let selectedProxyRule: Models.ProxyRule = null;
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
@@ -83,9 +83,9 @@
|
||||
</Container>
|
||||
|
||||
{#if showDelete}
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedDomain} />
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
{#if showRetry}
|
||||
<RetryDomainModal bind:show={showRetry} {selectedDomain} />
|
||||
<RetryDomainModal bind:show={showRetry} {selectedProxyRule} />
|
||||
{/if}
|
||||
+1
-1
@@ -26,7 +26,7 @@ export const load: PageLoad = async ({ depends, params, url, route }) => {
|
||||
limit,
|
||||
query,
|
||||
search,
|
||||
domains: await sdk
|
||||
proxyRules: await sdk
|
||||
.forProject(params.region, params.project)
|
||||
.proxy.listRules(
|
||||
[
|
||||
|
||||
+6
-5
@@ -11,15 +11,16 @@
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Models.ProxyRule;
|
||||
let confirm = false;
|
||||
export let selectedProxyRule: Models.ProxyRule;
|
||||
|
||||
let error = '';
|
||||
let confirm = false;
|
||||
|
||||
async function deleteDomain() {
|
||||
try {
|
||||
await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.deleteRule(selectedDomain.$id);
|
||||
.proxy.deleteRule(selectedProxyRule.$id);
|
||||
await invalidate(Dependencies.FUNCTION_DOMAINS);
|
||||
show = false;
|
||||
addNotification({
|
||||
@@ -35,13 +36,13 @@
|
||||
</script>
|
||||
|
||||
<Confirm title="Delete domain" bind:open={show} onSubmit={deleteDomain} bind:error>
|
||||
{#if selectedDomain}
|
||||
{#if selectedProxyRule}
|
||||
<Typography.Text variant="m-400">
|
||||
Are you sure you want to delete this domain? You will no longer be able to execute your
|
||||
function by visiting:
|
||||
</Typography.Text>
|
||||
<Typography.Text variant="m-500">
|
||||
{selectedDomain.domain}
|
||||
{selectedProxyRule.domain}
|
||||
</Typography.Text>
|
||||
{/if}
|
||||
<InputCheckbox
|
||||
|
||||
+3
-4
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { Link } from '$lib/elements';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
|
||||
import {
|
||||
Badge,
|
||||
@@ -14,7 +13,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { consoleVariables } from '$routes/(console)/store';
|
||||
|
||||
export let domain: Domain | Models.ProxyRule;
|
||||
export let proxyRule: Models.ProxyRule;
|
||||
</script>
|
||||
|
||||
<Fieldset legend="Verification">
|
||||
@@ -22,7 +21,7 @@
|
||||
<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>
|
||||
<Typography.Text variant="l-500">{proxyRule?.domain}</Typography.Text>
|
||||
<Badge variant="secondary" type="warning" content="Pending verification" />
|
||||
</Layout.Stack>
|
||||
<Typography.Text variant="m-400">
|
||||
@@ -39,7 +38,7 @@
|
||||
</svelte:fragment>
|
||||
<Table.Row.Base {root}>
|
||||
<Table.Cell {root}>CNAME</Table.Cell>
|
||||
<Table.Cell {root}>{domain?.domain}</Table.Cell>
|
||||
<Table.Cell {root}>{proxyRule?.domain}</Table.Cell>
|
||||
<Table.Cell {root}>
|
||||
<InteractiveText
|
||||
variant="copy"
|
||||
|
||||
+7
-8
@@ -7,24 +7,23 @@
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import RecordsCard from './recordsCard.svelte';
|
||||
import type { Domain } from '$lib/sdk/domains';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { page } from '$app/state';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Domain | Models.ProxyRule;
|
||||
export let selectedProxyRule: Models.ProxyRule;
|
||||
|
||||
let error = null;
|
||||
async function retryDomain() {
|
||||
async function retryProxyRule() {
|
||||
try {
|
||||
await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.proxy.updateRuleVerification(selectedDomain.$id);
|
||||
.proxy.updateRuleVerification(selectedProxyRule.$id);
|
||||
await invalidate(Dependencies.SITES_DOMAINS);
|
||||
show = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${selectedDomain.domain} has been verified`
|
||||
message: `${selectedProxyRule.domain} has been verified`
|
||||
});
|
||||
trackEvent(Submit.DomainUpdateVerification);
|
||||
} catch (e) {
|
||||
@@ -38,9 +37,9 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Modal title="Retry verification" bind:show onSubmit={retryDomain} bind:error>
|
||||
{#if selectedDomain}
|
||||
<RecordsCard domain={selectedDomain} />
|
||||
<Modal title="Retry verification" bind:show onSubmit={retryProxyRule} bind:error>
|
||||
{#if selectedProxyRule}
|
||||
<RecordsCard proxyRule={selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
|
||||
+15
-15
@@ -19,16 +19,16 @@
|
||||
import { columns } from './store';
|
||||
|
||||
let {
|
||||
domains
|
||||
proxyRules
|
||||
}: {
|
||||
domains: Models.ProxyRuleList;
|
||||
proxyRules: Models.ProxyRuleList;
|
||||
} = $props();
|
||||
|
||||
let showDelete = $state(false);
|
||||
let showRetry = $state(false);
|
||||
let selectedDomain: Models.ProxyRule = $state(null);
|
||||
let selectedProxyRule: Models.ProxyRule = $state(null);
|
||||
|
||||
const domainTarget = (proxy: Models.ProxyRule) => {
|
||||
const proxyTarget = (proxy: Models.ProxyRule) => {
|
||||
return proxy?.redirectUrl
|
||||
? 'Redirect to ' + proxy.redirectUrl
|
||||
: proxy?.deploymentVcsProviderBranch
|
||||
@@ -46,24 +46,24 @@
|
||||
{/each}
|
||||
<Table.Header.Cell column="actions" {root} />
|
||||
</svelte:fragment>
|
||||
{#each domains.rules as domain}
|
||||
{#each proxyRules.rules as proxyRule}
|
||||
<Table.Row.Base {root}>
|
||||
{#each $columns as column}
|
||||
<Table.Cell column={column.id} {root}>
|
||||
{#if column.id === 'domain'}
|
||||
<Layout.Stack direction="row" gap="xs">
|
||||
<Link external href={`${$protocol}${domain.domain}`} variant="quiet">
|
||||
<Link external href={`${$protocol}${proxyRule.domain}`} variant="quiet">
|
||||
<Typography.Text truncate>
|
||||
{domain.domain}
|
||||
{proxyRule.domain}
|
||||
</Typography.Text>
|
||||
</Link>
|
||||
{#if domain.status === 'verifying'}
|
||||
{#if proxyRule.status === 'verifying'}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
type="warning"
|
||||
content="Verifying"
|
||||
size="s" />
|
||||
{:else if domain.status !== 'verified'}
|
||||
{:else if proxyRule.status !== 'verified'}
|
||||
<Badge
|
||||
variant="secondary"
|
||||
type="error"
|
||||
@@ -72,7 +72,7 @@
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
{:else if column.id === 'target'}
|
||||
{domainTarget(domain)}
|
||||
{proxyTarget(proxyRule)}
|
||||
{/if}
|
||||
</Table.Cell>
|
||||
{/each}
|
||||
@@ -91,11 +91,11 @@
|
||||
|
||||
<svelte:fragment slot="tooltip" let:toggle>
|
||||
<ActionMenu.Root>
|
||||
{#if domain.status !== 'verified'}
|
||||
{#if proxyRule.status !== 'verified'}
|
||||
<ActionMenu.Item.Button
|
||||
leadingIcon={IconRefresh}
|
||||
on:click={(e) => {
|
||||
selectedDomain = domain;
|
||||
selectedProxyRule = proxyRule;
|
||||
showRetry = true;
|
||||
toggle(e);
|
||||
}}>
|
||||
@@ -106,7 +106,7 @@
|
||||
status="danger"
|
||||
leadingIcon={IconTrash}
|
||||
on:click={(e) => {
|
||||
selectedDomain = domain;
|
||||
selectedProxyRule = proxyRule;
|
||||
showDelete = true;
|
||||
toggle(e);
|
||||
trackEvent(Click.DomainDeleteClick, {
|
||||
@@ -125,9 +125,9 @@
|
||||
</Table.Root>
|
||||
|
||||
{#if showDelete}
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedDomain} />
|
||||
<DeleteDomainModal bind:show={showDelete} {selectedProxyRule} />
|
||||
{/if}
|
||||
|
||||
{#if showRetry}
|
||||
<RetryDomainModal bind:show={showRetry} {selectedDomain} />
|
||||
<RetryDomainModal bind:show={showRetry} {selectedProxyRule} />
|
||||
{/if}
|
||||
Reference in new issue
Block a user