From a9216eda891360cb4254c619f29625b50c885e97 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 25 Nov 2021 11:35:40 +0100 Subject: [PATCH] create table from database ctx menu --- .../web/src/appobj/DatabaseAppObject.svelte | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/web/src/appobj/DatabaseAppObject.svelte b/packages/web/src/appobj/DatabaseAppObject.svelte index c310057c..b5ee5def 100644 --- a/packages/web/src/appobj/DatabaseAppObject.svelte +++ b/packages/web/src/appobj/DatabaseAppObject.svelte @@ -17,6 +17,27 @@ }); }; + const handleNewTable = () => { + const tooltip = `${getConnectionLabel(connection)}\n${name}`; + openNewTab( + { + title: 'Table #', + tooltip, + icon: 'img table-structure', + tabComponent: 'TableStructureTab', + props: { + conid: connection._id, + database: name, + }, + }, + { + editor: { + columns: [], + }, + } + ); + }; + const handleImport = () => { showModal(ImportExportModal, { initialValues: { @@ -83,6 +104,8 @@ return [ { onClick: handleNewQuery, text: 'New query', isNewQuery: true }, + { onClick: handleNewTable, text: 'New table' }, + { divider: true }, { onClick: handleImport, text: 'Import' }, { onClick: handleExport, text: 'Export' }, { onClick: handleSqlGenerator, text: 'SQL Generator' },