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',
|
'installedPluginsWidget',
|
||||||
'allPluginsWidget',
|
'allPluginsWidget',
|
||||||
|
|
||||||
|
'currentArchive',
|
||||||
];
|
];
|
||||||
for (const key of keys) removeLocalStorage(key);
|
for (const key of keys) removeLocalStorage(key);
|
||||||
showSnackbarSuccess('Restart DbGate (or reload on web) for applying changes');
|
showSnackbarSuccess('Restart DbGate (or reload on web) for applying changes');
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import FormStyledButton from '../elements/FormStyledButton.svelte';
|
||||||
import FormArchiveFilesSelect from '../forms/FormArchiveFilesSelect.svelte';
|
import FormArchiveFilesSelect from '../forms/FormArchiveFilesSelect.svelte';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
import FormArchiveFolderSelect from '../forms/FormArchiveFolderSelect.svelte';
|
import FormArchiveFolderSelect from '../forms/FormArchiveFolderSelect.svelte';
|
||||||
import FormArgumentList from '../forms/FormArgumentList.svelte';
|
import FormArgumentList from '../forms/FormArgumentList.svelte';
|
||||||
@ -11,7 +13,7 @@
|
|||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
import { findFileFormat, getFileFormatDirections } from '../plugins/fileformats';
|
import { findFileFormat, getFileFormatDirections } from '../plugins/fileformats';
|
||||||
import SqlEditor from '../query/SqlEditor.svelte';
|
import SqlEditor from '../query/SqlEditor.svelte';
|
||||||
import { extensions } from '../stores';
|
import { currentArchive, currentDatabase, extensions } from '../stores';
|
||||||
import { useArchiveFiles, useDatabaseInfo } from '../utility/metadataLoaders';
|
import { useArchiveFiles, useDatabaseInfo } from '../utility/metadataLoaders';
|
||||||
import FilesInput from './FilesInput.svelte';
|
import FilesInput from './FilesInput.svelte';
|
||||||
import FormConnectionSelect from './FormConnectionSelect.svelte';
|
import FormConnectionSelect from './FormConnectionSelect.svelte';
|
||||||
@ -64,6 +66,44 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/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
|
<FormSelectField
|
||||||
options={types.filter(x => x.directions.includes(direction))}
|
options={types.filter(x => x.directions.includes(direction))}
|
||||||
name={storageTypeField}
|
name={storageTypeField}
|
||||||
@ -153,4 +193,8 @@
|
|||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
color: var(--theme-font-3);
|
color: var(--theme-font-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
margin-left: var(--dim-large-form-margin);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -61,7 +61,7 @@ export const currentDropDownMenu = writable(null);
|
|||||||
export const openedModals = writable([]);
|
export const openedModals = writable([]);
|
||||||
export const openedSnackbars = writable([]);
|
export const openedSnackbars = writable([]);
|
||||||
export const nullStore = readable(null, () => {});
|
export const nullStore = readable(null, () => {});
|
||||||
export const currentArchive = writable('default');
|
export const currentArchive = writableWithStorage('default', 'currentArchive');
|
||||||
export const isFileDragActive = writable(false);
|
export const isFileDragActive = writable(false);
|
||||||
export const selectedCellsCallback = writable(null);
|
export const selectedCellsCallback = writable(null);
|
||||||
export const loadingPluginStore = writable({
|
export const loadingPluginStore = writable({
|
||||||
|
Loading…
Reference in New Issue
Block a user