mirror of
https://github.com/dbgate/dbgate
synced 2024-11-08 04:35:58 +00:00
import UX
This commit is contained in:
parent
bcf95d3872
commit
a96851b38f
@ -304,6 +304,8 @@ registerCommand({
|
||||
|
||||
'installedPluginsWidget',
|
||||
'allPluginsWidget',
|
||||
|
||||
'currentArchive',
|
||||
];
|
||||
for (const key of keys) removeLocalStorage(key);
|
||||
showSnackbarSuccess('Restart DbGate (or reload on web) for applying changes');
|
||||
|
@ -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>
|
||||
|
@ -61,7 +61,7 @@ export const currentDropDownMenu = writable(null);
|
||||
export const openedModals = writable([]);
|
||||
export const openedSnackbars = writable([]);
|
||||
export const nullStore = readable(null, () => {});
|
||||
export const currentArchive = writable('default');
|
||||
export const currentArchive = writableWithStorage('default', 'currentArchive');
|
||||
export const isFileDragActive = writable(false);
|
||||
export const selectedCellsCallback = writable(null);
|
||||
export const loadingPluginStore = writable({
|
||||
|
Loading…
Reference in New Issue
Block a user