mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 16:36:00 +00:00
import UX
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<script lang="ts">
|
||||
import _ from 'lodash';
|
||||
import FormStyledButton from '../elements/FormStyledButton.svelte';
|
||||
import FormArchiveFilesSelect from '../forms/FormArchiveFilesSelect.svelte';
|
||||
import moment from 'moment';
|
||||
|
||||
import FormArchiveFolderSelect from '../forms/FormArchiveFolderSelect.svelte';
|
||||
import FormArgumentList from '../forms/FormArgumentList.svelte';
|
||||
@@ -11,7 +13,7 @@
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import { findFileFormat, getFileFormatDirections } from '../plugins/fileformats';
|
||||
import SqlEditor from '../query/SqlEditor.svelte';
|
||||
import { extensions } from '../stores';
|
||||
import { currentArchive, currentDatabase, extensions } from '../stores';
|
||||
import { useArchiveFiles, useDatabaseInfo } from '../utility/metadataLoaders';
|
||||
import FilesInput from './FilesInput.svelte';
|
||||
import FormConnectionSelect from './FormConnectionSelect.svelte';
|
||||
@@ -64,6 +66,44 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if direction == 'target'}
|
||||
<div class="buttons">
|
||||
{#if $currentDatabase}
|
||||
<FormStyledButton
|
||||
value="Current DB"
|
||||
on:click={() => {
|
||||
values.update(x => ({
|
||||
...x,
|
||||
[storageTypeField]: 'database',
|
||||
[connectionIdField]: $currentDatabase?.connection?._id,
|
||||
[databaseNameField]: $currentDatabase?.name,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
<FormStyledButton
|
||||
value="Current archive"
|
||||
on:click={() => {
|
||||
values.update(x => ({
|
||||
...x,
|
||||
[storageTypeField]: 'archive',
|
||||
[archiveFolderField]: $currentArchive,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
<FormStyledButton
|
||||
value="New archive"
|
||||
on:click={() => {
|
||||
values.update(x => ({
|
||||
...x,
|
||||
[storageTypeField]: 'archive',
|
||||
[archiveFolderField]: `import-${moment().format('YYYY-MM-DD-hh-mm-ss')}`,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<FormSelectField
|
||||
options={types.filter(x => x.directions.includes(direction))}
|
||||
name={storageTypeField}
|
||||
@@ -153,4 +193,8 @@
|
||||
margin-bottom: 3px;
|
||||
color: var(--theme-font-3);
|
||||
}
|
||||
|
||||
.buttons {
|
||||
margin-left: var(--dim-large-form-margin);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user