mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 19:36:00 +00:00
quick export from web
This commit is contained in:
@@ -1,30 +1,27 @@
|
||||
import { ExtensionsDirectory, QuickExportDefinition } from 'dbgate-types';
|
||||
import { getExtensions } from '../stores';
|
||||
import getElectron from './getElectron';
|
||||
|
||||
export function createQuickExportMenuItems(
|
||||
extensions: ExtensionsDirectory,
|
||||
handler: (fmt: QuickExportDefinition) => Function
|
||||
) {
|
||||
const electron = getElectron();
|
||||
if (!electron) {
|
||||
return null;
|
||||
}
|
||||
export function createQuickExportMenuItems(handler: (fmt: QuickExportDefinition) => Function) {
|
||||
// const electron = getElectron();
|
||||
// if (!electron) {
|
||||
// return null;
|
||||
// }
|
||||
const extensions = getExtensions();
|
||||
console.log('extensions', extensions);
|
||||
return extensions.quickExports.map(fmt => ({
|
||||
text: fmt.label,
|
||||
onClick: handler(fmt),
|
||||
}));
|
||||
}
|
||||
|
||||
export default function createQuickExportMenu(
|
||||
extensions: ExtensionsDirectory,
|
||||
handler: (fmt: QuickExportDefinition) => Function
|
||||
) {
|
||||
const electron = getElectron();
|
||||
if (!electron) {
|
||||
return { _skip: true };
|
||||
}
|
||||
export default function createQuickExportMenu(handler: (fmt: QuickExportDefinition) => Function) {
|
||||
// const electron = getElectron();
|
||||
// if (!electron) {
|
||||
// return { _skip: true };
|
||||
// }
|
||||
return {
|
||||
text: 'Quick export',
|
||||
submenu: createQuickExportMenuItems(extensions, handler),
|
||||
submenu: createQuickExportMenuItems(handler),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user