From ce6903c43d040c04e89a9156f3364be72c1d6361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Fri, 28 Jan 2022 22:39:08 +0100 Subject: [PATCH] [ui] containers section in inspect --- webui/src/components/Inspect.svelte | 47 +++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/webui/src/components/Inspect.svelte b/webui/src/components/Inspect.svelte index dbc6e92..bc381ec 100644 --- a/webui/src/components/Inspect.svelte +++ b/webui/src/components/Inspect.svelte @@ -10,6 +10,7 @@ import Spinner from "./utils/Spinner.svelte"; import NotesEditor from "./utils/NotesEditor.svelte"; import type { AttributeChange } from "../types/base"; + import UpEntry from "./display/UpEntry.svelte"; export let address: string; export let index: number | undefined; @@ -87,6 +88,17 @@ ? untypedAttributes : filteredUntypedAttributes; + $: currentBacklinks = + (editable + ? $entity?.backlinks + : $entity?.backlinks.filter( + (entry) => !["HAS"].includes(entry.attribute) + )) || []; + + $: containers = ($entity?.backlinks || []) + .filter((e) => e.attribute === "HAS") + .map((e) => e.entity); + async function onChange(ev: CustomEvent) { const change = ev.detail; switch (change.type) { @@ -126,13 +138,23 @@
-

- {#if $entity} - - {:else} - - {/if} -

+
+

+ {#if $entity} + + {:else} + + {/if} +

+
+

Containers

+
+ {#each containers as address} + + {/each} +
+
+
{#if !$error} @@ -156,7 +178,7 @@ /> {/if} - {#if $entity?.backlinks.length > 0} + {#if currentBacklinks.length > 0}