-
Notifications
You must be signed in to change notification settings - Fork 191
SER-287 Fix domain flows on console #2364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f044340
6df5f66
995ef38
8ddcc95
bb6c951
8602eb4
bfe9c92
2ee96d1
15e56c3
2b68cf9
ce61ac0
625273d
2fcdf31
18de91d
37571a0
ffbab00
f81d05e
bf84ce6
f8c2629
e41a191
1faadf9
160e9c0
cb45348
71b7997
6abb277
493ad69
11f7c13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
<script lang="ts"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
import { Link } from '$lib/elements'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
import { IconInfo } from '@appwrite.io/pink-icons-svelte'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
import { getSubdomain } from '$lib/helpers/tlds'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
import { | ||||||||||||||||||||||||||||||||||||||||||||||||||
Badge, | ||||||||||||||||||||||||||||||||||||||||||||||||||
Layout, | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -11,10 +12,23 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||
} from '@appwrite.io/pink-svelte'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
import { regionalConsoleVariables } from '$routes/(console)/project-[region]-[project]/store'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
export let domain: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||
export let verified = undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||
let { | ||||||||||||||||||||||||||||||||||||||||||||||||||
domain, | ||||||||||||||||||||||||||||||||||||||||||||||||||
verified = undefined, | ||||||||||||||||||||||||||||||||||||||||||||||||||
ruleStatus = undefined | ||||||||||||||||||||||||||||||||||||||||||||||||||
}: { | ||||||||||||||||||||||||||||||||||||||||||||||||||
domain: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||
verified?: boolean | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||
ruleStatus?: string | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||
} = $props(); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
let subdomain = domain.split('.').slice(0, -2).join('.'); | ||||||||||||||||||||||||||||||||||||||||||||||||||
const subdomain = $derived(getSubdomain(domain)); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
const caaText = $derived( | ||||||||||||||||||||||||||||||||||||||||||||||||||
$regionalConsoleVariables._APP_DOMAIN_TARGET_CAA?.includes(' ') | ||||||||||||||||||||||||||||||||||||||||||||||||||
? $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA | ||||||||||||||||||||||||||||||||||||||||||||||||||
: `0 issue "${$regionalConsoleVariables._APP_DOMAIN_TARGET_CAA}"` | ||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+25
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prevent runtime errors if regionalConsoleVariables is undefined. Accessing properties on an undefined store value will throw. Guard with optional chaining and provide a safe fallback. - const caaText = $derived(
- $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA?.includes(' ')
- ? $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA
- : `0 issue "${$regionalConsoleVariables._APP_DOMAIN_TARGET_CAA}"`
- );
+ const caaText = $derived(
+ $regionalConsoleVariables?._APP_DOMAIN_TARGET_CAA?.includes(' ')
+ ? $regionalConsoleVariables?._APP_DOMAIN_TARGET_CAA ?? ''
+ : $regionalConsoleVariables?._APP_DOMAIN_TARGET_CAA
+ ? `0 issue "${$regionalConsoleVariables._APP_DOMAIN_TARGET_CAA}"`
+ : ''
+ ); 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||
</script> | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
<Layout.Stack gap="xl"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -23,15 +37,25 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||
<Typography.Text variant="l-500" color="--fgcolor-neutral-primary"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
{domain} | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Typography.Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||
{#if verified === true} | ||||||||||||||||||||||||||||||||||||||||||||||||||
{#if ruleStatus === 'created'} | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="error" size="xs" content="Verification failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if ruleStatus === 'verifying'} | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" size="xs" content="Generating certificate" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if ruleStatus === 'unverified'} | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge | ||||||||||||||||||||||||||||||||||||||||||||||||||
variant="secondary" | ||||||||||||||||||||||||||||||||||||||||||||||||||
type="error" | ||||||||||||||||||||||||||||||||||||||||||||||||||
size="xs" | ||||||||||||||||||||||||||||||||||||||||||||||||||
content="Certificate generation failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if verified === true} | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="success" size="xs" content="Verified" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+40
to
51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle ruleStatus === 'verified' explicitly. Show the success badge when status is verified even if verified flag isn’t set. - {:else if ruleStatus === 'unverified'}
+ {:else if ruleStatus === 'unverified'}
<Badge
variant="secondary"
type="error"
size="xs"
content="Certificate generation failed" />
- {:else if verified === true}
+ {:else if ruleStatus === 'verified' || verified === true}
<Badge variant="secondary" type="success" size="xs" content="Verified" /> 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if verified === false} | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="warning" size="xs" content="Verification failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
{/if} | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Layout.Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography.Text variant="m-400"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
Add the following record on your DNS provider. Note that DNS changes may take time to | ||||||||||||||||||||||||||||||||||||||||||||||||||
propagate fully. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Add the following {$regionalConsoleVariables._APP_DOMAIN_TARGET_CAA | ||||||||||||||||||||||||||||||||||||||||||||||||||
? 'records' | ||||||||||||||||||||||||||||||||||||||||||||||||||
: 'record'} on your DNS provider. Note that DNS changes may take up to 48 hours to propagate | ||||||||||||||||||||||||||||||||||||||||||||||||||
fully. | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Typography.Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Layout.Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -43,14 +67,28 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||
</svelte:fragment> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Row.Base {root}> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}>CNAME</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}>{subdomain}</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}>{subdomain || '@'}</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<InteractiveText | ||||||||||||||||||||||||||||||||||||||||||||||||||
variant="copy" | ||||||||||||||||||||||||||||||||||||||||||||||||||
isVisible | ||||||||||||||||||||||||||||||||||||||||||||||||||
text={$regionalConsoleVariables._APP_DOMAIN_TARGET_CNAME} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Row.Base> | ||||||||||||||||||||||||||||||||||||||||||||||||||
{#if $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA} | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Row.Base {root}> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Layout.Stack gap="s" direction="row" alignItems="center"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<span>CAA</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" size="xs" content="Recommended" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Layout.Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}>@</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<InteractiveText variant="copy" isVisible text={caaText} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Row.Base> | ||||||||||||||||||||||||||||||||||||||||||||||||||
{/if} | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+78
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard CAA conditional and keep value consistent with the guard. Use optional chaining in the - {#if $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA}
+ {#if $regionalConsoleVariables?._APP_DOMAIN_TARGET_CAA}
<Table.Row.Base {root}>
<Table.Cell {root}>
<Layout.Stack gap="s" direction="row" alignItems="center">
<span>CAA</span>
<Badge variant="secondary" size="xs" content="Recommended" />
</Layout.Stack>
</Table.Cell>
<Table.Cell {root}>@</Table.Cell>
<Table.Cell {root}>
<InteractiveText variant="copy" isVisible text={caaText} />
</Table.Cell>
</Table.Row.Base>
{/if} 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Root> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Layout.Stack gap="s" direction="row" alignItems="center"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Icon icon={IconInfo} size="s" color="--fgcolor-neutral-secondary" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export { default as ViewLogsModal } from './viewLogsModal.svelte'; | ||
export { default as CnameTable } from './cnameTable.svelte'; | ||
export { default as DnsRecordsAction } from './dnsRecordsAction.svelte'; | ||
export { default as NameserverTable } from './nameserverTable.svelte'; | ||
export { default as RecordTable } from './recordTable.svelte'; |
vermakhushboo marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3,8 +3,15 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||
import { Badge, Layout, Typography, Table, InteractiveText } from '@appwrite.io/pink-svelte'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export let domain: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export let verified = undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
let { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
domain, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
verified = undefined, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
ruleStatus = undefined | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
domain: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
verified?: boolean | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
ruleStatus?: string | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} = $props(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const nameserverList = $regionalConsoleVariables?._APP_DOMAINS_NAMESERVERS | ||||||||||||||||||||||||||||||||||||||||||||||||||||
? $regionalConsoleVariables?._APP_DOMAINS_NAMESERVERS?.split(',') | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -16,10 +23,18 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography.Text variant="l-500" color="--fgcolor-neutral-primary"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{domain} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</Typography.Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if verified === true} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if ruleStatus === 'created'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="error" size="xs" content="Verification failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this correct? does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per backend, |
||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if ruleStatus === 'verifying'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" size="xs" content="Generating certificate" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we not use a warning [orange] variant in similar places for different states? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not as per new design, only in org > domains table |
||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if ruleStatus === 'unverified'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge | ||||||||||||||||||||||||||||||||||||||||||||||||||||
variant="secondary" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
type="error" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
size="xs" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
content="Certificate generation failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if verified === true} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="success" size="xs" content="Verified" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+26
to
37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle ruleStatus === 'verified' explicitly. If callers pass only ruleStatus without toggling verified=true, the "Verified" badge won’t render. Add a branch for ruleStatus === 'verified'. - {:else if ruleStatus === 'unverified'}
+ {:else if ruleStatus === 'unverified'}
<Badge
variant="secondary"
type="error"
size="xs"
content="Certificate generation failed" />
- {:else if verified === true}
+ {:else if ruleStatus === 'verified' || verified === true}
<Badge variant="secondary" type="success" size="xs" content="Verified" /> 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if verified === false} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="warning" size="xs" content="Verification failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{/if} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</Layout.Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography.Text variant="m-400"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,20 +9,58 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Alert | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} from '@appwrite.io/pink-svelte'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { regionalConsoleVariables } from '$routes/(console)/project-[region]-[project]/store'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { isCloud } from '$lib/system'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { getSubdomain } from '$lib/helpers/tlds'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export let domain: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export let verified = undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export let variant: 'cname' | 'a' | 'aaaa'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export let service: 'sites' | 'general' = 'general'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
domain, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
verified = undefined, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
variant, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
service = 'general', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ruleStatus = undefined, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onNavigateToNameservers = () => {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onNavigateToA = () => {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onNavigateToAAAA = () => {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
domain: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
verified?: boolean | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
variant: 'cname' | 'a' | 'aaaa'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
service?: 'sites' | 'functions' | 'general'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ruleStatus?: string | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onNavigateToNameservers?: () => void; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onNavigateToA?: () => void; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onNavigateToAAAA?: () => void; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} = $props(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let subdomain = domain?.split('.')?.slice(0, -2)?.join('.'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const subdomain = $derived(getSubdomain(domain)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const aTabVisible = $derived( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!isCloud && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Boolean($regionalConsoleVariables._APP_DOMAIN_TARGET_A) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$regionalConsoleVariables._APP_DOMAIN_TARGET_A !== '127.0.0.1' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const aaaaTabVisible = $derived( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!isCloud && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Boolean($regionalConsoleVariables._APP_DOMAIN_TARGET_AAAA) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$regionalConsoleVariables._APP_DOMAIN_TARGET_AAAA !== '::1' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+35
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard store access with optional chaining. Avoid potential runtime errors if regionalConsoleVariables is not yet available. - const subdomain = $derived(getSubdomain(domain));
+ const subdomain = $derived(getSubdomain(domain));
- const aTabVisible = $derived(
- !isCloud &&
- Boolean($regionalConsoleVariables._APP_DOMAIN_TARGET_A) &&
- $regionalConsoleVariables._APP_DOMAIN_TARGET_A !== '127.0.0.1'
- );
- const aaaaTabVisible = $derived(
- !isCloud &&
- Boolean($regionalConsoleVariables._APP_DOMAIN_TARGET_AAAA) &&
- $regionalConsoleVariables._APP_DOMAIN_TARGET_AAAA !== '::1'
- );
+ const aTabVisible = $derived(
+ !isCloud &&
+ Boolean($regionalConsoleVariables?._APP_DOMAIN_TARGET_A) &&
+ $regionalConsoleVariables?._APP_DOMAIN_TARGET_A !== '127.0.0.1'
+ );
+ const aaaaTabVisible = $derived(
+ !isCloud &&
+ Boolean($regionalConsoleVariables?._APP_DOMAIN_TARGET_AAAA) &&
+ $regionalConsoleVariables?._APP_DOMAIN_TARGET_AAAA !== '::1'
+ ); 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const caaText = $derived( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$regionalConsoleVariables._APP_DOMAIN_TARGET_CAA?.includes(' ') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
? $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
: `0 issue "${$regionalConsoleVariables._APP_DOMAIN_TARGET_CAA}"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
function setTarget() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
switch (variant) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
case 'cname': | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return service === 'general' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
? $regionalConsoleVariables._APP_DOMAIN_TARGET_CNAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
: $regionalConsoleVariables._APP_DOMAIN_SITES; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (service === 'sites') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return $regionalConsoleVariables._APP_DOMAIN_SITES; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else if (service === 'functions') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return $regionalConsoleVariables._APP_DOMAIN_FUNCTIONS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return $regionalConsoleVariables._APP_DOMAIN_TARGET_CNAME; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
case 'a': | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return $regionalConsoleVariables._APP_DOMAIN_TARGET_A; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
case 'aaaa': | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -37,15 +75,25 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography.Text variant="l-500" color="--fgcolor-neutral-primary"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{domain} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Typography.Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if verified === true} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if ruleStatus === 'created'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="error" size="xs" content="Verification failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if ruleStatus === 'verifying'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" size="xs" content="Generating certificate" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+78
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if ruleStatus === 'unverified'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
variant="secondary" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type="error" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
size="xs" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content="Certificate generation failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if verified === true} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="success" size="xs" content="Verified" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if verified === false} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" type="warning" size="xs" content="Verification failed" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{/if} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+78
to
90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle ruleStatus === 'verified'. Render success badge when status is verified even if verified flag isn’t true. - {:else if ruleStatus === 'unverified'}
+ {:else if ruleStatus === 'unverified'}
<Badge
variant="secondary"
type="error"
size="xs"
content="Certificate generation failed" />
- {:else if verified === true}
+ {:else if ruleStatus === 'verified' || verified === true}
<Badge variant="secondary" type="success" size="xs" content="Verified" /> 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Layout.Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography.Text variant="m-400"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add the following record on your DNS provider. Note that DNS changes may take time to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
propagate fully. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add the following {$regionalConsoleVariables._APP_DOMAIN_TARGET_CAA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
? 'records' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
: 'record'} on your DNS provider. Note that DNS changes may take up to 48 hours to propagate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fully. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Typography.Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Layout.Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -62,17 +110,45 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<InteractiveText variant="copy" isVisible text={setTarget()} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Row.Base> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Row.Base {root}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Layout.Stack gap="s" direction="row" alignItems="center"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span>CAA</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Badge variant="secondary" size="xs" content="Recommended" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Layout.Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}>@</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Table.Cell {root}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<InteractiveText variant="copy" isVisible text={caaText} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Cell> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Row.Base> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{/if} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Table.Root> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Layout.Stack gap="s" direction="row" alignItems="center"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if variant === 'cname'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Alert.Inline> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If your domain uses CAA records, ensure certainly.com is authorized — otherwise, SSL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setup may fail. A list of all domain providers and their DNS setting is available <Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
variant="muted" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
external | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
href="https://appwrite.io/docs/advanced/platform/custom-domains">here</Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Alert.Inline> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if variant === 'cname' && !subdomain} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if isCloud} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Alert.Inline> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CNAME record is only supported by certain providers. If yours doesn't, please verify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
using | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Link variant="muted" on:click={onNavigateToNameservers}>nameservers</Link> instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Alert.Inline> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if aTabVisible || aaaaTabVisible} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Alert.Inline> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CNAME record is only supported by certain providers. If yours doesn't, please verify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
using | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if aTabVisible} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Link variant="muted" on:click={onNavigateToA}>A record</Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{#if aaaaTabVisible} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
or <Link variant="muted" on:click={onNavigateToAAAA}>AAAA record</Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
>{/if} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else if aaaaTabVisible} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Link variant="muted" on:click={onNavigateToAAAA}>AAAA record</Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{/if} instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Alert.Inline> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{/if} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+129
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Migrate event handlers to Svelte 5 syntax. Use onclick instead of on:click. This aligns with project-wide Svelte 5 migration. Based on learnings - <Link variant="muted" on:click={onNavigateToNameservers}>nameservers</Link> instead.
+ <Link variant="muted" onclick={onNavigateToNameservers}>nameservers</Link> instead.
...
- <Link variant="muted" on:click={onNavigateToA}>A record</Link>
+ <Link variant="muted" onclick={onNavigateToA}>A record</Link>
- or <Link variant="muted" on:click={onNavigateToAAAA}>AAAA record</Link
+ or <Link variant="muted" onclick={onNavigateToAAAA}>AAAA record</Link
>{/if}
- {:else if aaaaTabVisible}
- <Link variant="muted" on:click={onNavigateToAAAA}>AAAA record</Link>
+ {:else if aaaaTabVisible}
+ <Link variant="muted" onclick={onNavigateToAAAA}>AAAA record</Link> 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{:else} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography.Text variant="m-400" color="--fgcolor-neutral-secondary"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A list of all domain providers and their DNS setting is available <Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,25 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
<script lang="ts"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { onMount } from 'svelte'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { page } from '$app/state'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { realtime } from '$lib/stores/sdk'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { Dependencies } from '$lib/constants'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { invalidate } from '$app/navigation'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
onMount(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return realtime | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
.forProject(page.params.region, page.params.project) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
.subscribe('console', (response) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
response.events.includes('proxy.rules.*.update') || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
response.events.includes('proxy.rules.*.create') || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
response.events.includes('proxy.rules.*.delete') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if ((response.payload as any)?.deploymentResourceId === page.params.function) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace The explicit Apply this diff to add type safety: + interface ProxyRulePayload {
+ deploymentResourceId?: string;
+ [key: string]: unknown;
+ }
+
onMount(() => {
return realtime
.forProject(page.params.region, page.params.project)
.subscribe('console', (response) => {
if (
response.events.includes('proxy.rules.*.update') ||
response.events.includes('proxy.rules.*.create') ||
response.events.includes('proxy.rules.*.delete')
) {
- if ((response.payload as any)?.deploymentResourceId === page.params.function) {
+ if ((response.payload as ProxyRulePayload)?.deploymentResourceId === page.params.function) {
invalidate(Dependencies.FUNCTION_DOMAINS);
}
}
});
}); As per static analysis. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 17-17: Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any) 🪛 GitHub Check: build[failure] 17-17: 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
invalidate(Dependencies.FUNCTION_DOMAINS); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
</script> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
<slot /> |
Uh oh!
There was an error while loading. Please reload this page.