From 480edf8d5982a0d581244f84742e86fc8b2574ff Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Sun, 22 Jan 2023 15:30:27 +0100 Subject: [PATCH] Index creation --- frontend/src/components/modal.svelte | 14 -- .../collection/indexes-detail.svelte | 134 ++++++++++++++++++ .../connection/collection/indexes.svelte | 9 +- frontend/wailsjs/go/app/App.d.ts | 2 + frontend/wailsjs/go/app/App.js | 4 + internal/app/collection_indexes.go | 72 ++++++++++ 6 files changed, 220 insertions(+), 15 deletions(-) create mode 100644 frontend/src/organisms/connection/collection/indexes-detail.svelte diff --git a/frontend/src/components/modal.svelte b/frontend/src/components/modal.svelte index 744d5bf..323fbd3 100644 --- a/frontend/src/components/modal.svelte +++ b/frontend/src/components/modal.svelte @@ -124,18 +124,4 @@ padding: 1rem; border-top: 1px solid #ccc; } - - @media (max-width: 600px) { - .outer { - padding: 0; - } - - .inner { - max-width: 100%; - max-height: 100%; - width: 100%; - margin-top: auto; - margin-bottom: 0; - } - } diff --git a/frontend/src/organisms/connection/collection/indexes-detail.svelte b/frontend/src/organisms/connection/collection/indexes-detail.svelte new file mode 100644 index 0000000..8f663cb --- /dev/null +++ b/frontend/src/organisms/connection/collection/indexes-detail.svelte @@ -0,0 +1,134 @@ + + + +
+ + +
+ + + + +
+ +
+ {#each index.model as rule, ruleIndex} +
+ + + +
+ {:else} + No rules + {/each} +
+ +
+ + +
+
+
+ + diff --git a/frontend/src/organisms/connection/collection/indexes.svelte b/frontend/src/organisms/connection/collection/indexes.svelte index ede049b..4ea5f98 100644 --- a/frontend/src/organisms/connection/collection/indexes.svelte +++ b/frontend/src/organisms/connection/collection/indexes.svelte @@ -3,12 +3,14 @@ import ObjectGrid from '../../../components/objectgrid.svelte'; import { DropIndex, GetIndexes } from '../../../../wailsjs/go/app/App'; import Icon from '../../../components/icon.svelte'; + import IndexDetail from './indexes-detail.svelte'; export let collection; let indexes = []; let activePath = []; let objectViewerData = ''; + let creatingNewIndex = false; $: collection && getIndexes(); @@ -19,6 +21,10 @@ } } + function createIndex() { + creatingNewIndex = true; + } + async function drop(key) { if (typeof key !== 'string') { key = activePath[0]; @@ -41,7 +47,7 @@ -