mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 22:25:59 +00:00
connections UX
This commit is contained in:
71
packages/api/env/portal/.env
vendored
71
packages/api/env/portal/.env
vendored
@@ -1,60 +1,47 @@
|
|||||||
DEVMODE=1
|
DEVMODE=1
|
||||||
|
|
||||||
CONNECTIONS=mysql,postgres,postgres1,mongo,mongo2,mysqlssh,sqlite,relational
|
CONNECTIONS=mysql,postgres,mongo,redis,mssql,oracle
|
||||||
|
|
||||||
LABEL_mysql=MySql localhost
|
LABEL_mysql=MySql
|
||||||
SERVER_mysql=localhost
|
SERVER_mysql=dbgatedckstage1.sprinx.cz
|
||||||
USER_mysql=root
|
USER_mysql=root
|
||||||
PASSWORD_mysql=test
|
PASSWORD_mysql=Pwd2020Db
|
||||||
PORT_mysql=3307
|
PORT_mysql=3306
|
||||||
ENGINE_mysql=mysql@dbgate-plugin-mysql
|
ENGINE_mysql=mysql@dbgate-plugin-mysql
|
||||||
|
|
||||||
LABEL_postgres=Postgres localhost
|
LABEL_postgres=Postgres
|
||||||
SERVER_postgres=localhost
|
SERVER_postgres=dbgatedckstage1.sprinx.cz
|
||||||
USER_postgres=postgres
|
USER_postgres=postgres
|
||||||
PASSWORD_postgres=Pwd2020Db
|
PASSWORD_postgres=Pwd2020Db
|
||||||
PORT_postgres=5432
|
PORT_postgres=5432
|
||||||
ENGINE_postgres=postgres@dbgate-plugin-postgres
|
ENGINE_postgres=postgres@dbgate-plugin-postgres
|
||||||
|
|
||||||
LABEL_postgres1=Postgres localhost test DB
|
LABEL_mongo=Mongo
|
||||||
SERVER_postgres1=localhost
|
SERVER_mongo=dbgatedckstage1.sprinx.cz
|
||||||
USER_postgres1=postgres
|
USER_mongo=root
|
||||||
PASSWORD_postgres1=Pwd2020Db
|
PASSWORD_mongo=Pwd2020Db
|
||||||
PORT_postgres1=5432
|
PORT_mongo=27017
|
||||||
ENGINE_postgres1=postgres@dbgate-plugin-postgres
|
|
||||||
DATABASE_postgres1=test
|
|
||||||
|
|
||||||
LABEL_mongo=Mongo URL
|
|
||||||
URL_mongo=mongodb://localhost:27017
|
|
||||||
ENGINE_mongo=mongo@dbgate-plugin-mongo
|
ENGINE_mongo=mongo@dbgate-plugin-mongo
|
||||||
|
|
||||||
LABEL_mongo2=Mongo Server
|
LABEL_redis=Redis
|
||||||
SERVER_mongo2=localhost
|
SERVER_redis=dbgatedckstage1.sprinx.cz
|
||||||
ENGINE_mongo2=mongo@dbgate-plugin-mongo
|
ENGINE_redis=redis@dbgate-plugin-redis
|
||||||
|
PORT_redis=6379
|
||||||
|
|
||||||
LABEL_mysqlssh=MySql SSH
|
LABEL_mssql=SQL Server
|
||||||
SERVER_mysqlssh=localhost
|
SERVER_mssql=dbgatedckstage1.sprinx.cz
|
||||||
USER_mysqlssh=root
|
USER_mssql=sa
|
||||||
PASSWORD_mysqlssh=xxx
|
PASSWORD_mssql=Pwd2020Db
|
||||||
PORT_mysqlssh=3316
|
PORT_mssql=1433
|
||||||
ENGINE_mysqlssh=mysql@dbgate-plugin-mysql
|
ENGINE_mssql=mssql@dbgate-plugin-mssql
|
||||||
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_sqlite=sqlite
|
LABEL_oracle=Oracle
|
||||||
FILE_sqlite=/home/jena/.dbgate/files/sqlite/feeds.sqlite
|
SERVER_oracle=dbgatedckstage1.sprinx.cz
|
||||||
ENGINE_sqlite=sqlite@dbgate-plugin-sqlite
|
USER_oracle=system
|
||||||
|
PASSWORD_oracle=Pwd2020Db
|
||||||
LABEL_relational=Relational dataset repo
|
PORT_oracle=1521
|
||||||
SERVER_relational=relational.fit.cvut.cz
|
ENGINE_oracle=oracle@dbgate-plugin-oracle
|
||||||
USER_relational=guest
|
SERVICE_NAME_oracle=xe
|
||||||
PASSWORD_relational=relational
|
|
||||||
ENGINE_relational=mariadb@dbgate-plugin-mysql
|
|
||||||
READONLY_relational=1
|
|
||||||
|
|
||||||
# SETTINGS_dataGrid.showHintColumns=1
|
# SETTINGS_dataGrid.showHintColumns=1
|
||||||
|
|
||||||
|
|||||||
@@ -182,11 +182,9 @@
|
|||||||
connection: data,
|
connection: data,
|
||||||
database: data.singleDatabase ? data.defaultDatabase : null,
|
database: data.singleDatabase ? data.defaultDatabase : null,
|
||||||
});
|
});
|
||||||
console.log('SET focusedConnectionOrDatabase', {
|
|
||||||
conid: data?._id,
|
const config = getCurrentConfig();
|
||||||
connection: data,
|
if (config.runAsPortal == false && !config.storageDatabase) {
|
||||||
database: data.singleDatabase ? data.defaultDatabase : null,
|
|
||||||
});
|
|
||||||
openNewTab({
|
openNewTab({
|
||||||
title: getConnectionLabel(data),
|
title: getConnectionLabel(data),
|
||||||
icon: 'img connection',
|
icon: 'img connection',
|
||||||
@@ -196,6 +194,7 @@
|
|||||||
conid: data._id,
|
conid: data._id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSqlRestore = () => {
|
const handleSqlRestore = () => {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export default function newQuery({
|
|||||||
tooltip,
|
tooltip,
|
||||||
tabComponent,
|
tabComponent,
|
||||||
multiTabIndex,
|
multiTabIndex,
|
||||||
|
focused: true,
|
||||||
props: {
|
props: {
|
||||||
...props,
|
...props,
|
||||||
conid: connection._id,
|
conid: connection._id,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
focusedConnectionOrDatabase,
|
focusedConnectionOrDatabase,
|
||||||
getFocusedConnectionOrDatabase,
|
getFocusedConnectionOrDatabase,
|
||||||
currentDatabase,
|
currentDatabase,
|
||||||
|
getCurrentConfig,
|
||||||
} from '../stores';
|
} from '../stores';
|
||||||
import runCommand from '../commands/runCommand';
|
import runCommand from '../commands/runCommand';
|
||||||
import { filterName, getConnectionLabel } from 'dbgate-tools';
|
import { filterName, getConnectionLabel } from 'dbgate-tools';
|
||||||
@@ -231,6 +232,8 @@
|
|||||||
if (options.focusTab) {
|
if (options.focusTab) {
|
||||||
openConnection(data.connection);
|
openConnection(data.connection);
|
||||||
} else {
|
} else {
|
||||||
|
const config = getCurrentConfig();
|
||||||
|
if (config.runAsPortal == false && !config.storageDatabase) {
|
||||||
openNewTab({
|
openNewTab({
|
||||||
title: getConnectionLabel(data.connection),
|
title: getConnectionLabel(data.connection),
|
||||||
icon: 'img connection',
|
icon: 'img connection',
|
||||||
@@ -242,6 +245,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<AppObjectList
|
<AppObjectList
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
import DropDownButton from '../buttons/DropDownButton.svelte';
|
import DropDownButton from '../buttons/DropDownButton.svelte';
|
||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
import CloseSearchButton from '../buttons/CloseSearchButton.svelte';
|
import CloseSearchButton from '../buttons/CloseSearchButton.svelte';
|
||||||
import { findEngineDriver } from 'dbgate-tools';
|
import { findEngineDriver, getConnectionLabel } from 'dbgate-tools';
|
||||||
import {
|
import {
|
||||||
currentDatabase,
|
currentDatabase,
|
||||||
extensions,
|
extensions,
|
||||||
@@ -53,6 +53,7 @@
|
|||||||
import { matchDatabaseObjectAppObject } from '../appobj/appObjectTools';
|
import { matchDatabaseObjectAppObject } from '../appobj/appObjectTools';
|
||||||
import FormStyledButton from '../buttons/FormStyledButton.svelte';
|
import FormStyledButton from '../buttons/FormStyledButton.svelte';
|
||||||
import clickOutside from '../utility/clickOutside';
|
import clickOutside from '../utility/clickOutside';
|
||||||
|
import { openConnection } from '../appobj/ConnectionAppObject.svelte';
|
||||||
|
|
||||||
export let conid;
|
export let conid;
|
||||||
export let database;
|
export let database;
|
||||||
@@ -135,8 +136,8 @@
|
|||||||
|
|
||||||
$: differentFocusedDb =
|
$: differentFocusedDb =
|
||||||
$focusedConnectionOrDatabase &&
|
$focusedConnectionOrDatabase &&
|
||||||
$focusedConnectionOrDatabase?.database &&
|
($focusedConnectionOrDatabase.conid != conid ||
|
||||||
($focusedConnectionOrDatabase.conid != conid || $focusedConnectionOrDatabase?.database != database);
|
($focusedConnectionOrDatabase?.database && $focusedConnectionOrDatabase?.database != database));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $status && $status.name == 'error'}
|
{#if $status && $status.name == 'error'}
|
||||||
@@ -199,6 +200,7 @@
|
|||||||
|
|
||||||
{#if differentFocusedDb}
|
{#if differentFocusedDb}
|
||||||
<div class="no-focused-info">
|
<div class="no-focused-info">
|
||||||
|
{#if $focusedConnectionOrDatabase?.database}
|
||||||
<div class="m-1">Current database:</div>
|
<div class="m-1">Current database:</div>
|
||||||
<div class="m-1 ml-3 mb-3">
|
<div class="m-1 ml-3 mb-3">
|
||||||
<b>{database}</b>
|
<b>{database}</b>
|
||||||
@@ -223,6 +225,27 @@
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{:else}
|
||||||
|
<div class="m-1">Current connection:</div>
|
||||||
|
<div class="m-1 ml-3 mb-3">
|
||||||
|
<b>{getConnectionLabel($connection)}</b>
|
||||||
|
</div>
|
||||||
|
<FormStyledButton
|
||||||
|
value={`Connect to ${getConnectionLabel($focusedConnectionOrDatabase?.connection)}`}
|
||||||
|
skipWidth
|
||||||
|
on:click={() => openConnection($focusedConnectionOrDatabase?.connection)}
|
||||||
|
/>
|
||||||
|
<FormStyledButton
|
||||||
|
value={`Show ${getConnectionLabel($connection)}`}
|
||||||
|
skipWidth
|
||||||
|
on:click={() => {
|
||||||
|
$focusedConnectionOrDatabase = {
|
||||||
|
conid,
|
||||||
|
connection: $connection,
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user