mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 11:26:00 +00:00
quick exports - basic skeleton working
This commit is contained in:
@@ -47,15 +47,15 @@
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
electron && {
|
||||
label: 'Quick export',
|
||||
isQuickExport: true,
|
||||
functionName: 'tableReader',
|
||||
},
|
||||
{
|
||||
label: 'Export',
|
||||
isExport: true,
|
||||
},
|
||||
// electron &&
|
||||
{
|
||||
label: 'Quick export',
|
||||
isQuickExport: true,
|
||||
},
|
||||
{
|
||||
label: 'Open in free table editor',
|
||||
isOpenFreeTable: true,
|
||||
@@ -114,14 +114,14 @@
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
label: 'Export',
|
||||
isExport: true,
|
||||
},
|
||||
electron && {
|
||||
label: 'Quick export',
|
||||
isQuickExport: true,
|
||||
},
|
||||
{
|
||||
label: 'Export',
|
||||
isExport: true,
|
||||
},
|
||||
{
|
||||
label: 'Open in free table editor',
|
||||
isOpenFreeTable: true,
|
||||
@@ -175,14 +175,14 @@
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
label: 'Export',
|
||||
isExport: true,
|
||||
},
|
||||
electron && {
|
||||
label: 'Quick export',
|
||||
isQuickExport: true,
|
||||
},
|
||||
{
|
||||
label: 'Export',
|
||||
isExport: true,
|
||||
},
|
||||
{
|
||||
label: 'Open in free table editor',
|
||||
isOpenFreeTable: true,
|
||||
@@ -275,14 +275,14 @@
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Export',
|
||||
isExport: true,
|
||||
},
|
||||
electron && {
|
||||
label: 'Quick export',
|
||||
isQuickExport: true,
|
||||
},
|
||||
{
|
||||
label: 'Export',
|
||||
isExport: true,
|
||||
},
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
@@ -399,16 +399,26 @@
|
||||
if (menu.isQuickExport) {
|
||||
return {
|
||||
text: menu.label,
|
||||
submenu: [
|
||||
{
|
||||
text: 'CSV file',
|
||||
isQuickExport: true,
|
||||
submenu: $extensions.quickExports.map(fmt => ({
|
||||
text: fmt.label,
|
||||
onClick: async () => {
|
||||
const coninfo = await getConnectionInfo(data);
|
||||
exportElectronFile(
|
||||
data.pureName,
|
||||
{
|
||||
functionName: menu.functionName,
|
||||
props: {
|
||||
connection: {
|
||||
..._.omit(coninfo, ['_id', 'displayName']),
|
||||
..._.pick(data, ['database']),
|
||||
},
|
||||
..._.pick(data, ['pureName', 'schemaName']),
|
||||
},
|
||||
},
|
||||
fmt
|
||||
);
|
||||
},
|
||||
{
|
||||
text: 'Excel',
|
||||
isQuickExport: true,
|
||||
},
|
||||
],
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -425,8 +435,6 @@
|
||||
sourceList: [data.pureName],
|
||||
},
|
||||
});
|
||||
} else if (menu.isQuickExport) {
|
||||
exportElectronFile(data);
|
||||
} else if (menu.isOpenFreeTable) {
|
||||
const coninfo = await getConnectionInfo(data);
|
||||
openNewTab({
|
||||
@@ -511,6 +519,7 @@
|
||||
|
||||
<AppObjectCore
|
||||
{...$$restProps}
|
||||
module={$$props.module}
|
||||
{data}
|
||||
title={data.schemaName ? `${data.schemaName}.${data.pureName}` : data.pureName}
|
||||
icon={icons[data.objectTypeField]}
|
||||
|
||||
Reference in New Issue
Block a user