From 3b05148618322721d3a7bee87434816f640ec5ce Mon Sep 17 00:00:00 2001 From: Darshan Date: Thu, 22 May 2025 09:26:54 +0530 Subject: [PATCH] add: domain status badge again. --- .../domains/+page.svelte | 19 +++++++++++++++---- .../domains/domain-[domain]/store.ts | 4 ++-- .../domains/domain-[domain]/table.svelte | 5 ++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/domains/+page.svelte b/src/routes/(console)/organization-[organization]/domains/+page.svelte index 174858ce1..9347487ff 100644 --- a/src/routes/(console)/organization-[organization]/domains/+page.svelte +++ b/src/routes/(console)/organization-[organization]/domains/+page.svelte @@ -15,6 +15,7 @@ } from '@appwrite.io/pink-icons-svelte'; import { ActionMenu, + Badge, Card, Empty, Icon, @@ -38,6 +39,10 @@ let showDelete = false; let showRetry = false; let selectedDomain: Domain = null; + + const isDomainVerified = (domain: Domain) => { + return domain.nameservers.toLocaleLowerCase() === 'appwrite'; + }; @@ -76,16 +81,22 @@ {#if column.id === 'domain'} - + + variant="quiet"> {domain.domain} + {#if !isDomainVerified(domain)} + + {/if} {:else if column.id === 'registrar'} {domain.registrar || '-'} @@ -117,7 +128,7 @@ - {#if domain.nameservers !== 'Appwrite'} + {#if isDomainVerified(domain)} { diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts index b427b2c64..649d4ec5f 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts @@ -6,8 +6,8 @@ import { derived, writable } from 'svelte/store'; export const domain = derived(page, ($page) => $page.data.domain as Domain); export const columns = writable([ { id: 'name', title: 'Name', type: 'string' }, - { id: 'type', title: 'Type', type: 'string' }, - { id: 'value', title: 'Value', type: 'string' }, + { id: 'type', title: 'Type', type: 'string', width: 125 }, + { id: 'value', title: 'Value', type: 'string', width: 250 }, { id: 'ttl', title: 'TTL', type: 'integer' }, { id: 'priority', title: 'Priority', type: 'integer', hide: true }, { id: 'comment', title: 'Comment', type: 'string', hide: true }, diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte index 8041a4fd2..fa6f59d80 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte @@ -57,7 +57,10 @@ {:else if column.id === 'value'} {@const isARecord = record.value === 'a.a.a.a'} {#if isARecord} - Served by Appwrite + +
+ Served by Appwrite +
{:else} {/if}