mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 09:36:00 +00:00
fix
This commit is contained in:
@@ -47,6 +47,9 @@ module.exports = {
|
|||||||
const existing = this.opened.find(x => x.conid == conid);
|
const existing = this.opened.find(x => x.conid == conid);
|
||||||
if (existing) return existing;
|
if (existing) return existing;
|
||||||
const connection = await connections.getCore({ conid });
|
const connection = await connections.getCore({ conid });
|
||||||
|
if (!connection) {
|
||||||
|
throw new Error(`Connection with conid="${conid}" not fund`);
|
||||||
|
}
|
||||||
if (connection.passwordMode == 'askPassword' || connection.passwordMode == 'askUser') {
|
if (connection.passwordMode == 'askPassword' || connection.passwordMode == 'askUser') {
|
||||||
throw new MissingCredentialsError({ conid, passwordMode: connection.passwordMode });
|
throw new MissingCredentialsError({ conid, passwordMode: connection.passwordMode });
|
||||||
}
|
}
|
||||||
@@ -110,6 +113,7 @@ module.exports = {
|
|||||||
|
|
||||||
listDatabases_meta: true,
|
listDatabases_meta: true,
|
||||||
async listDatabases({ conid }, req) {
|
async listDatabases({ conid }, req) {
|
||||||
|
if (!conid) return [];
|
||||||
testConnectionPermission(conid, req);
|
testConnectionPermission(conid, req);
|
||||||
const opened = await this.ensureOpened(conid);
|
const opened = await this.ensureOpened(conid);
|
||||||
return opened.databases;
|
return opened.databases;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
import FormSchemaSelect from './FormSchemaSelect.svelte';
|
import FormSchemaSelect from './FormSchemaSelect.svelte';
|
||||||
import FormTablesSelect from './FormTablesSelect.svelte';
|
import FormTablesSelect from './FormTablesSelect.svelte';
|
||||||
import { findEngineDriver } from 'dbgate-tools';
|
import { findEngineDriver } from 'dbgate-tools';
|
||||||
import AceEditor from '../query/AceEditor.svelte';
|
import AceEditor from '../query/AceEditor.svelte';
|
||||||
|
|
||||||
export let direction;
|
export let direction;
|
||||||
export let storageTypeField;
|
export let storageTypeField;
|
||||||
@@ -139,17 +139,9 @@ import AceEditor from '../query/AceEditor.svelte';
|
|||||||
<div class="label">Query</div>
|
<div class="label">Query</div>
|
||||||
<div class="sqlwrap">
|
<div class="sqlwrap">
|
||||||
{#if $values.sourceQueryType == 'json'}
|
{#if $values.sourceQueryType == 'json'}
|
||||||
<AceEditor
|
<AceEditor value={$values.sourceQuery} on:input={e => setFieldValue('sourceQuery', e.detail)} mode="json" />
|
||||||
value={$values.sourceQuery}
|
|
||||||
on:input={e => setFieldValue('sourceQuery', e.detail)}
|
|
||||||
mode="json"
|
|
||||||
/>
|
|
||||||
{:else}
|
{:else}
|
||||||
<SqlEditor
|
<SqlEditor value={$values.sourceQuery} on:input={e => setFieldValue('sourceQuery', e.detail)} {engine} />
|
||||||
value={$values.sourceQuery}
|
|
||||||
on:input={e => setFieldValue('sourceQuery', e.detail)}
|
|
||||||
{engine}
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user