better DB export UI

This commit is contained in:
Jan Prochazka 2022-04-28 11:54:31 +02:00
parent 4e32646ab8
commit bc49435fbf
2 changed files with 14 additions and 9 deletions

View File

@ -88,14 +88,14 @@
<FormProvider>
<ModalBase {...$$restProps}>
<svelte:fragment slot="header">Export database dump</svelte:fragment>
<div class="m-3">Target: {outputLabel}</div>
<div class="flex">
{#if electron}
<FormStyledButton type="button" value="Browse" on:click={handleBrowse} />
{:else}
<FormStyledButton type="button" value="Download" on:click={handleDownload} />
<FormStyledButton type="button" value="Set download" on:click={handleDownload} />
{/if}
<FormStyledButton type="button" value="Files folder" on:click={handleFilesFolder} />
</div>

View File

@ -4,8 +4,10 @@
import FormStyledButton from '../buttons/FormStyledButton.svelte';
import FormProvider from '../forms/FormProvider.svelte';
import FontIcon from '../icons/FontIcon.svelte';
import SocketMessageView from '../query/SocketMessageView.svelte';
import { apiCall, apiOff, apiOn } from '../utility/api';
import { showSnackbarError } from '../utility/snackbar';
import ModalBase from './ModalBase.svelte';
import { closeCurrentModal } from './modalTools';
@ -24,6 +26,7 @@
const handleStop = async () => {
closeCurrentModal();
apiCall('runners/cancel', { runid });
isCanceled = true;
};
const handleClose = () => {
@ -39,12 +42,9 @@
function handleRunnerDone() {
isRunning = false;
apiOff(`runner-done-${runid}`, handleRunnerDone);
// if (isCanceled) {
// showSnackbarError(canceledMessage);
// } else {
// showSnackbarInfo(finishedMessage);
// if (afterFinish) afterFinish();
// }
if (isCanceled) {
showSnackbarError('Process canceled');
}
}
apiOn(`runner-done-${runid}`, handleRunnerDone);
@ -58,7 +58,12 @@
<FormProvider>
<ModalBase {...$$restProps}>
<svelte:fragment slot="header">
{header}
<div class="flex">
{header}
{#if isRunning}
<FontIcon icon="icon loading" padLeft />
{/if}
</div>
</svelte:fragment>
<div class="messages">