perspective: open table ctx menu

This commit is contained in:
Jan Prochazka
2022-08-06 14:05:18 +02:00
parent f77cc1023b
commit 090ffa064d
4 changed files with 59 additions and 8 deletions

View File

@@ -30,6 +30,7 @@
import PerspectiveHeaderControl from './PerspectiveHeaderControl.svelte';
import createRef from '../utility/createRef';
import { getPerspectiveNodeMenu } from './perspectiveMenu';
import openNewTab from '../utility/openNewTab';
const dbg = debug('dbgate:PerspectivaTable');
export const activator = createActivator('PerspectiveTable', true);
@@ -176,6 +177,28 @@
registerCloseHandler(() => {
td.classList.remove('highlight');
});
const pureName = td.getAttribute('data-pureName');
const schemaName = td.getAttribute('data-schemaName');
if (pureName) {
res.push({
text: `Open table ${pureName}`,
onClick: () => {
openNewTab({
title: pureName,
icon: 'img table',
tabComponent: 'TableDataTab',
props: {
schemaName,
pureName,
conid,
database,
objectTypeField: 'tables',
},
});
},
});
}
}
res.push([