From a1456b398744933ba9e8070c6acc662fac5191f7 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Sun, 18 Jun 2023 21:31:55 +0200 Subject: [PATCH] Implement OOP hosttree (#32) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/index.html | 1 + frontend/package.json.md5 | 2 +- frontend/src/app.svelte | 44 +-- frontend/src/components/grid-items.svelte | 2 +- frontend/src/components/modal.svelte | 14 +- frontend/src/components/objectviewer.svelte | 2 +- .../src/{organisms => dialogs}/about.svelte | 4 +- .../settings/index.svelte | 4 +- frontend/src/lib/dialogs.js | 20 ++ frontend/src/lib/stores/connections.js | 5 - frontend/src/lib/stores/hosts.js | 11 - frontend/src/lib/stores/hosttree.js | 312 ++++++++++++++++++ frontend/src/lib/stores/inited.js | 16 +- frontend/src/lib/stores/views.js | 9 +- .../connection/collection/aggregate.svelte | 2 +- .../collection/components/form.svelte | 2 +- .../{components => dialogs}/export.svelte | 35 +- .../indexdetail.svelte | 15 +- .../querychooser.svelte | 30 +- .../{components => dialogs}/viewconfig.svelte | 67 ++-- .../connection/collection/find.svelte | 56 ++-- .../connection/collection/index.svelte | 22 +- .../connection/collection/indexes.svelte | 55 +-- .../connection/collection/insert.svelte | 14 +- .../{ => database/dialogs}/dump.svelte | 39 ++- .../{ => host/dialogs}/hostdetail.svelte | 25 +- .../src/organisms/connection/hosttree.svelte | 212 +++--------- .../src/organisms/connection/index.svelte | 121 +------ .../src/organisms/connection/welcome.svelte | 60 ---- internal/app/app_menu.go | 2 - internal/app/collection_find.go | 6 +- internal/app/collection_find_export.go | 2 +- internal/app/connection.go | 6 +- 33 files changed, 624 insertions(+), 593 deletions(-) rename frontend/src/{organisms => dialogs}/about.svelte (95%) rename frontend/src/{organisms => dialogs}/settings/index.svelte (95%) create mode 100644 frontend/src/lib/dialogs.js delete mode 100644 frontend/src/lib/stores/connections.js delete mode 100644 frontend/src/lib/stores/hosts.js create mode 100644 frontend/src/lib/stores/hosttree.js rename frontend/src/organisms/connection/collection/{components => dialogs}/export.svelte (60%) rename frontend/src/organisms/connection/collection/{components => dialogs}/indexdetail.svelte (86%) rename frontend/src/organisms/connection/collection/{components => dialogs}/querychooser.svelte (84%) rename frontend/src/organisms/connection/collection/{components => dialogs}/viewconfig.svelte (77%) rename frontend/src/organisms/connection/{ => database/dialogs}/dump.svelte (76%) rename frontend/src/organisms/connection/{ => host/dialogs}/hostdetail.svelte (83%) delete mode 100644 frontend/src/organisms/connection/welcome.svelte diff --git a/frontend/index.html b/frontend/index.html index df8520a..5deb4fb 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -15,6 +15,7 @@
+
diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index ff234ac..70a0207 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -499da1237327bf4ddd2de74bfd6635c7 \ No newline at end of file +5d3dd16f94d140a9f950a48981534162 \ No newline at end of file diff --git a/frontend/src/app.svelte b/frontend/src/app.svelte index b66f9cc..b5ef25a 100644 --- a/frontend/src/app.svelte +++ b/frontend/src/app.svelte @@ -1,39 +1,44 @@ @@ -41,23 +46,20 @@
{$windowTitle}
- {#if $applicationInited && $hosts && (showWelcomeScreen !== undefined)} + {#if $applicationInited && (showWelcomeScreen !== undefined)}
{#if showWelcomeScreen} {:else} - + {/if}
{#key $contextMenu} {/key} - - - {/if}
diff --git a/frontend/src/components/grid-items.svelte b/frontend/src/components/grid-items.svelte index c519613..1cb1536 100644 --- a/frontend/src/components/grid-items.svelte +++ b/frontend/src/components/grid-items.svelte @@ -66,7 +66,7 @@ activeKey = itemKey; activePath = [ ...path.slice(0, level), itemKey ]; - dispatch('select', { level, itemKey, index }); + dispatch('select', { level, itemKey, index, path: activePath }); } function closeAll() { diff --git a/frontend/src/components/modal.svelte b/frontend/src/components/modal.svelte index fedabf4..bfe99b2 100644 --- a/frontend/src/components/modal.svelte +++ b/frontend/src/components/modal.svelte @@ -4,15 +4,17 @@ @@ -42,7 +48,7 @@ {#if title}
{title}
-
@@ -69,6 +75,7 @@ background-color: rgba(0, 0, 0, 0.5); margin: 0; padding-top: 50px; + --wails-draggable: drag; } :global(#root.platform-darwin) .outer { margin-top: var(--darwin-titlebar-height); @@ -86,6 +93,7 @@ flex-flow: column; cursor: auto; overflow: hidden; + --wails-draggable: nodrag; } .inner > :global(*:first-child) { margin-top: 0; diff --git a/frontend/src/components/objectviewer.svelte b/frontend/src/components/objectviewer.svelte index f7f2ef8..db404f2 100644 --- a/frontend/src/components/objectviewer.svelte +++ b/frontend/src/components/objectviewer.svelte @@ -1,10 +1,10 @@ - +
Rolens logo
diff --git a/frontend/src/organisms/settings/index.svelte b/frontend/src/dialogs/settings/index.svelte similarity index 95% rename from frontend/src/organisms/settings/index.svelte rename to frontend/src/dialogs/settings/index.svelte index ae4f169..c203330 100644 --- a/frontend/src/organisms/settings/index.svelte +++ b/frontend/src/dialogs/settings/index.svelte @@ -3,11 +3,9 @@ import Modal from '$components/modal.svelte'; import input from '$lib/actions/input'; import settings from '$lib/stores/settings'; - - export let show = false; - +