diff --git a/frontend/src/components/objectgrid.svelte b/frontend/src/components/objectgrid.svelte index bb76b8a..9d8d5b5 100644 --- a/frontend/src/components/objectgrid.svelte +++ b/frontend/src/components/objectgrid.svelte @@ -19,10 +19,11 @@ if (Array.isArray(data)) { for (const item of data) { - const _item = {}; - _item.key = item[key]; - _item.children = dissectObject(item); - items = [ ...items, _item ]; + const newItem = {}; + newItem.key = item[key]; + newItem.children = dissectObject(item); + newItem.menu = item.menu; + items = [ ...items, newItem ]; } } else { @@ -57,7 +58,7 @@ return entries.map(([ key, value ]) => { key = key + ''; const type = getType(value); - const child = { key, value, type }; + const child = { key, value, type, menu: value.menu }; if (type.startsWith('object') || type.startsWith('array')) { child.children = dissectObject(value); diff --git a/frontend/src/organisms/connection/collection/indexes.svelte b/frontend/src/organisms/connection/collection/indexes.svelte index 2f43f04..b102e28 100644 --- a/frontend/src/organisms/connection/collection/indexes.svelte +++ b/frontend/src/organisms/connection/collection/indexes.svelte @@ -16,13 +16,14 @@ } } - async function dropActive() { - if (!activeKey) { + async function drop(key = activeKey) { + if (!key) { return; } - const success = await DropIndex(collection.hostKey, collection.dbKey, collection.key, activeKey); + const success = await DropIndex(collection.hostKey, collection.dbKey, collection.key, key); if (success) { await getIndexes(); + activeKey = ''; } } @@ -35,14 +36,17 @@