diff --git a/frontend/src/components/grid.svelte b/frontend/src/components/grid.svelte index 6bf3cd6..786dd8f 100644 --- a/frontend/src/components/grid.svelte +++ b/frontend/src/components/grid.svelte @@ -62,6 +62,25 @@ select(item[key]); contextMenu.show(evt, item.menu); } + + function formatValue(value) { + if (Array.isArray(value)) { + return '[...]'; + } + if (typeof value === 'object') { + return '{...}'; + } + if (value === undefined || value === null) { + return ''; + } + if (typeof value === 'number' || typeof value === 'boolean') { + return String(value); + } + if (String(value).length <= 1000) { + return value; + } + return String(value).slice(0, 1000) + '…'; + }
- {#if typeof value !== 'object'} - {value || ''} - {/if} + | + {formatValue(value)} | {/each}