mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 15:13:57 +00:00
MPR advanced exports
This commit is contained in:
@@ -468,12 +468,14 @@ await dbgateApi.executeQuery(${JSON.stringify(
|
|||||||
|
|
||||||
{ divider: true },
|
{ divider: true },
|
||||||
isSqlOrDoc &&
|
isSqlOrDoc &&
|
||||||
|
isProApp() &&
|
||||||
!connection.isReadOnly &&
|
!connection.isReadOnly &&
|
||||||
hasPermission(`dbops/import`) && {
|
hasPermission(`dbops/import`) && {
|
||||||
onClick: handleImport,
|
onClick: handleImport,
|
||||||
text: _t('database.import', { defaultMessage: 'Import' }),
|
text: _t('database.import', { defaultMessage: 'Import' }),
|
||||||
},
|
},
|
||||||
isSqlOrDoc &&
|
isSqlOrDoc &&
|
||||||
|
isProApp() &&
|
||||||
hasPermission(`dbops/export`) && {
|
hasPermission(`dbops/export`) && {
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
text: _t('database.export', { defaultMessage: 'Export' }),
|
text: _t('database.export', { defaultMessage: 'Export' }),
|
||||||
|
|||||||
@@ -689,7 +689,7 @@ registerCommand({
|
|||||||
name: 'Export database',
|
name: 'Export database',
|
||||||
toolbar: true,
|
toolbar: true,
|
||||||
icon: 'icon export',
|
icon: 'icon export',
|
||||||
testEnabled: () => getCurrentDatabase() != null && hasPermission(`dbops/export`),
|
testEnabled: () => getCurrentDatabase() != null && hasPermission(`dbops/export`) && isProApp(),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
openImportExportTab({
|
openImportExportTab({
|
||||||
targetStorageType: getDefaultFileFormat(getExtensions()).storageType,
|
targetStorageType: getDefaultFileFormat(getExtensions()).storageType,
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
title: 'Export database',
|
title: 'Export database',
|
||||||
description: 'Export to file like CSV, JSON, Excel, or other DB',
|
description: 'Export to file like CSV, JSON, Excel, or other DB',
|
||||||
command: 'database.export',
|
command: 'database.export',
|
||||||
|
isProFeature: true,
|
||||||
testid: 'NewObjectModal_databaseExport',
|
testid: 'NewObjectModal_databaseExport',
|
||||||
disabledMessage: 'Export is not available for current database',
|
disabledMessage: 'Export is not available for current database',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import type { QuickExportDefinition } from 'dbgate-types';
|
import type { QuickExportDefinition } from 'dbgate-types';
|
||||||
import { currentArchive, getCurrentArchive, getExtensions } from '../stores';
|
import { currentArchive, getCurrentArchive, getExtensions } from '../stores';
|
||||||
import hasPermission from './hasPermission';
|
import hasPermission from './hasPermission';
|
||||||
|
import { isProApp } from './proTools';
|
||||||
|
|
||||||
export function createQuickExportMenuItems(handler: (fmt: QuickExportDefinition) => Function, advancedExportMenuItem) {
|
export function createQuickExportMenuItems(handler: (fmt: QuickExportDefinition) => Function, advancedExportMenuItem) {
|
||||||
const extensions = getExtensions();
|
const extensions = getExtensions();
|
||||||
return [
|
return [
|
||||||
{
|
isProApp() && {
|
||||||
text: 'Export advanced...',
|
text: 'Export advanced...',
|
||||||
...advancedExportMenuItem,
|
...advancedExportMenuItem,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user