mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 19:26:00 +00:00
portal connection fix
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
return filterName(filter, ...databases.map(x => x.name));
|
||||
};
|
||||
export function openConnection(connection) {
|
||||
const config = getCurrentConfig();
|
||||
if (connection.singleDatabase) {
|
||||
currentDatabase.set({ connection, name: connection.defaultDatabase });
|
||||
apiCall('database-connections/refresh', {
|
||||
@@ -26,7 +27,9 @@
|
||||
conid: connection._id,
|
||||
keepOpen: true,
|
||||
});
|
||||
expandedConnections.update(x => _.uniq([...x, connection._id]));
|
||||
if (!config.runAsPortal) {
|
||||
expandedConnections.update(x => _.uniq([...x, connection._id]));
|
||||
}
|
||||
}
|
||||
closeMultipleTabs(x => x.tabComponent == 'ConnectionTab' && x.props?.conid == connection._id, true);
|
||||
}
|
||||
|
||||
@@ -64,8 +64,9 @@
|
||||
{filter}
|
||||
passProps={{ connectionColorFactory: $connectionColorFactory, showPinnedInsteadOfUnpin: true }}
|
||||
getIsExpanded={data => $expandedConnections.includes(data._id) && !data.singleDatabase}
|
||||
setIsExpanded={(data, value) =>
|
||||
expandedConnections.update(old => (value ? [...old, data._id] : old.filter(x => x != data._id)))}
|
||||
setIsExpanded={(data, value) => {
|
||||
expandedConnections.update(old => (value ? [...old, data._id] : old.filter(x => x != data._id)));
|
||||
}}
|
||||
/>
|
||||
{#if $connections && !$connections.find(x => !x.unsaved) && $openedConnections.length == 0 && $commandsCustomized['new.connection']?.enabled && !$openedTabs.find(x => !x.closedTime && x.tabComponent == 'ConnectionTab' && !x.props?.conid)}
|
||||
<LargeButton icon="icon new-connection" on:click={() => runCommand('new.connection')} fillHorizontal
|
||||
|
||||
Reference in New Issue
Block a user