1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

Merge branch 'master' of https://github.com/antares-sql/antares into new-connection-management

This commit is contained in:
2022-07-04 17:25:37 +02:00
5 changed files with 54 additions and 7 deletions

View File

@ -512,7 +512,9 @@ const {
selectTab,
newTab,
removeTab,
updateTabs
updateTabs,
selectNextTab,
selectPrevTab
} = workspacesStore;
const props = defineProps({
@ -588,6 +590,22 @@ const onKey = (e: KeyboardEvent) => {
if (currentTab)
closeTab(currentTab);
}
// select next tab
if (e.altKey && (e.ctrlKey || e.metaKey) && e.key === 'ArrowRight')
selectNextTab({ uid: props.connection.uid });
// select prev tab
if (e.altKey && (e.ctrlKey || e.metaKey) && e.key === 'ArrowLeft')
selectPrevTab({ uid: props.connection.uid });
// select tab by index (range 1-9). CTRL|CMD number
if ((e.ctrlKey || e.metaKey) && !e.altKey && e.keyCode >= 49 && e.keyCode <= 57) {
const newIndex = parseInt(e.key) - 1;
if (workspace.value.tabs[newIndex])
selectTab({ uid: props.connection.uid, tab: workspace.value.tabs[newIndex].uid });
}
};
const openAsPermanentTab = (tab: WorkspaceTab) => {