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 006738f20..8fde81408 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte @@ -39,12 +39,11 @@ let showDelete = false; let selectedRecord: Models.DnsRecord = null; - function formatRecordName(name: string) { - const limit = 30; + function formatName(name: string, limit: number = 30) { return { - value: name.length > limit ? `${name.slice(0, limit)}...` : name, - truncated: name.length > limit, - whole: name + value: name ? (name.length > limit ? `${name.slice(0, limit)}...` : name) : '-', + truncated: name ? name.length > limit : undefined, + whole: name ?? '-' }; } @@ -65,7 +64,7 @@ {#each $columns as column} {#if column.id === 'name'} - {@const formatted = formatRecordName(record.name)} + {@const formatted = formatName(record.name)} {formatted.value} {:else if column.id === 'comment'} - {record?.comment ?? '-'} + {@const formatted = formatName(record?.comment)} + + {formatted.value} + + {#if showing} + {formatted.whole} + {/if} + + {:else if column.id === '$createdAt'}