diff --git a/frontend/src/app.svelte b/frontend/src/app.svelte
index 3e5a450..5e75190 100644
--- a/frontend/src/app.svelte
+++ b/frontend/src/app.svelte
@@ -1,10 +1,11 @@
+
+{#if items && position}
+
+
+{/if}
+
+
diff --git a/frontend/src/components/grid.svelte b/frontend/src/components/grid.svelte
index 655e259..a49381c 100644
--- a/frontend/src/components/grid.svelte
+++ b/frontend/src/components/grid.svelte
@@ -1,9 +1,11 @@
0} class:contained>
+ {#if actions?.length}
+
+ {#each actions as action}
+
+ {/each}
+
+ {/if}
+
{#if showHeaders && columns.some(col => col.title)}
@@ -63,10 +85,15 @@
{#each _items as item (item[key])}
- select(item[key])} class:selected={activeKey === item[key] && !activeChildKey}>
+
select(item[key])}
+ on:dblclick={() => toggleChildren(item[key])}
+ on:contextmenu|preventDefault={evt => showContextMenu(evt, item)}
+ class:selected={activeKey === item[key] && !activeChildKey}
+ >
{#if item.children?.length}
- |
@@ -116,6 +144,15 @@
width: 100%;
}
+ .actions {
+ margin-bottom: 0.5rem;
+ padding: 0.5rem;
+ border-bottom: 1px solid #ccc;
+ }
+ .actions button {
+ margin-right: 0.2rem;
+ }
+
table {
border-collapse: collapse;
width: 100%;
diff --git a/frontend/src/components/icon.svelte b/frontend/src/components/icon.svelte
index 4f97436..bbb3c14 100644
--- a/frontend/src/components/icon.svelte
+++ b/frontend/src/components/icon.svelte
@@ -1,5 +1,5 @@
{#if name === 'radio'}
@@ -14,6 +14,10 @@
{:else if name === 'x'}
+{:else if name === '+'}
+
{:else if name === '-'}
+{:else if name === 'reload'}
+
{/if}
diff --git a/frontend/src/organisms/collection-detail/find.svelte b/frontend/src/organisms/collection-detail/find.svelte
index 94df674..848cfec 100644
--- a/frontend/src/organisms/collection-detail/find.svelte
+++ b/frontend/src/organisms/collection-detail/find.svelte
@@ -13,17 +13,10 @@
sort: '{ "_id": 1 }',
fields: '{}',
skip: 0,
- limit: 30,
- };
-
- let form = {
- query: '{}',
- sort: '{ "_id": 1 }',
- fields: '{}',
- skip: 0,
- limit: 30,
+ limit: 15,
};
+ let form = { ...defaults };
let result = {};
let submittedForm = {};
let queryField;
diff --git a/frontend/src/organisms/collection-detail/index.svelte b/frontend/src/organisms/collection-detail/index.svelte
index b806935..70247d9 100644
--- a/frontend/src/organisms/collection-detail/index.svelte
+++ b/frontend/src/organisms/collection-detail/index.svelte
@@ -24,7 +24,6 @@
async function catchQuery(event) {
tab = 'find';
await tick();
- console.log(event, find);
find.performQuery(event.detail);
}
diff --git a/frontend/src/stores.js b/frontend/src/stores.js
index 7a5b02f..d0c9ff6 100644
--- a/frontend/src/stores.js
+++ b/frontend/src/stores.js
@@ -9,3 +9,15 @@ busy.subscribe(isBusy => {
document.body.classList.remove('busy');
}
});
+
+export const contextMenu = (() => {
+ const { set, subscribe } = writable();
+ return {
+ show: (evt, menu) => set(menu ? {
+ position: [ evt.clientX, evt.clientY ],
+ items: menu,
+ } : undefined),
+ hide: () => set(undefined),
+ subscribe,
+ };
+})();
diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts
index e0bbea2..9240a72 100755
--- a/frontend/wailsjs/go/main/App.d.ts
+++ b/frontend/wailsjs/go/main/App.d.ts
@@ -4,6 +4,8 @@ import {map[string]main} from '../models';
import {primitive} from '../models';
import {main} from '../models';
+export function DropDatabase(arg1:string,arg2:string):Promise;
+
export function Hosts():Promise