better import/export dump modals

This commit is contained in:
Jan Prochazka 2022-04-28 14:20:55 +02:00
parent 97c2dcbaf6
commit 51bd5c228b
2 changed files with 21 additions and 4 deletions

View File

@ -15,6 +15,7 @@
import { closeCurrentModal, showModal } from './modalTools';
import InputTextModal from './InputTextModal.svelte';
import { apiCall } from '../utility/api';
import getConnectionLabel from '../utility/getConnectionLabel';
export let connection;
@ -89,9 +90,16 @@
<ModalBase {...$$restProps}>
<svelte:fragment slot="header">Export database dump</svelte:fragment>
<div class="m-3">Target: {outputLabel}</div>
<div class="m-3">
<strong>Source:</strong>
{getConnectionLabel(connection)}
{#if connection.database}
({connection.database})
{/if}
</div>
<div class="flex">
<div class="ml-3 mr-3 mt-3"><strong>Target:</strong> {outputLabel}</div>
<div class="flex ml-3">
{#if electron}
<FormStyledButton type="button" value="Browse" on:click={handleBrowse} />
{:else}

View File

@ -9,6 +9,7 @@
import { currentDropDownMenu } from '../stores';
import { apiCall } from '../utility/api';
import { importSqlDump } from '../utility/exportFileTools';
import getConnectionLabel from '../utility/getConnectionLabel';
import getElectron from '../utility/getElectron';
import { setUploadListener } from '../utility/uploadFiles';
import ChangeDownloadUrlModal from './ChangeDownloadUrlModal.svelte';
@ -90,9 +91,9 @@
<ModalBase {...$$restProps}>
<svelte:fragment slot="header">Import database dump</svelte:fragment>
<div class="m-3">Source: {inputLabel}</div>
<div class="ml-3 mr-3 mt-3"><strong>Source:</strong> {inputLabel}</div>
<div class="flex">
<div class="flex ml-3 mr-3 mb-3">
{#if electron}
<FormStyledButton type="button" value="Browse" on:click={handleBrowse} />
{:else}
@ -103,6 +104,14 @@
<FormStyledButton value="From files" on:click={handleFilesClick} bind:this={domButton} />
</div>
<div class="m-3">
<strong>Target:</strong>
{getConnectionLabel(connection)}
{#if connection.database}
({connection.database})
{/if}
</div>
<svelte:fragment slot="footer">
<FormSubmit value="Run import" on:click={e => handleSubmit(e.detail)} disabled={!inputFile} />
<FormStyledButton type="button" value="Cancel" on:click={closeCurrentModal} />