mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 12:35:59 +00:00
compare model functions
This commit is contained in:
@@ -61,12 +61,37 @@
|
||||
showSnackbarSuccess(`Saved to archive ${resp.data.archiveFolder}`);
|
||||
};
|
||||
|
||||
const handleCompareWithCurrentDb = () => {
|
||||
openNewTab(
|
||||
{
|
||||
title: 'Compare',
|
||||
icon: 'img compare',
|
||||
tabComponent: 'CompareModelTab',
|
||||
},
|
||||
{
|
||||
editor: {
|
||||
sourceConid: _.get($currentDatabase, 'connection._id'),
|
||||
sourceDatabase: _.get($currentDatabase, 'name'),
|
||||
targetConid: _.get(connection, '_id'),
|
||||
targetDatabase: name,
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
return [
|
||||
{ onClick: handleNewQuery, text: 'New query', isNewQuery: true },
|
||||
{ onClick: handleImport, text: 'Import' },
|
||||
{ onClick: handleExport, text: 'Export' },
|
||||
{ onClick: handleSqlGenerator, text: 'SQL Generator' },
|
||||
{ onClick: handleExportModel, text: 'Export DB model' },
|
||||
_.get($currentDatabase, 'connection._id') &&
|
||||
(_.get($currentDatabase, 'connection._id') != _.get(connection, '_id') ||
|
||||
(_.get($currentDatabase, 'connection._id') == _.get(connection, '_id') &&
|
||||
_.get($currentDatabase, 'name') != _.get(connection, 'name'))) && {
|
||||
onClick: handleCompareWithCurrentDb,
|
||||
text: `Compare with ${_.get($currentDatabase, 'name')}`,
|
||||
},
|
||||
|
||||
_.get($currentDatabase, 'connection._id') == _.get(connection, '_id') &&
|
||||
_.get($currentDatabase, 'name') == name && { onClick: handleDisconnect, text: 'Disconnect' },
|
||||
|
||||
Reference in New Issue
Block a user