mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
import sql dump
This commit is contained in:
parent
2c25669bc7
commit
ed0d63d135
@ -29,6 +29,7 @@
|
||||
import { getDatabaseList, useUsedApps } from '../utility/metadataLoaders';
|
||||
import { getLocalStorage } from '../utility/storageCache';
|
||||
import { apiCall } from '../utility/api';
|
||||
import ImportDatabaseDumpModal from '../modals/ImportDatabaseDumpModal.svelte';
|
||||
|
||||
export let data;
|
||||
export let passProps;
|
||||
@ -58,6 +59,12 @@
|
||||
}
|
||||
};
|
||||
|
||||
const handleSqlRestore = () => {
|
||||
showModal(ImportDatabaseDumpModal, {
|
||||
connection: data,
|
||||
});
|
||||
};
|
||||
|
||||
const getContextMenu = () => {
|
||||
const driver = $extensions.drivers.find(x => x.engine == data.engine);
|
||||
const config = getCurrentConfig();
|
||||
@ -158,6 +165,8 @@
|
||||
{ divider: true },
|
||||
getDatabaseMenuItems(data, data.defaultDatabase, $extensions, $currentDatabase, $apps),
|
||||
],
|
||||
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleSqlRestore, text: 'Restore/import SQL dump' },
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
export let onConfirm;
|
||||
|
||||
const handleSubmit = async e => {
|
||||
const handleSubmit = e => {
|
||||
onConfirm(e.detail.url);
|
||||
closeCurrentModal();
|
||||
};
|
||||
|
@ -1,13 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { onMount, tick } from 'svelte';
|
||||
|
||||
import FormStyledButton from '../buttons/FormStyledButton.svelte';
|
||||
import UploadButton from '../buttons/UploadButton.svelte';
|
||||
|
||||
import FormProvider from '../forms/FormProvider.svelte';
|
||||
import FormSubmit from '../forms/FormSubmit.svelte';
|
||||
import FormTextField from '../forms/FormTextField.svelte';
|
||||
import ElectronFilesInput from '../impexp/ElectronFilesInput.svelte';
|
||||
import { importSqlDump } from '../utility/exportFileTools';
|
||||
import getElectron from '../utility/getElectron';
|
||||
import { setUploadListener } from '../utility/uploadFiles';
|
||||
@ -23,7 +21,6 @@
|
||||
const handleSubmit = async values => {
|
||||
const { value } = values;
|
||||
closeCurrentModal();
|
||||
// onConfirm(value);
|
||||
importSqlDump(inputFile, connection);
|
||||
};
|
||||
|
||||
@ -42,13 +39,15 @@
|
||||
};
|
||||
});
|
||||
|
||||
const handleAddUrl = () =>
|
||||
const handleAddUrl = () => {
|
||||
showModal(ChangeDownloadUrlModal, {
|
||||
onConfirm: url => {
|
||||
onConfirm: async url => {
|
||||
await tick();
|
||||
inputLabel = url;
|
||||
inputFile = url;
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleBrowse = async () => {
|
||||
const electron = getElectron();
|
||||
|
Loading…
Reference in New Issue
Block a user