diff --git a/packages/api/env/portal/.env b/packages/api/env/portal/.env index 774afaf96..f20c5264b 100644 --- a/packages/api/env/portal/.env +++ b/packages/api/env/portal/.env @@ -1,60 +1,47 @@ DEVMODE=1 -CONNECTIONS=mysql,postgres,postgres1,mongo,mongo2,mysqlssh,sqlite,relational +CONNECTIONS=mysql,postgres,mongo,redis,mssql,oracle -LABEL_mysql=MySql localhost -SERVER_mysql=localhost +LABEL_mysql=MySql +SERVER_mysql=dbgatedckstage1.sprinx.cz USER_mysql=root -PASSWORD_mysql=test -PORT_mysql=3307 +PASSWORD_mysql=Pwd2020Db +PORT_mysql=3306 ENGINE_mysql=mysql@dbgate-plugin-mysql -LABEL_postgres=Postgres localhost -SERVER_postgres=localhost +LABEL_postgres=Postgres +SERVER_postgres=dbgatedckstage1.sprinx.cz USER_postgres=postgres PASSWORD_postgres=Pwd2020Db PORT_postgres=5432 ENGINE_postgres=postgres@dbgate-plugin-postgres -LABEL_postgres1=Postgres localhost test DB -SERVER_postgres1=localhost -USER_postgres1=postgres -PASSWORD_postgres1=Pwd2020Db -PORT_postgres1=5432 -ENGINE_postgres1=postgres@dbgate-plugin-postgres -DATABASE_postgres1=test - -LABEL_mongo=Mongo URL -URL_mongo=mongodb://localhost:27017 +LABEL_mongo=Mongo +SERVER_mongo=dbgatedckstage1.sprinx.cz +USER_mongo=root +PASSWORD_mongo=Pwd2020Db +PORT_mongo=27017 ENGINE_mongo=mongo@dbgate-plugin-mongo -LABEL_mongo2=Mongo Server -SERVER_mongo2=localhost -ENGINE_mongo2=mongo@dbgate-plugin-mongo +LABEL_redis=Redis +SERVER_redis=dbgatedckstage1.sprinx.cz +ENGINE_redis=redis@dbgate-plugin-redis +PORT_redis=6379 -LABEL_mysqlssh=MySql SSH -SERVER_mysqlssh=localhost -USER_mysqlssh=root -PASSWORD_mysqlssh=xxx -PORT_mysqlssh=3316 -ENGINE_mysqlssh=mysql@dbgate-plugin-mysql -USE_SSH_mysqlssh=1 -SSH_HOST_mysqlssh=demo.dbgate.org -SSH_PORT_mysqlssh=22 -SSH_MODE_mysqlssh=userPassword -SSH_LOGIN_mysqlssh=root -SSH_PASSWORD_mysqlssh=xxx +LABEL_mssql=SQL Server +SERVER_mssql=dbgatedckstage1.sprinx.cz +USER_mssql=sa +PASSWORD_mssql=Pwd2020Db +PORT_mssql=1433 +ENGINE_mssql=mssql@dbgate-plugin-mssql -LABEL_sqlite=sqlite -FILE_sqlite=/home/jena/.dbgate/files/sqlite/feeds.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 +LABEL_oracle=Oracle +SERVER_oracle=dbgatedckstage1.sprinx.cz +USER_oracle=system +PASSWORD_oracle=Pwd2020Db +PORT_oracle=1521 +ENGINE_oracle=oracle@dbgate-plugin-oracle +SERVICE_NAME_oracle=xe # SETTINGS_dataGrid.showHintColumns=1 diff --git a/packages/web/src/appobj/ConnectionAppObject.svelte b/packages/web/src/appobj/ConnectionAppObject.svelte index 128840e55..c624d0bab 100644 --- a/packages/web/src/appobj/ConnectionAppObject.svelte +++ b/packages/web/src/appobj/ConnectionAppObject.svelte @@ -182,20 +182,19 @@ connection: data, database: data.singleDatabase ? data.defaultDatabase : null, }); - console.log('SET focusedConnectionOrDatabase', { - conid: data?._id, - connection: data, - database: data.singleDatabase ? data.defaultDatabase : null, - }); - openNewTab({ - title: getConnectionLabel(data), - icon: 'img connection', - tabComponent: 'ConnectionTab', - tabPreviewMode: true, - props: { - conid: data._id, - }, - }); + + const config = getCurrentConfig(); + if (config.runAsPortal == false && !config.storageDatabase) { + openNewTab({ + title: getConnectionLabel(data), + icon: 'img connection', + tabComponent: 'ConnectionTab', + tabPreviewMode: true, + props: { + conid: data._id, + }, + }); + } }; const handleSqlRestore = () => { diff --git a/packages/web/src/query/newQuery.ts b/packages/web/src/query/newQuery.ts index fdd98ee56..8b8d455eb 100644 --- a/packages/web/src/query/newQuery.ts +++ b/packages/web/src/query/newQuery.ts @@ -24,6 +24,7 @@ export default function newQuery({ tooltip, tabComponent, multiTabIndex, + focused: true, props: { ...props, conid: connection._id, diff --git a/packages/web/src/widgets/ConnectionList.svelte b/packages/web/src/widgets/ConnectionList.svelte index f515bf729..4b84fe07d 100644 --- a/packages/web/src/widgets/ConnectionList.svelte +++ b/packages/web/src/widgets/ConnectionList.svelte @@ -19,6 +19,7 @@ focusedConnectionOrDatabase, getFocusedConnectionOrDatabase, currentDatabase, + getCurrentConfig, } from '../stores'; import runCommand from '../commands/runCommand'; import { filterName, getConnectionLabel } from 'dbgate-tools'; @@ -231,15 +232,18 @@ if (options.focusTab) { openConnection(data.connection); } else { - openNewTab({ - title: getConnectionLabel(data.connection), - icon: 'img connection', - tabComponent: 'ConnectionTab', - tabPreviewMode: options.tabPreviewMode, - props: { - conid: data.conid, - }, - }); + const config = getCurrentConfig(); + if (config.runAsPortal == false && !config.storageDatabase) { + openNewTab({ + title: getConnectionLabel(data.connection), + icon: 'img connection', + tabComponent: 'ConnectionTab', + tabPreviewMode: options.tabPreviewMode, + props: { + conid: data.conid, + }, + }); + } } } }} diff --git a/packages/web/src/widgets/SqlObjectList.svelte b/packages/web/src/widgets/SqlObjectList.svelte index 5257b9849..332d52ecf 100644 --- a/packages/web/src/widgets/SqlObjectList.svelte +++ b/packages/web/src/widgets/SqlObjectList.svelte @@ -35,7 +35,7 @@ import DropDownButton from '../buttons/DropDownButton.svelte'; import FontIcon from '../icons/FontIcon.svelte'; import CloseSearchButton from '../buttons/CloseSearchButton.svelte'; - import { findEngineDriver } from 'dbgate-tools'; + import { findEngineDriver, getConnectionLabel } from 'dbgate-tools'; import { currentDatabase, extensions, @@ -53,6 +53,7 @@ import { matchDatabaseObjectAppObject } from '../appobj/appObjectTools'; import FormStyledButton from '../buttons/FormStyledButton.svelte'; import clickOutside from '../utility/clickOutside'; + import { openConnection } from '../appobj/ConnectionAppObject.svelte'; export let conid; export let database; @@ -135,8 +136,8 @@ $: differentFocusedDb = $focusedConnectionOrDatabase && - $focusedConnectionOrDatabase?.database && - ($focusedConnectionOrDatabase.conid != conid || $focusedConnectionOrDatabase?.database != database); + ($focusedConnectionOrDatabase.conid != conid || + ($focusedConnectionOrDatabase?.database && $focusedConnectionOrDatabase?.database != database)); {#if $status && $status.name == 'error'} @@ -199,30 +200,52 @@ {#if differentFocusedDb}