mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 12:35:59 +00:00
Add copy/paste to query tab and database list
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" context="module">
|
||||
import {copyTextToClipboard} from "../utility/clipboard";
|
||||
|
||||
export const extractKey = props => props.name;
|
||||
|
||||
export function disconnectDatabaseConnection(conid, database, showConfirmation = true) {
|
||||
@@ -169,6 +171,10 @@
|
||||
);
|
||||
};
|
||||
|
||||
const handleCopyName = async () => {
|
||||
copyTextToClipboard(name);
|
||||
}
|
||||
|
||||
const handleDisconnect = () => {
|
||||
disconnectDatabaseConnection(connection._id, name);
|
||||
};
|
||||
@@ -295,6 +301,7 @@
|
||||
!connection.isReadOnly &&
|
||||
!connection.singleDatabase && { onClick: handleDropDatabase, text: 'Drop database' },
|
||||
{ divider: true },
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleCopyName, text: 'Copy database name' },
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleShowDiagram, text: 'Show diagram' },
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleSqlGenerator, text: 'SQL Generator' },
|
||||
driver?.supportsDatabaseProfiler && { onClick: handleDatabaseProfiler, text: 'Database profiler' },
|
||||
|
||||
Reference in New Issue
Block a user