mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 07:46:00 +00:00
81 lines
1.7 KiB
TypeScript
81 lines
1.7 KiB
TypeScript
export function matchDatabaseObjectAppObject(obj1, obj2) {
|
|
return (
|
|
obj1?.objectTypeField == obj2?.objectTypeField &&
|
|
obj1?.conid == obj2?.conid &&
|
|
obj1?.database == obj2?.database &&
|
|
obj1?.pureName == obj2?.pureName &&
|
|
obj1?.schemaName == obj2?.schemaName
|
|
);
|
|
}
|
|
|
|
function getTableLikeActions(dataTab) {
|
|
return [
|
|
{
|
|
label: 'Open data',
|
|
tab: dataTab,
|
|
defaultActionId: 'openTable',
|
|
},
|
|
// {
|
|
// label: 'Open form',
|
|
// tab: dataTab,
|
|
// initialData: {
|
|
// grid: {
|
|
// isFormView: true,
|
|
// },
|
|
// },
|
|
// defaultActionId: 'openForm',
|
|
// },
|
|
{
|
|
label: 'Open structure',
|
|
tab: 'TableStructureTab',
|
|
icon: 'img table-structure',
|
|
defaultActionId: 'openStructure',
|
|
},
|
|
{
|
|
label: 'Show SQL',
|
|
tab: 'SqlObjectTab',
|
|
defaultActionId: 'showSql',
|
|
icon: 'img sql-file',
|
|
},
|
|
];
|
|
}
|
|
|
|
export const defaultDatabaseObjectAppObjectActions = {
|
|
tables: getTableLikeActions('TableDataTab'),
|
|
views: getTableLikeActions('ViewDataTab'),
|
|
matviews: getTableLikeActions('ViewDataTab'),
|
|
procedures: [
|
|
{
|
|
label: 'Show SQL',
|
|
tab: 'SqlObjectTab',
|
|
defaultActionId: 'showSql',
|
|
icon: 'img sql-file',
|
|
},
|
|
],
|
|
functions: [
|
|
{
|
|
label: 'Show SQL',
|
|
tab: 'SqlObjectTab',
|
|
defaultActionId: 'showSql',
|
|
icon: 'img sql-file',
|
|
},
|
|
],
|
|
collections: [
|
|
{
|
|
label: 'Open data',
|
|
tab: 'CollectionDataTab',
|
|
defaultActionId: 'openTable',
|
|
},
|
|
{
|
|
label: 'Open JSON',
|
|
tab: 'CollectionDataTab',
|
|
defaultActionId: 'openJson',
|
|
initialData: {
|
|
grid: {
|
|
isJsonView: true,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
};
|