mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 21:36:00 +00:00
libSQL - targetType
This commit is contained in:
@@ -104,6 +104,23 @@
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{#if $authTypes && driver?.showConnectionField('authType', $values, showConnectionFieldArgs) && driver?.authTypeFirst}
|
||||||
|
{#key $authTypes}
|
||||||
|
<FormSelectField
|
||||||
|
label={driver?.authTypeLabel ?? 'Authentication'}
|
||||||
|
data-testid="ConnectionDriverFields_authType"
|
||||||
|
name="authType"
|
||||||
|
isNative
|
||||||
|
disabled={isConnected}
|
||||||
|
defaultValue={driver?.defaultAuthTypeName}
|
||||||
|
options={$authTypes.map(auth => ({
|
||||||
|
value: auth.name,
|
||||||
|
label: auth.title,
|
||||||
|
}))}
|
||||||
|
/>
|
||||||
|
{/key}
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if driver?.showConnectionField('databaseFile', $values, showConnectionFieldArgs)}
|
{#if driver?.showConnectionField('databaseFile', $values, showConnectionFieldArgs)}
|
||||||
{#if electron}
|
{#if electron}
|
||||||
<FormElectronFileSelector
|
<FormElectronFileSelector
|
||||||
@@ -163,7 +180,7 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $authTypes && driver?.showConnectionField('authType', $values, showConnectionFieldArgs)}
|
{#if $authTypes && driver?.showConnectionField('authType', $values, showConnectionFieldArgs) && !driver?.authTypeFirst}
|
||||||
{#key $authTypes}
|
{#key $authTypes}
|
||||||
<FormSelectField
|
<FormSelectField
|
||||||
label={driver?.authTypeLabel ?? 'Authentication'}
|
label={driver?.authTypeLabel ?? 'Authentication'}
|
||||||
|
|||||||
@@ -81,17 +81,19 @@ const libsqlDriver = {
|
|||||||
...sqliteDriverBase,
|
...sqliteDriverBase,
|
||||||
engine: 'libsql@dbgate-plugin-sqlite',
|
engine: 'libsql@dbgate-plugin-sqlite',
|
||||||
title: 'LibSQL',
|
title: 'LibSQL',
|
||||||
|
authTypeLabel: 'Target type',
|
||||||
|
authTypeFirst: true,
|
||||||
|
|
||||||
showConnectionField: (field, values) => {
|
showConnectionField: (field, values) => {
|
||||||
if ((values?.authType ?? 'url') === 'url') {
|
if ((values?.authType ?? 'url') === 'url') {
|
||||||
return ['databaseUrl', 'authToken', 'isReadOnly', 'authType'].includes(field);
|
return ['databaseUrl', 'authToken', 'isReadOnly', 'authType'].includes(field);
|
||||||
}
|
}
|
||||||
return ['databaseFile', 'isReadOnly', 'authType'].includes(field);
|
if (['databaseFile', 'isReadOnly'].includes(field)) return true;
|
||||||
|
if (field == 'authType') return true;
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
defaultAuthTypeName: 'url',
|
defaultAuthTypeName: 'url',
|
||||||
authTypeFirst: true,
|
|
||||||
|
|
||||||
beforeConnectionSave: (connection) => ({
|
beforeConnectionSave: (connection) => ({
|
||||||
...connection,
|
...connection,
|
||||||
singleDatabase: true,
|
singleDatabase: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user