mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-24 23:26:00 +00:00
better connection UX
This commit is contained in:
@@ -19,6 +19,8 @@ Builds:
|
|||||||
- FIXED: Analysing of foreign keys in Postgres and MS SQL, when the same FKS are used across different schemas
|
- FIXED: Analysing of foreign keys in Postgres and MS SQL, when the same FKS are used across different schemas
|
||||||
- ADDED: Support of views, procedures, functions to Oracle. Added integration tests for Oracle
|
- ADDED: Support of views, procedures, functions to Oracle. Added integration tests for Oracle
|
||||||
- ADDED: Display "No rows" message, quick add new row
|
- ADDED: Display "No rows" message, quick add new row
|
||||||
|
- ADDED: Choose default database from list
|
||||||
|
- ADDED: Default database is automatically selected on connect
|
||||||
|
|
||||||
### 6.0.0
|
### 6.0.0
|
||||||
- ADDED: Order or filter the indexes for huge tables #922
|
- ADDED: Order or filter the indexes for huge tables #922
|
||||||
|
|||||||
@@ -16,8 +16,10 @@
|
|||||||
import FormColorField from '../forms/FormColorField.svelte';
|
import FormColorField from '../forms/FormColorField.svelte';
|
||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
import FormDropDownTextField from '../forms/FormDropDownTextField.svelte';
|
import FormDropDownTextField from '../forms/FormDropDownTextField.svelte';
|
||||||
|
import { getConnectionLabel } from 'dbgate-tools';
|
||||||
|
|
||||||
export let getDatabaseList;
|
export let getDatabaseList;
|
||||||
|
export let currentConnection;
|
||||||
|
|
||||||
const { values, setFieldValue } = getFormContext();
|
const { values, setFieldValue } = getFormContext();
|
||||||
const electron = getElectron();
|
const electron = getElectron();
|
||||||
@@ -393,6 +395,7 @@
|
|||||||
disabled={isConnected}
|
disabled={isConnected}
|
||||||
data-testid="ConnectionDriverFields_defaultDatabase"
|
data-testid="ConnectionDriverFields_defaultDatabase"
|
||||||
asyncMenu={createDatabasesMenu}
|
asyncMenu={createDatabasesMenu}
|
||||||
|
placeholder="(not selected - optional)"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
@@ -423,6 +426,7 @@
|
|||||||
templateProps={{ noMargin: true }}
|
templateProps={{ noMargin: true }}
|
||||||
disabled={isConnected}
|
disabled={isConnected}
|
||||||
data-testid="ConnectionDriverFields_displayName"
|
data-testid="ConnectionDriverFields_displayName"
|
||||||
|
placeholder={getConnectionLabel(currentConnection)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 mr-1">
|
<div class="col-6 mr-1">
|
||||||
|
|||||||
@@ -81,6 +81,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentConnection() {
|
function getCurrentConnection() {
|
||||||
|
return getCurrentConnectionCore($values, driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCurrentConnectionCore(values, driver) {
|
||||||
const allProps = [
|
const allProps = [
|
||||||
'databaseFile',
|
'databaseFile',
|
||||||
'useDatabaseUrl',
|
'useDatabaseUrl',
|
||||||
@@ -95,15 +99,15 @@
|
|||||||
'socketPath',
|
'socketPath',
|
||||||
'serviceName',
|
'serviceName',
|
||||||
];
|
];
|
||||||
const visibleProps = allProps.filter(x => driver?.showConnectionField(x, $values, { config: $config }));
|
const visibleProps = allProps.filter(x => driver?.showConnectionField(x, values, { config: $config }));
|
||||||
const omitProps = _.difference(allProps, visibleProps);
|
const omitProps = _.difference(allProps, visibleProps);
|
||||||
if (!$values.defaultDatabase) omitProps.push('singleDatabase');
|
if (!values.defaultDatabase) omitProps.push('singleDatabase');
|
||||||
|
|
||||||
let connection: Dictionary<string | boolean> = _.omit($values, omitProps);
|
let connection: Dictionary<string | boolean> = _.omit(values, omitProps);
|
||||||
if (driver?.beforeConnectionSave) connection = driver?.beforeConnectionSave(connection);
|
if (driver?.beforeConnectionSave) connection = driver?.beforeConnectionSave(connection);
|
||||||
|
|
||||||
if (driver?.showConnectionTab('sshTunnel', $values)) {
|
if (driver?.showConnectionTab('sshTunnel', values)) {
|
||||||
if (!$values.useSshTunnel) {
|
if (!values.useSshTunnel) {
|
||||||
connection = _.omitBy(connection, (v, k) => k.startsWith('ssh'));
|
connection = _.omitBy(connection, (v, k) => k.startsWith('ssh'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -111,8 +115,8 @@
|
|||||||
connection = _.omitBy(connection, (v, k) => k.startsWith('ssh'));
|
connection = _.omitBy(connection, (v, k) => k.startsWith('ssh'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver?.showConnectionTab('ssl', $values)) {
|
if (driver?.showConnectionTab('ssl', values)) {
|
||||||
if (!$values.useSsl) {
|
if (!values.useSsl) {
|
||||||
connection = _.omitBy(connection, (v, k) => k.startsWith('ssl'));
|
connection = _.omitBy(connection, (v, k) => k.startsWith('ssl'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -123,6 +127,8 @@
|
|||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: currentConnection = getCurrentConnectionCore($values, driver);
|
||||||
|
|
||||||
async function handleSave() {
|
async function handleSave() {
|
||||||
let connection = getCurrentConnection();
|
let connection = getCurrentConnection();
|
||||||
connection = {
|
connection = {
|
||||||
@@ -211,7 +217,7 @@
|
|||||||
{
|
{
|
||||||
label: 'General',
|
label: 'General',
|
||||||
component: ConnectionDriverFields,
|
component: ConnectionDriverFields,
|
||||||
props: { getDatabaseList },
|
props: { getDatabaseList, currentConnection },
|
||||||
},
|
},
|
||||||
driver?.showConnectionTab('sshTunnel', $values) && {
|
driver?.showConnectionTab('sshTunnel', $values) && {
|
||||||
label: 'SSH Tunnel',
|
label: 'SSH Tunnel',
|
||||||
|
|||||||
Reference in New Issue
Block a user