dockerhost hint on GUI

This commit is contained in:
Jan Prochazka 2022-04-21 19:08:33 +02:00
parent e5bbf5eca3
commit d041f88a47
3 changed files with 16 additions and 3 deletions

View File

@ -37,6 +37,7 @@ module.exports = {
// hideAppEditor: !!process.env.HIDE_APP_EDITOR,
allowShellConnection: platformInfo.allowShellConnection,
allowShellScripting: platformInfo.allowShellConnection,
isDocker: platformInfo.isDocker,
permissions,
login,
...currentVersion,

View File

@ -17,7 +17,7 @@
import ErrorMessageModal from './ErrorMessageModal.svelte';
import { writable } from 'svelte/store';
import FormProviderCore from '../forms/FormProviderCore.svelte';
import { extensions } from '../stores';
import { extensions, getCurrentConfig } from '../stores';
import _ from 'lodash';
import { getDatabaseFileLabel } from '../utility/getConnectionLabel';
import { apiCall } from '../utility/api';
@ -27,7 +27,12 @@
let isTesting;
let sqlConnectResult;
const values = writable(connection || { server: 'localhost', engine: 'mssql@dbgate-plugin-mssql' });
const values = writable(
connection || {
server: getCurrentConfig().isDocker ? 'dockerhost' : 'localhost',
engine: 'mssql@dbgate-plugin-mssql',
}
);
$: engine = $values.engine;
$: driver = $extensions.drivers.find(x => x.engine == engine);

View File

@ -10,10 +10,11 @@
import FormSelectField from '../forms/FormSelectField.svelte';
import FormTextField from '../forms/FormTextField.svelte';
import { extensions } from '../stores';
import { extensions, getCurrentConfig } from '../stores';
import getElectron from '../utility/getElectron';
import { useAuthTypes } from '../utility/metadataLoaders';
import FormColorField from '../forms/FormColorField.svelte';
import FontIcon from '../icons/FontIcon.svelte';
const { values } = getFormContext();
const electron = getElectron();
@ -101,6 +102,12 @@
</div>
{/if}
</div>
{#if getCurrentConfig().isDocker}
<div class="row">
<FontIcon icon="img warn" padRight />
Under docker, localhost and 127.0.0.1 will not work, use dockerhost instead
</div>
{/if}
{/if}
{#if showUser && showPassword}