mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
renamed singleDatabase => singleDbConnection
This commit is contained in:
parent
54278f6276
commit
bbb6c5e5f5
1
packages/api/env/dblogin/.env
vendored
1
packages/api/env/dblogin/.env
vendored
@ -2,6 +2,7 @@ DEVMODE=1
|
||||
|
||||
CONNECTIONS=mysql
|
||||
SINGLE_CONNECTION=mysql
|
||||
# SINGLE_DATABASE=Chinook
|
||||
|
||||
LABEL_mysql=MySql localhost
|
||||
SERVER_mysql=localhost
|
||||
|
4
packages/api/env/singledb/.env
vendored
4
packages/api/env/singledb/.env
vendored
@ -5,8 +5,8 @@ CONNECTIONS=mysql
|
||||
LABEL_mysql=MySql localhost
|
||||
SERVER_mysql=localhost
|
||||
USER_mysql=root
|
||||
PASSWORD_mysql=test
|
||||
PORT_mysql=3307
|
||||
PASSWORD_mysql=Pwd2020Db
|
||||
PORT_mysql=3306
|
||||
ENGINE_mysql=mysql@dbgate-plugin-mysql
|
||||
DBCONFIG_mysql=[{"name":"Chinook","connectionColor":"cyan"}]
|
||||
|
||||
|
@ -38,7 +38,7 @@ module.exports = {
|
||||
|
||||
return {
|
||||
runAsPortal: !!connections.portalConnections,
|
||||
singleDatabase: connections.singleDatabase,
|
||||
singleDbConnection: connections.singleDbConnection,
|
||||
singleConnection: connections.singleConnection,
|
||||
// hideAppEditor: !!process.env.HIDE_APP_EDITOR,
|
||||
allowShellConnection: platformInfo.allowShellConnection,
|
||||
|
@ -133,7 +133,7 @@ function getPortalCollections() {
|
||||
|
||||
const portalConnections = getPortalCollections();
|
||||
|
||||
function getSingleDatabase() {
|
||||
function getSingleDbConnection() {
|
||||
if (process.env.SINGLE_CONNECTION && process.env.SINGLE_DATABASE) {
|
||||
// @ts-ignore
|
||||
const connection = portalConnections.find(x => x._id == process.env.SINGLE_CONNECTION);
|
||||
@ -158,7 +158,7 @@ function getSingleDatabase() {
|
||||
}
|
||||
|
||||
function getSingleConnection() {
|
||||
if (getSingleDatabase()) return null;
|
||||
if (getSingleDbConnection()) return null;
|
||||
if (process.env.SINGLE_CONNECTION) {
|
||||
// @ts-ignore
|
||||
const connection = portalConnections.find(x => x._id == process.env.SINGLE_CONNECTION);
|
||||
@ -174,13 +174,13 @@ function getSingleConnection() {
|
||||
return null;
|
||||
}
|
||||
|
||||
const singleDatabase = getSingleDatabase();
|
||||
const singleDbConnection = getSingleDbConnection();
|
||||
const singleConnection = getSingleConnection();
|
||||
|
||||
module.exports = {
|
||||
datastore: null,
|
||||
opened: [],
|
||||
singleDatabase,
|
||||
singleDbConnection,
|
||||
singleConnection,
|
||||
portalConnections,
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
for (const connection of connectionList || []) {
|
||||
const conid = connection._id;
|
||||
if (connection.singleDatabase) continue;
|
||||
if (getCurrentConfig()?.singleDatabase) continue;
|
||||
if (getCurrentConfig()?.singleDbConnection) continue;
|
||||
const databases = getLocalStorage(`database_list_${conid}`) || [];
|
||||
for (const db of databases) {
|
||||
databaseList.push({
|
||||
|
@ -246,8 +246,8 @@ export function subscribeApiDependendStores() {
|
||||
useConfig().subscribe(value => {
|
||||
currentConfigValue = value;
|
||||
invalidateCommands();
|
||||
if (value.singleDatabase) {
|
||||
currentDatabase.set(value.singleDatabase);
|
||||
if (value.singleDbConnection) {
|
||||
currentDatabase.set(value.singleDbConnection);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -21,10 +21,12 @@
|
||||
$: config = useConfig();
|
||||
$: singleDatabase = $currentDatabase?.connection?.singleDatabase;
|
||||
$: database = $currentDatabase?.name;
|
||||
|
||||
$: console.log('CFG', $config);
|
||||
</script>
|
||||
|
||||
<WidgetColumnBar {hidden}>
|
||||
{#if !$config?.singleDatabase}
|
||||
{#if !$config?.singleDbConnection}
|
||||
<WidgetColumnBarItem title="Connections" name="connections" height="35%" storageName="connectionsWidget">
|
||||
<ConnectionList />
|
||||
</WidgetColumnBarItem>
|
||||
|
Loading…
Reference in New Issue
Block a user