diff --git a/frontend/src/components/icon.svelte b/frontend/src/components/icon.svelte
index 88837a5..4f97436 100644
--- a/frontend/src/components/icon.svelte
+++ b/frontend/src/components/icon.svelte
@@ -14,4 +14,6 @@
{:else if name === 'x'}
+{:else if name === '-'}
+
{/if}
diff --git a/frontend/src/components/objectgrid.svelte b/frontend/src/components/objectgrid.svelte
index 02036e7..867376a 100644
--- a/frontend/src/components/objectgrid.svelte
+++ b/frontend/src/components/objectgrid.svelte
@@ -5,6 +5,13 @@
export let key = '_id';
export let showHeaders = false;
export let contained = true;
+ export let activeKey = '';
+
+ const columns = [
+ { key: 'key', label: 'Key' },
+ { key: 'value', label: 'Value' },
+ { key: 'type', label: 'Type' },
+ ];
let items = [];
@@ -61,8 +68,4 @@
}
-
+
diff --git a/frontend/src/organisms/collection-detail/find.svelte b/frontend/src/organisms/collection-detail/find.svelte
index 663900c..4189902 100644
--- a/frontend/src/organisms/collection-detail/find.svelte
+++ b/frontend/src/organisms/collection-detail/find.svelte
@@ -26,6 +26,7 @@
let result = [];
let queryField;
+ let activeKey = '';
$: code = `db.${collection.key}.find(${form.query || '{}'}${form.fields && form.fields !== '{}' ? `, ${form.fields}` : ''}).sort(${form.sort})${form.skip ? `.skip(${form.skip})` : ''}${form.limit ? `.limit(${form.limit})` : ''};`;
$: if (collection) {
@@ -33,11 +34,30 @@
}
async function submitQuery() {
+ activeKey = '';
result = await PerformFind(collection.hostKey, collection.dbKey, collection.key, JSON.stringify(form));
queryField?.focus();
queryField?.select();
}
+ function prev() {
+ form.skip -= form.limit;
+ if (form.skip < 0) {
+ form.skip = 0;
+ }
+ submitQuery();
+ }
+
+ function next() {
+ form.skip += form.limit;
+ submitQuery();
+ }
+
+ function remove() {
+ // eslint-disable-next-line no-alert
+ alert('yet to be implemented');
+ }
+
onMount(() => {
queryField?.focus();
queryField?.select();
@@ -80,7 +100,7 @@
-
+
{#if result}
@@ -88,8 +108,15 @@
{/if}
-
-
+
+
+
diff --git a/frontend/src/style.css b/frontend/src/style.css
index fcd6d13..1204c45 100644
--- a/frontend/src/style.css
+++ b/frontend/src/style.css
@@ -77,6 +77,12 @@ p {
box-shadow: 0 0 0 3px rgba(0, 0, 139, 0.2);
outline: none;
}
+.btn.danger {
+ background-color: #c00;
+}
+.btn.danger:focus {
+ box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.2);
+}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;