mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
mongo profile view - shows collection tab
This commit is contained in:
parent
11daa56335
commit
c1ba758b01
@ -254,7 +254,6 @@
|
|||||||
text: 'Create database',
|
text: 'Create database',
|
||||||
onClick: handleCreateDatabase,
|
onClick: handleCreateDatabase,
|
||||||
},
|
},
|
||||||
$openedConnections.includes(data._id) &&
|
|
||||||
driver?.supportsServerSummary && {
|
driver?.supportsServerSummary && {
|
||||||
text: 'Server summary',
|
text: 'Server summary',
|
||||||
onClick: handleServerSummary,
|
onClick: handleServerSummary,
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function runAction(action, row) {
|
async function runAction(action, row) {
|
||||||
const { command, openQuery } = action;
|
const { command, openQuery, openTab, addDbProps } = action;
|
||||||
if (command) {
|
if (command) {
|
||||||
await apiCall('server-connections/summary-command', { conid, refreshToken, command, row });
|
await apiCall('server-connections/summary-command', { conid, refreshToken, command, row });
|
||||||
refresh();
|
refresh();
|
||||||
@ -55,6 +55,20 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (openTab) {
|
||||||
|
const props = {};
|
||||||
|
if (addDbProps) {
|
||||||
|
props['conid'] = conid;
|
||||||
|
props['database'] = row.name;
|
||||||
|
}
|
||||||
|
openNewTab({
|
||||||
|
...openTab,
|
||||||
|
props: {
|
||||||
|
...openTab.props,
|
||||||
|
...props,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -77,7 +91,7 @@
|
|||||||
<svelte:fragment slot="2" let:row let:col>
|
<svelte:fragment slot="2" let:row let:col>
|
||||||
{#each col.actions as action, index}
|
{#each col.actions as action, index}
|
||||||
{#if index > 0}
|
{#if index > 0}
|
||||||
<span> | </span>
|
<span class="action-separator">|</span>
|
||||||
{/if}
|
{/if}
|
||||||
<Link onClick={() => runAction(action, row)}>{action.header}</Link>
|
<Link onClick={() => runAction(action, row)}>{action.header}</Link>
|
||||||
{/each}
|
{/each}
|
||||||
@ -101,4 +115,8 @@
|
|||||||
background-color: var(--theme-bg-0);
|
background-color: var(--theme-bg-0);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.action-separator {
|
||||||
|
margin: 0 5px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -417,10 +417,22 @@ const driver = {
|
|||||||
header: 'All',
|
header: 'All',
|
||||||
command: 'profileAll',
|
command: 'profileAll',
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// header: 'View',
|
||||||
|
// openQuery: "db['system.profile'].find()",
|
||||||
|
// tabTitle: 'Profile data',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
header: 'View',
|
header: 'View',
|
||||||
openQuery: "db['system.profile'].find()",
|
openTab: {
|
||||||
tabTitle: 'Profile data',
|
title: 'system.profile',
|
||||||
|
icon: 'img collection',
|
||||||
|
tabComponent: 'CollectionDataTab',
|
||||||
|
props: {
|
||||||
|
pureName: 'system.profile',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
addDbProps: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user