mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 04:46:02 +00:00
tabs panel
This commit is contained in:
15
packages/web/src/utility/openNewTab.ts
Normal file
15
packages/web/src/utility/openNewTab.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import uuidv1 from 'uuid/v1';
|
||||
import { openedTabs } from '../stores';
|
||||
|
||||
export default async function openNewTab(newTab, initialData = undefined, options = undefined) {
|
||||
console.log('OPENING NEW TAB', newTab);
|
||||
const tabid = uuidv1();
|
||||
openedTabs.update(tabs => [
|
||||
...(tabs || []).map(x => ({ ...x, selected: false })),
|
||||
{
|
||||
tabid,
|
||||
selected: true,
|
||||
...newTab,
|
||||
},
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user