mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
auto view json #395
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getAsImageSrc, safeJsonParse } from 'dbgate-tools';
|
import { getAsImageSrc, safeJsonParse } from 'dbgate-tools';
|
||||||
import { isArray } from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
import CellValue from '../datagrid/CellValue.svelte';
|
import CellValue from '../datagrid/CellValue.svelte';
|
||||||
import JSONTree from '../jsontree/JSONTree.svelte';
|
import JSONTree from '../jsontree/JSONTree.svelte';
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
export let displayType;
|
export let displayType;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<td rowspan={rowSpan} data-column={columnIndex} class:isEmpty={value===undefined}>
|
<td rowspan={rowSpan} data-column={columnIndex} class:isEmpty={value === undefined}>
|
||||||
{#if value !== undefined}
|
{#if value !== undefined}
|
||||||
{#if displayType == 'json'}
|
{#if displayType == 'json'}
|
||||||
<JSONTree value={safeJsonParse(value, value?.toString())} slicedKeyCount={1} disableContextMenu />
|
<JSONTree value={safeJsonParse(value, value?.toString())} slicedKeyCount={1} disableContextMenu />
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<span class="null"> (no image)</span>
|
<span class="null"> (no image)</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
{:else if _.isArray(value) || _.isPlainObject(value)}
|
||||||
|
<JSONTree {value} slicedKeyCount={1} disableContextMenu />
|
||||||
{:else}
|
{:else}
|
||||||
<CellValue {rowData} {value} />
|
<CellValue {rowData} {value} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user