mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 07:16:01 +00:00
Merge branch 'master' into develop
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { getAsImageSrc, safeJsonParse } from 'dbgate-tools';
|
||||
import { isArray } from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import CellValue from '../datagrid/CellValue.svelte';
|
||||
import JSONTree from '../jsontree/JSONTree.svelte';
|
||||
@@ -12,7 +12,7 @@
|
||||
export let displayType;
|
||||
</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 displayType == 'json'}
|
||||
<JSONTree value={safeJsonParse(value, value?.toString())} slicedKeyCount={1} disableContextMenu />
|
||||
@@ -23,6 +23,8 @@
|
||||
{:else}
|
||||
<span class="null"> (no image)</span>
|
||||
{/if}
|
||||
{:else if _.isArray(value) || _.isPlainObject(value)}
|
||||
<JSONTree {value} slicedKeyCount={1} disableContextMenu />
|
||||
{:else}
|
||||
<CellValue {rowData} {value} />
|
||||
{/if}
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
let errorMessage;
|
||||
let rowCount;
|
||||
let isLoading = false;
|
||||
let isLoadQueued = false;
|
||||
const lastVisibleRowIndexRef = createRef(0);
|
||||
const disableLoadNextRef = createRef(false);
|
||||
|
||||
@@ -121,6 +122,12 @@
|
||||
}
|
||||
|
||||
async function loadData(node: PerspectiveTreeNode, counts) {
|
||||
if (isLoading) {
|
||||
isLoadQueued = true;
|
||||
return;
|
||||
} else {
|
||||
isLoadQueued = false;
|
||||
}
|
||||
// console.log('LOADING', node);
|
||||
if (!node) return;
|
||||
const rows = [];
|
||||
@@ -147,6 +154,10 @@
|
||||
// loadProps.push(child.getNodeLoadProps());
|
||||
// }
|
||||
// }
|
||||
|
||||
if (isLoadQueued) {
|
||||
loadData(root, $loadedCounts);
|
||||
}
|
||||
}
|
||||
|
||||
export function openJson() {
|
||||
|
||||
Reference in New Issue
Block a user