mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 08:03:58 +00:00
view profile data
This commit is contained in:
@@ -5,14 +5,30 @@
|
|||||||
import ObjectListControl from '../elements/ObjectListControl.svelte';
|
import ObjectListControl from '../elements/ObjectListControl.svelte';
|
||||||
import { apiCall } from '../utility/api';
|
import { apiCall } from '../utility/api';
|
||||||
import formatFileSize from '../utility/formatFileSize';
|
import formatFileSize from '../utility/formatFileSize';
|
||||||
|
import openNewTab from '../utility/openNewTab';
|
||||||
|
|
||||||
export let conid;
|
export let conid;
|
||||||
|
|
||||||
let refreshToken = 0;
|
let refreshToken = 0;
|
||||||
|
|
||||||
async function callAction(command, row) {
|
async function runAction(action, row) {
|
||||||
await apiCall('server-connections/summary-command', { conid, refreshToken, command, row });
|
const { command, openQuery } = action;
|
||||||
refreshToken += 1;
|
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>
|
</script>
|
||||||
|
|
||||||
@@ -36,7 +52,7 @@
|
|||||||
{#if index > 0}
|
{#if index > 0}
|
||||||
<span> | </span>
|
<span> | </span>
|
||||||
{/if}
|
{/if}
|
||||||
<Link onClick={() => callAction(action.command, row)}>{action.header}</Link>
|
<Link onClick={() => runAction(action, row)}>{action.header}</Link>
|
||||||
{/each}
|
{/each}
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</ObjectListControl>
|
</ObjectListControl>
|
||||||
|
|||||||
@@ -403,6 +403,7 @@ const driver = {
|
|||||||
{
|
{
|
||||||
fieldName: 'setProfile',
|
fieldName: 'setProfile',
|
||||||
columnType: 'actions',
|
columnType: 'actions',
|
||||||
|
header: 'Profiling actions',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
header: 'Off',
|
header: 'Off',
|
||||||
@@ -416,6 +417,11 @@ const driver = {
|
|||||||
header: 'All',
|
header: 'All',
|
||||||
command: 'profileAll',
|
command: 'profileAll',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
header: 'View',
|
||||||
|
openQuery: "db['system.profile'].find()",
|
||||||
|
tabTitle: 'Profile data',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user