From d139a077d93eeb37191e06fddafa628e2ce62c04 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Sun, 15 Jan 2023 16:51:39 +0100 Subject: [PATCH] Drop databases and collections --- frontend/src/app.svelte | 12 +++++++++++- frontend/src/components/grid.svelte | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/app.svelte b/frontend/src/app.svelte index 24e6fbc..ee7b3cc 100644 --- a/frontend/src/app.svelte +++ b/frontend/src/app.svelte @@ -135,7 +135,17 @@ newDb = {}; } } }, - { icon: '-' }, + { icon: '-', fn: evt => { + if (activeCollKey) { + contextMenu.show(evt, [ + { label: 'Drop database', fn: () => dropDatabase(activeDbKey) }, + { label: 'Drop collection', fn: () => dropCollection(activeDbKey, activeCollKey) }, + ]); + } + else { + dropDatabase(activeDbKey); + } + }, disabled: !activeDbKey }, ]} bind:activeKey={activeDbKey} bind:activeChildKey={activeCollKey} diff --git a/frontend/src/components/grid.svelte b/frontend/src/components/grid.svelte index 786dd8f..8ee7cf0 100644 --- a/frontend/src/components/grid.svelte +++ b/frontend/src/components/grid.svelte @@ -87,7 +87,7 @@ {#if actions?.length}
{#each actions as action} -