mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
portal connection fix
This commit is contained in:
parent
0906bad235
commit
3df2e1a445
9
packages/api/env/portal/.env
vendored
9
packages/api/env/portal/.env
vendored
@ -1,6 +1,6 @@
|
|||||||
DEVMODE=1
|
DEVMODE=1
|
||||||
|
|
||||||
CONNECTIONS=mysql,postgres,mongo,mongo2,mysqlssh,sqlite
|
CONNECTIONS=mysql,postgres,mongo,mongo2,mysqlssh,sqlite,relational
|
||||||
|
|
||||||
LABEL_mysql=MySql localhost
|
LABEL_mysql=MySql localhost
|
||||||
SERVER_mysql=localhost
|
SERVER_mysql=localhost
|
||||||
@ -41,4 +41,11 @@ LABEL_sqlite=sqlite
|
|||||||
FILE_sqlite=/home/jena/.dbgate/files/sqlite/feeds.sqlite
|
FILE_sqlite=/home/jena/.dbgate/files/sqlite/feeds.sqlite
|
||||||
ENGINE_sqlite=sqlite@dbgate-plugin-sqlite
|
ENGINE_sqlite=sqlite@dbgate-plugin-sqlite
|
||||||
|
|
||||||
|
LABEL_relational=Relational dataset repo
|
||||||
|
SERVER_relational=relational.fit.cvut.cz
|
||||||
|
USER_relational=guest
|
||||||
|
PASSWORD_relational=relational
|
||||||
|
ENGINE_relational=mariadb@dbgate-plugin-mysql
|
||||||
|
READONLY_relational=1
|
||||||
|
|
||||||
# docker run -p 3000:3000 -e CONNECTIONS=mongo -e URL_mongo=mongodb://localhost:27017 -e ENGINE_mongo=mongo@dbgate-plugin-mongo -e LABEL_mongo=mongo dbgate/dbgate:beta
|
# docker run -p 3000:3000 -e CONNECTIONS=mongo -e URL_mongo=mongodb://localhost:27017 -e ENGINE_mongo=mongo@dbgate-plugin-mongo -e LABEL_mongo=mongo dbgate/dbgate:beta
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
return filterName(filter, ...databases.map(x => x.name));
|
return filterName(filter, ...databases.map(x => x.name));
|
||||||
};
|
};
|
||||||
export function openConnection(connection) {
|
export function openConnection(connection) {
|
||||||
|
const config = getCurrentConfig();
|
||||||
if (connection.singleDatabase) {
|
if (connection.singleDatabase) {
|
||||||
currentDatabase.set({ connection, name: connection.defaultDatabase });
|
currentDatabase.set({ connection, name: connection.defaultDatabase });
|
||||||
apiCall('database-connections/refresh', {
|
apiCall('database-connections/refresh', {
|
||||||
@ -26,8 +27,10 @@
|
|||||||
conid: connection._id,
|
conid: connection._id,
|
||||||
keepOpen: true,
|
keepOpen: true,
|
||||||
});
|
});
|
||||||
|
if (!config.runAsPortal) {
|
||||||
expandedConnections.update(x => _.uniq([...x, connection._id]));
|
expandedConnections.update(x => _.uniq([...x, connection._id]));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
closeMultipleTabs(x => x.tabComponent == 'ConnectionTab' && x.props?.conid == connection._id, true);
|
closeMultipleTabs(x => x.tabComponent == 'ConnectionTab' && x.props?.conid == connection._id, true);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -64,8 +64,9 @@
|
|||||||
{filter}
|
{filter}
|
||||||
passProps={{ connectionColorFactory: $connectionColorFactory, showPinnedInsteadOfUnpin: true }}
|
passProps={{ connectionColorFactory: $connectionColorFactory, showPinnedInsteadOfUnpin: true }}
|
||||||
getIsExpanded={data => $expandedConnections.includes(data._id) && !data.singleDatabase}
|
getIsExpanded={data => $expandedConnections.includes(data._id) && !data.singleDatabase}
|
||||||
setIsExpanded={(data, value) =>
|
setIsExpanded={(data, value) => {
|
||||||
expandedConnections.update(old => (value ? [...old, data._id] : old.filter(x => x != data._id)))}
|
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)}
|
{#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
|
<LargeButton icon="icon new-connection" on:click={() => runCommand('new.connection')} fillHorizontal
|
||||||
|
Loading…
Reference in New Issue
Block a user