From fd1340f9e42a8754c4e2b54bad086745b7663a9a Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Fri, 22 Dec 2023 17:05:32 +0100 Subject: [PATCH] Add nice loading indicator to the host tree --- .../src/components/grid/grid-items.svelte | 20 ++++++++++++++++++- frontend/src/components/icon.svelte | 7 +------ frontend/src/lib/stores/hosttree.js | 11 ++++++++++ .../src/organisms/connection/hosttree.svelte | 13 ++++++++++-- frontend/src/styles/style.css | 5 +++++ 5 files changed, 47 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/grid/grid-items.svelte b/frontend/src/components/grid/grid-items.svelte index 9c3172d..311e90a 100644 --- a/frontend/src/components/grid/grid-items.svelte +++ b/frontend/src/components/grid/grid-items.svelte @@ -156,6 +156,10 @@ {/if} + + {#if item.loading} + + {/if} {/if} @@ -234,11 +238,25 @@ text-overflow: ellipsis; } td.has-toggle { + position: relative; width: 1.5em; } + td.has-toggle .spinner { + position: absolute; + top: 0.3em; + left: 0.22em; + width: 1em; + height: 1em; + border: 1px solid var(--primary); + border-radius: 50px; + border-top-color: transparent; + border-left-color: transparent; + animation: .6s linear 0 spin; + animation-iteration-count: infinite; + } td.has-icon { padding: 0; - width: 1px; + width: 1.5em; } td.has-icon :global(svg) { width: 1em; diff --git a/frontend/src/components/icon.svelte b/frontend/src/components/icon.svelte index 597f460..7f314f6 100644 --- a/frontend/src/components/icon.svelte +++ b/frontend/src/components/icon.svelte @@ -11,11 +11,6 @@