realtime support, skip badge for new domain flow

This commit is contained in:
Hemachandar
2025-12-12 20:34:33 +05:30
parent 212d2ce02c
commit c09eb5d135
4 changed files with 24 additions and 26 deletions
+18 -12
View File
@@ -73,18 +73,24 @@
<Typography.Text variant="l-500" color="--fgcolor-neutral-primary">
{domain}
</Typography.Text>
{#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" />
{#if verified !== undefined}
{#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" />
{/if}
{/if}
</Layout.Stack>
<Typography.Text variant="m-400">
@@ -7,12 +7,8 @@
import { ProxyRuleDeploymentResourceType, type Models } from '@appwrite.io/console';
onMount(() => {
return realtime.forProject(page.params.region, page.params.project, (response) => {
if (
response.events.includes('rules.*.update') ||
response.events.includes('rules.*.create') ||
response.events.includes('rules.*.delete')
) {
return realtime.forProject(page.params.region, ['console', 'project'], (response) => {
if (response.events.includes('rules.*.update')) {
const proxyRule = response.payload as Models.ProxyRule;
if (
proxyRule.deploymentResourceType === ProxyRuleDeploymentResourceType.Function &&
@@ -7,16 +7,12 @@
import { ProxyRuleDeploymentResourceType, type Models } from '@appwrite.io/console';
onMount(() => {
return realtime.forProject(page.params.region, page.params.project, (response) => {
if (
response.events.includes('rules.*.update') ||
response.events.includes('rules.*.create') ||
response.events.includes('rules.*.delete')
) {
return realtime.forProject(page.params.region, ['console', 'project'], (response) => {
if (response.events.includes('rules.*.update')) {
const proxyRule = response.payload as Models.ProxyRule;
if (
proxyRule.deploymentResourceType === ProxyRuleDeploymentResourceType.Site &&
proxyRule.deploymentResourceId === page.params.function
proxyRule.deploymentResourceId === page.params.site
) {
invalidate(Dependencies.SITES_DOMAINS);
}
@@ -44,7 +44,7 @@
}
});
let verified = $state(false);
let verified: boolean | undefined = $state(undefined);
let routeBase = `${base}/project-${page.params.region}-${page.params.project}/sites/site-${page.params.site}/domains`;
let isSubmitting = $state(writable(false));