From 0c94145b182d186c8eb72c99ef28b531b183b5db Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Mon, 18 Apr 2022 19:27:37 +0200 Subject: [PATCH] runner messages dialog --- packages/web/src/modals/RunScriptModal.svelte | 80 +++++++++++++++++++ packages/web/src/utility/exportFileTools.ts | 16 ++-- 2 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 packages/web/src/modals/RunScriptModal.svelte diff --git a/packages/web/src/modals/RunScriptModal.svelte b/packages/web/src/modals/RunScriptModal.svelte new file mode 100644 index 00000000..2bf5d826 --- /dev/null +++ b/packages/web/src/modals/RunScriptModal.svelte @@ -0,0 +1,80 @@ + + + + + + {header} + + +
+ +
+ + + {#if isRunning} + + {:else} + + {/if} + +
+
+ + diff --git a/packages/web/src/utility/exportFileTools.ts b/packages/web/src/utility/exportFileTools.ts index d4dbd583..352f0cfe 100644 --- a/packages/web/src/utility/exportFileTools.ts +++ b/packages/web/src/utility/exportFileTools.ts @@ -5,6 +5,8 @@ import resolveApi from './resolveApi'; import { apiCall, apiOff, apiOn } from './api'; import { normalizeExportColumnMap } from '../impexp/createImpExpScript'; import { getCurrentConfig } from '../stores'; +import { showModal } from '../modals/modalTools'; +import RunScriptModal from '../modals/RunScriptModal.svelte'; export async function importSqlDump(inputFile, connection) { const script = getCurrentConfig().allowShellScripting ? new ScriptWriter() : new ScriptWriterJson(); @@ -14,12 +16,14 @@ export async function importSqlDump(inputFile, connection) { connection, }); - await runImportExportScript({ - script: script.getScript(), - runningMessage: 'Importing database', - canceledMessage: 'Database import canceled', - finishedMessage: 'Database import finished', - }); + showModal(RunScriptModal, { script: script.getScript(), header: 'Importing database' }); + + // await runImportExportScript({ + // script: script.getScript(), + // runningMessage: 'Importing database', + // canceledMessage: 'Database import canceled', + // finishedMessage: 'Database import finished', + // }); } async function runImportExportScript({ script, runningMessage, canceledMessage, finishedMessage, afterFinish = null }) {