SYNC: archive UX

This commit is contained in:
SPRINX0\prochazka
2025-04-09 16:30:12 +02:00
committed by Diflow
parent 544b75bcd5
commit 9380608781
2 changed files with 16 additions and 7 deletions

View File

@@ -23,6 +23,8 @@
import { findEngineDriver } from 'dbgate-tools';
import AceEditor from '../query/AceEditor.svelte';
import { _t } from '../translations';
import { showModal } from '../modals/modalTools';
import InputTextModal from '../modals/InputTextModal.svelte';
export let direction;
export let storageTypeField;
@@ -54,7 +56,7 @@
{ value: 'query', label: _t('common.query', { defaultMessage: 'Query' }), directions: ['source'] },
{
value: 'archive',
label: _t('common.archive', { defaultMessage: 'Archive' }),
label: _t('common.archive', { defaultMessage: 'Archive (JSONL)' }),
directions: ['source', 'target'],
},
];
@@ -108,11 +110,18 @@
<FormStyledButton
value="New archive"
on:click={() => {
values.update(x => ({
...x,
[storageTypeField]: 'archive',
[archiveFolderField]: `import-${moment().format('YYYY-MM-DD-hh-mm-ss')}`,
}));
showModal(InputTextModal, {
header: 'Archive',
label: 'Name of new archive folder',
value: `import-${moment().format('YYYY-MM-DD-hh-mm-ss')}`,
onConfirm: value => {
values.update(x => ({
...x,
[storageTypeField]: 'archive',
[archiveFolderField]: value,
}));
},
});
}}
/>
{/if}