mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
view profile data
This commit is contained in:
parent
61dc9da3f0
commit
ea77b4fc1a
@ -5,14 +5,30 @@
|
||||
import ObjectListControl from '../elements/ObjectListControl.svelte';
|
||||
import { apiCall } from '../utility/api';
|
||||
import formatFileSize from '../utility/formatFileSize';
|
||||
import openNewTab from '../utility/openNewTab';
|
||||
|
||||
export let conid;
|
||||
|
||||
let refreshToken = 0;
|
||||
|
||||
async function callAction(command, row) {
|
||||
await apiCall('server-connections/summary-command', { conid, refreshToken, command, row });
|
||||
refreshToken += 1;
|
||||
async function runAction(action, row) {
|
||||
const { command, openQuery } = action;
|
||||
if (command) {
|
||||
await apiCall('server-connections/summary-command', { conid, refreshToken, command, row });
|
||||
refreshToken += 1;
|
||||
}
|
||||
if (openQuery) {
|
||||
openNewTab({
|
||||
title: action.tabTitle || row.name,
|
||||
icon: 'img query-data',
|
||||
tabComponent: 'QueryDataTab',
|
||||
props: {
|
||||
conid,
|
||||
database: row.name,
|
||||
sql: openQuery,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -36,7 +52,7 @@
|
||||
{#if index > 0}
|
||||
<span> | </span>
|
||||
{/if}
|
||||
<Link onClick={() => callAction(action.command, row)}>{action.header}</Link>
|
||||
<Link onClick={() => runAction(action, row)}>{action.header}</Link>
|
||||
{/each}
|
||||
</svelte:fragment>
|
||||
</ObjectListControl>
|
||||
|
@ -403,6 +403,7 @@ const driver = {
|
||||
{
|
||||
fieldName: 'setProfile',
|
||||
columnType: 'actions',
|
||||
header: 'Profiling actions',
|
||||
actions: [
|
||||
{
|
||||
header: 'Off',
|
||||
@ -416,6 +417,11 @@ const driver = {
|
||||
header: 'All',
|
||||
command: 'profileAll',
|
||||
},
|
||||
{
|
||||
header: 'View',
|
||||
openQuery: "db['system.profile'].find()",
|
||||
tabTitle: 'Profile data',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user