mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 14:46:01 +00:00
tabs drop down menu
This commit is contained in:
@@ -102,12 +102,36 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const tabContextMenu = tabid => () => [
|
const tabContextMenu = (tabid, props) => () => {
|
||||||
{
|
const { conid, database } = props || {};
|
||||||
text: 'Close',
|
const res = [
|
||||||
onClick: () => closeTab(tabid),
|
{
|
||||||
},
|
text: 'Close',
|
||||||
];
|
onClick: () => closeTab(tabid),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Close all',
|
||||||
|
onClick: closeAll,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Close others',
|
||||||
|
onClick: () => closeOthers(tabid),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
if (conid && database) {
|
||||||
|
res.push(
|
||||||
|
{
|
||||||
|
text: `Close with same DB - ${database}`,
|
||||||
|
onClick: () => closeWithSameDb(tabid),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: `Close with other DB than ${database}`,
|
||||||
|
onClick: () => closeWithOtherDb(tabid),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#each dbKeys as dbKey}
|
{#each dbKeys as dbKey}
|
||||||
@@ -123,7 +147,7 @@
|
|||||||
class:selected={tab.selected}
|
class:selected={tab.selected}
|
||||||
on:click={e => handleTabClick(e, tab.tabid)}
|
on:click={e => handleTabClick(e, tab.tabid)}
|
||||||
on:mouseup={e => handleMouseUp(e, tab.tabid)}
|
on:mouseup={e => handleMouseUp(e, tab.tabid)}
|
||||||
use:contextMenu={tabContextMenu(tab.tabid)}
|
use:contextMenu={tabContextMenu(tab.tabid, tab.props)}
|
||||||
>
|
>
|
||||||
<FontIcon icon={tab.busy ? 'icon loading' : tab.icon} />
|
<FontIcon icon={tab.busy ? 'icon loading' : tab.icon} />
|
||||||
<span class="file-name">
|
<span class="file-name">
|
||||||
|
|||||||
Reference in New Issue
Block a user