1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2024-12-01 13:20:54 +00:00

Drop databases and collections

This commit is contained in:
Romein van Buren 2023-01-15 16:51:39 +01:00
parent c9a035ed59
commit d139a077d9
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
2 changed files with 12 additions and 2 deletions

View File

@ -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}

View File

@ -87,7 +87,7 @@
{#if actions?.length}
<div class="actions">
{#each actions as action}
<button class="btn" on:click={action.fn}>
<button class="btn" on:click={action.fn} disabled={action.disabled}>
{#if action.icon}<Icon name={action.icon} />{/if}
{action.label || ''}
</button>