mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 20:26:00 +00:00
perspective tre shows dependencies
This commit is contained in:
24
packages/web/src/perspectives/PerspectiveTree.svelte
Normal file
24
packages/web/src/perspectives/PerspectiveTree.svelte
Normal file
@@ -0,0 +1,24 @@
|
||||
<script lang="ts">
|
||||
import PerspectiveNodeRow from './PerspectiveNodeRow.svelte';
|
||||
|
||||
export let nodes = [];
|
||||
|
||||
function processFlatColumns(res, columns) {
|
||||
for (const col of columns) {
|
||||
res.push(col);
|
||||
if (col.isExpanded) {
|
||||
processFlatColumns(res, col.childNodes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getFlatColumns(columns) {
|
||||
const res = [];
|
||||
processFlatColumns(res, columns);
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#each getFlatColumns(nodes) as node}
|
||||
<PerspectiveNodeRow {node} />
|
||||
{/each}
|
||||
Reference in New Issue
Block a user