mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
import table wizard
This commit is contained in:
parent
9e25a45090
commit
4c9ae46577
@ -71,6 +71,10 @@
|
||||
functionName: 'tableReader',
|
||||
isExport: true,
|
||||
},
|
||||
{
|
||||
label: 'Import',
|
||||
isImport: true,
|
||||
},
|
||||
{
|
||||
label: 'Open as data sheet',
|
||||
isOpenFreeTable: true,
|
||||
@ -615,6 +619,17 @@
|
||||
},
|
||||
engine: driver.engine,
|
||||
});
|
||||
} else if (menu.isImport) {
|
||||
const { conid, database } = data;
|
||||
showModal(ImportExportModal, {
|
||||
initialValues: {
|
||||
sourceStorageType: getDefaultFileFormat(getExtensions()).storageType,
|
||||
targetStorageType: 'database',
|
||||
targetConnectionId: conid,
|
||||
targetDatabaseName: database,
|
||||
fixedTargetPureName: data.pureName,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
openDatabaseObjectDetail(
|
||||
menu.tab,
|
||||
@ -661,6 +676,7 @@
|
||||
import InputTextModal from '../modals/InputTextModal.svelte';
|
||||
import { extractShellConnection } from '../impexp/createImpExpScript';
|
||||
import { format as dateFormat } from 'date-fns';
|
||||
import { getDefaultFileFormat } from '../plugins/fileformats';
|
||||
|
||||
export let data;
|
||||
export let passProps;
|
||||
|
@ -29,6 +29,12 @@
|
||||
if (preferedStorageType && preferedStorageType != values.sourceStorageType) {
|
||||
newValues['sourceStorageType'] = preferedStorageType;
|
||||
}
|
||||
for (const source of newSources) {
|
||||
if (values.fixedTargetPureName) {
|
||||
values[`targetName_${source}`] = values.fixedTargetPureName;
|
||||
values[`actionType_${source}`] = 'appendData';
|
||||
}
|
||||
}
|
||||
valuesStore.set({
|
||||
...values,
|
||||
...newValues,
|
||||
|
@ -15,6 +15,6 @@
|
||||
<SelectField
|
||||
{options}
|
||||
isNative
|
||||
value={values[`actionType_${name}`] || options[0].value}
|
||||
value={$values[`actionType_${name}`] || options[0].value}
|
||||
on:change={e => setFieldValue(`actionType_${name}`, e.detail)}
|
||||
/>
|
||||
|
@ -23,13 +23,13 @@
|
||||
onClick: () => getCurrentEditor().copyNodeScript(),
|
||||
});
|
||||
|
||||
// registerCommand({
|
||||
// id: 'shell.openWizard',
|
||||
// category: 'Shell',
|
||||
// name: 'Open wizard',
|
||||
// // testEnabled: () => getCurrentEditor()?.openWizardEnabled(),
|
||||
// onClick: () => getCurrentEditor().openWizard(),
|
||||
// });
|
||||
registerCommand({
|
||||
id: 'shell.openWizard',
|
||||
category: 'Shell',
|
||||
name: 'Open wizard',
|
||||
// testEnabled: () => getCurrentEditor()?.openWizardEnabled(),
|
||||
onClick: () => getCurrentEditor().openWizard(),
|
||||
});
|
||||
|
||||
const configRegex = /\s*\/\/\s*@ImportExportConfigurator\s*\n\s*\/\/\s*(\{[^\n]+\})\n/;
|
||||
const requireRegex = /\s*(\/\/\s*@require\s+[^\n]+)\n/g;
|
||||
|
Loading…
Reference in New Issue
Block a user