mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 07:46:00 +00:00
query - saving to local storage
This commit is contained in:
8
packages/web/src/query/QueryToolbar.js
Normal file
8
packages/web/src/query/QueryToolbar.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import React from 'react'
|
||||
import ToolbarButton from '../widgets/ToolbarButton'
|
||||
|
||||
export default function QueryToolbar() {
|
||||
return <>
|
||||
<ToolbarButton onClick={()=>{}}>Execute</ToolbarButton>
|
||||
</>
|
||||
}
|
||||
@@ -1,19 +1,25 @@
|
||||
import { useSetOpenedTabs } from '../utility/globalState';
|
||||
import _ from 'lodash';
|
||||
import { useSetOpenedTabs, useCurrentDatabase } from '../utility/globalState';
|
||||
import { openNewTab } from '../utility/common';
|
||||
|
||||
export default function useNewQuery() {
|
||||
const setOpenedTabs = useSetOpenedTabs();
|
||||
const currentDatabase = useCurrentDatabase();
|
||||
|
||||
const connection = _.get(currentDatabase, 'connection') || {};
|
||||
const database = _.get(currentDatabase, 'name');
|
||||
|
||||
const tooltip = `${connection.displayName || connection.server}\n${database}`;
|
||||
|
||||
return () =>
|
||||
openNewTab(setOpenedTabs, {
|
||||
title: 'Query',
|
||||
icon: 'sql.svg',
|
||||
tooltip,
|
||||
tabComponent: 'QueryTab',
|
||||
// props: {
|
||||
// schemaName,
|
||||
// pureName,
|
||||
// conid,
|
||||
// database,
|
||||
// },
|
||||
props: {
|
||||
conid: connection._id,
|
||||
database,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user