diff --git a/packages/api/src/proc/serverConnectionProcess.js b/packages/api/src/proc/serverConnectionProcess.js index 98f88a5e..717c9e96 100644 --- a/packages/api/src/proc/serverConnectionProcess.js +++ b/packages/api/src/proc/serverConnectionProcess.js @@ -16,7 +16,18 @@ let afterConnectCallbacks = []; async function handleRefresh() { const driver = requireEngineDriver(storedConnection); try { - const databases = await driver.listDatabases(systemConnection); + let databases = await driver.listDatabases(systemConnection); + if (storedConnection?.allowedDatabases?.trim()) { + const allowedDatabaseList = storedConnection.allowedDatabases + .split('\n') + .map(x => x.trim().toLowerCase()) + .filter(x => x); + databases = databases.filter(x => allowedDatabaseList.includes(x.name.toLocaleLowerCase())); + } + if (storedConnection?.allowedDatabasesRegex?.trim()) { + const regex = new RegExp(storedConnection.allowedDatabasesRegex, 'i'); + databases = databases.filter(x => regex.test(x.name)); + } setStatusName('ok'); const databasesString = stableStringify(databases); if (lastDatabases != databasesString) { diff --git a/packages/web/public/global.css b/packages/web/public/global.css index 464b9844..aa785ed6 100644 --- a/packages/web/public/global.css +++ b/packages/web/public/global.css @@ -121,6 +121,15 @@ body { border-radius: 4px; } +.largeFormMarker textarea { + width: 100%; + padding: 10px 10px; + font-size: 14px; + box-sizing: border-box; + border-radius: 4px; + border: 1px solid var(--theme-border); +} + body *::-webkit-scrollbar { height: 0.8em; width: 0.8em; @@ -169,6 +178,10 @@ textarea { border: 1px solid var(--theme-border); } +textarea[disabled] { + background-color: var(--theme-bg-1); +} + .ace_gutter-cell.ace-gutter-sql-run { background-repeat: no-repeat; background-position: 2px center; diff --git a/packages/web/src/forms/FormTextAreaField.svelte b/packages/web/src/forms/FormTextAreaField.svelte new file mode 100644 index 00000000..5236f2f2 --- /dev/null +++ b/packages/web/src/forms/FormTextAreaField.svelte @@ -0,0 +1,15 @@ + + + + + diff --git a/packages/web/src/forms/FormTextAreaFieldRaw.svelte b/packages/web/src/forms/FormTextAreaFieldRaw.svelte new file mode 100644 index 00000000..041c8ced --- /dev/null +++ b/packages/web/src/forms/FormTextAreaFieldRaw.svelte @@ -0,0 +1,21 @@ + + + setFieldValue(name, e.target['value'])} + on:input={e => { + if (saveOnInput) { + setFieldValue(name, e.target['value']); + } + }} +/> diff --git a/packages/web/src/forms/TextAreaField.svelte b/packages/web/src/forms/TextAreaField.svelte index f2071177..cf11fbfc 100644 --- a/packages/web/src/forms/TextAreaField.svelte +++ b/packages/web/src/forms/TextAreaField.svelte @@ -2,7 +2,7 @@ import { onMount } from 'svelte'; export let value; - export let focused; + export let focused = false; let domEditor; diff --git a/packages/web/src/settings/ConnectionAdvancedDriverFields.svelte b/packages/web/src/settings/ConnectionAdvancedDriverFields.svelte new file mode 100644 index 00000000..eec4164e --- /dev/null +++ b/packages/web/src/settings/ConnectionAdvancedDriverFields.svelte @@ -0,0 +1,13 @@ + + + + diff --git a/packages/web/src/tabs/ConnectionTab.svelte b/packages/web/src/tabs/ConnectionTab.svelte index 9d627e11..1bb95433 100644 --- a/packages/web/src/tabs/ConnectionTab.svelte +++ b/packages/web/src/tabs/ConnectionTab.svelte @@ -33,6 +33,7 @@ import { disconnectServerConnection, openConnection } from '../appobj/ConnectionAppObject.svelte'; import { disconnectDatabaseConnection } from '../appobj/DatabaseAppObject.svelte'; import { useConfig } from '../utility/metadataLoaders'; + import ConnectionAdvancedDriverFields from '../settings/ConnectionAdvancedDriverFields.svelte'; export let connection; export let tabid; @@ -210,6 +211,10 @@ label: 'SSL', component: ConnectionSslFields, }, + { + label: 'Advanced', + component: ConnectionAdvancedDriverFields, + }, ]} />