From ed0d63d13539bad98e5267bc32693ae8cbb878d1 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Mon, 18 Apr 2022 19:59:19 +0200 Subject: [PATCH] import sql dump --- packages/web/src/appobj/ConnectionAppObject.svelte | 9 +++++++++ packages/web/src/modals/ChangeDownloadUrlModal.svelte | 2 +- .../web/src/modals/ImportDatabaseDumpModal.svelte | 11 +++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/web/src/appobj/ConnectionAppObject.svelte b/packages/web/src/appobj/ConnectionAppObject.svelte index 1b984216..ca77f02f 100644 --- a/packages/web/src/appobj/ConnectionAppObject.svelte +++ b/packages/web/src/appobj/ConnectionAppObject.svelte @@ -29,6 +29,7 @@ import { getDatabaseList, useUsedApps } from '../utility/metadataLoaders'; import { getLocalStorage } from '../utility/storageCache'; import { apiCall } from '../utility/api'; + import ImportDatabaseDumpModal from '../modals/ImportDatabaseDumpModal.svelte'; export let data; export let passProps; @@ -58,6 +59,12 @@ } }; + const handleSqlRestore = () => { + showModal(ImportDatabaseDumpModal, { + connection: data, + }); + }; + const getContextMenu = () => { const driver = $extensions.drivers.find(x => x.engine == data.engine); const config = getCurrentConfig(); @@ -158,6 +165,8 @@ { divider: true }, getDatabaseMenuItems(data, data.defaultDatabase, $extensions, $currentDatabase, $apps), ], + + driver?.databaseEngineTypes?.includes('sql') && { onClick: handleSqlRestore, text: 'Restore/import SQL dump' }, ]; }; diff --git a/packages/web/src/modals/ChangeDownloadUrlModal.svelte b/packages/web/src/modals/ChangeDownloadUrlModal.svelte index 4677f95a..86ffb41e 100644 --- a/packages/web/src/modals/ChangeDownloadUrlModal.svelte +++ b/packages/web/src/modals/ChangeDownloadUrlModal.svelte @@ -9,7 +9,7 @@ export let onConfirm; - const handleSubmit = async e => { + const handleSubmit = e => { onConfirm(e.detail.url); closeCurrentModal(); }; diff --git a/packages/web/src/modals/ImportDatabaseDumpModal.svelte b/packages/web/src/modals/ImportDatabaseDumpModal.svelte index 12b7217a..8b70835a 100644 --- a/packages/web/src/modals/ImportDatabaseDumpModal.svelte +++ b/packages/web/src/modals/ImportDatabaseDumpModal.svelte @@ -1,13 +1,11 @@