mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 08:56:00 +00:00
open data files using open dialog in electron + drag & drop in electron without uploading
This commit is contained in:
@@ -411,7 +411,11 @@ function SourceName({ name }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default function ImportExportConfigurator({ uploadedFile = undefined, onChangePreview = undefined }) {
|
||||
export default function ImportExportConfigurator({
|
||||
uploadedFile = undefined,
|
||||
openedFile = undefined,
|
||||
onChangePreview = undefined,
|
||||
}) {
|
||||
const { values, setFieldValue, setValues } = useForm();
|
||||
const targetDbinfo = useDatabaseInfo({ conid: values.targetConnectionId, database: values.targetDatabaseName });
|
||||
const sourceConnectionInfo = useConnectionInfo({ conid: values.sourceConnectionId });
|
||||
@@ -453,6 +457,21 @@ export default function ImportExportConfigurator({ uploadedFile = undefined, onC
|
||||
if (uploadedFile) {
|
||||
handleUpload(uploadedFile);
|
||||
}
|
||||
if (openedFile) {
|
||||
addFilesToSourceList(
|
||||
extensions,
|
||||
[
|
||||
{
|
||||
fileName: openedFile.filePath,
|
||||
shortName: openedFile.shortName,
|
||||
},
|
||||
],
|
||||
values,
|
||||
setValues,
|
||||
!sourceList || sourceList.length == 0 ? openedFile.storageType : null,
|
||||
setPreviewSource
|
||||
);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const supportsPreview =
|
||||
|
||||
Reference in New Issue
Block a user