mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 19:53:57 +00:00
copy connection error to clipboard
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
import contextMenu from '../utility/contextMenu';
|
import contextMenu from '../utility/contextMenu';
|
||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import CheckboxField from '../forms/CheckboxField.svelte';
|
import CheckboxField from '../forms/CheckboxField.svelte';
|
||||||
|
import { copyTextToClipboard } from '../utility/clipboard';
|
||||||
|
import { showSnackbarSuccess } from '../utility/snackbar';
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
@@ -16,6 +18,7 @@
|
|||||||
export let statusIcon = undefined;
|
export let statusIcon = undefined;
|
||||||
export let statusIconBefore = undefined;
|
export let statusIconBefore = undefined;
|
||||||
export let statusTitle = undefined;
|
export let statusTitle = undefined;
|
||||||
|
export let statusTitleToCopy = undefined;
|
||||||
export let extInfo = undefined;
|
export let extInfo = undefined;
|
||||||
export let menu = undefined;
|
export let menu = undefined;
|
||||||
export let expandIcon = undefined;
|
export let expandIcon = undefined;
|
||||||
@@ -114,7 +117,16 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if statusIcon}
|
{#if statusIcon}
|
||||||
<span class="status">
|
<span class="status">
|
||||||
<FontIcon icon={statusIcon} title={statusTitle} />
|
<FontIcon
|
||||||
|
icon={statusIcon}
|
||||||
|
title={statusTitle}
|
||||||
|
on:click={() => {
|
||||||
|
if (statusTitleToCopy) {
|
||||||
|
copyTextToClipboard(statusTitleToCopy);
|
||||||
|
showSnackbarSuccess('Copied to clipboard');
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if extInfo}
|
{#if extInfo}
|
||||||
|
|||||||
@@ -323,6 +323,7 @@
|
|||||||
: _.get($currentDatabase, 'connection._id') == data._id}
|
: _.get($currentDatabase, 'connection._id') == data._id}
|
||||||
statusIcon={statusIcon || engineStatusIcon}
|
statusIcon={statusIcon || engineStatusIcon}
|
||||||
statusTitle={statusTitle || engineStatusTitle}
|
statusTitle={statusTitle || engineStatusTitle}
|
||||||
|
statusTitleToCopy={statusTitle || engineStatusTitle}
|
||||||
statusIconBefore={data.isReadOnly ? 'icon lock' : null}
|
statusIconBefore={data.isReadOnly ? 'icon lock' : null}
|
||||||
{extInfo}
|
{extInfo}
|
||||||
colorMark={passProps?.connectionColorFactory && passProps?.connectionColorFactory({ conid: data._id })}
|
colorMark={passProps?.connectionColorFactory && passProps?.connectionColorFactory({ conid: data._id })}
|
||||||
|
|||||||
@@ -58,13 +58,17 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{#if driver?.showConnectionField('databaseFile', $values, showConnectionFieldArgs)}
|
{#if driver?.showConnectionField('databaseFile', $values, showConnectionFieldArgs)}
|
||||||
<FormElectronFileSelector label="Database file" name="databaseFile" disabled={isConnected || !electron} />
|
<FormElectronFileSelector
|
||||||
|
label="Database file"
|
||||||
|
name="databaseFile"
|
||||||
|
disabled={isConnected || !electron || disabledFields.includes('databaseFile')}
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if driver?.showConnectionField('useDatabaseUrl', $values, showConnectionFieldArgs)}
|
{#if driver?.showConnectionField('useDatabaseUrl', $values, showConnectionFieldArgs)}
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<FormRadioGroupField
|
<FormRadioGroupField
|
||||||
disabled={isConnected}
|
disabled={isConnected || disabledFields.includes('useDatabaseUrl')}
|
||||||
name="useDatabaseUrl"
|
name="useDatabaseUrl"
|
||||||
matchValueToOption={(value, option) => !!option.value == !!value}
|
matchValueToOption={(value, option) => !!option.value == !!value}
|
||||||
options={[
|
options={[
|
||||||
@@ -80,7 +84,7 @@
|
|||||||
label="Database URL"
|
label="Database URL"
|
||||||
name="databaseUrl"
|
name="databaseUrl"
|
||||||
placeholder={driver?.databaseUrlPlaceholder}
|
placeholder={driver?.databaseUrlPlaceholder}
|
||||||
disabled={isConnected}
|
disabled={isConnected || disabledFields.includes('databaseUrl')}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
@@ -101,15 +105,19 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if driver?.showConnectionField('endpoint', $values, showConnectionFieldArgs)}
|
{#if driver?.showConnectionField('endpoint', $values, showConnectionFieldArgs)}
|
||||||
<FormTextField label="Endpoint" name="endpoint" disabled={isConnected} />
|
<FormTextField label="Endpoint" name="endpoint" disabled={isConnected || disabledFields.includes('endpoint')} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if driver?.showConnectionField('endpointKey', $values, showConnectionFieldArgs)}
|
{#if driver?.showConnectionField('endpointKey', $values, showConnectionFieldArgs)}
|
||||||
<FormTextField label="Key" name="endpointKey" disabled={isConnected} />
|
<FormTextField label="Key" name="endpointKey" disabled={isConnected || disabledFields.includes('endpointKey')} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if driver?.showConnectionField('clientLibraryPath', $values, showConnectionFieldArgs)}
|
{#if driver?.showConnectionField('clientLibraryPath', $values, showConnectionFieldArgs)}
|
||||||
<FormTextField label="Client library path" name="clientLibraryPath" disabled={isConnected} />
|
<FormTextField
|
||||||
|
label="Client library path"
|
||||||
|
name="clientLibraryPath"
|
||||||
|
disabled={isConnected || disabledFields.includes('clientLibraryPath')}
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if driver?.showConnectionField('server', $values, showConnectionFieldArgs)}
|
{#if driver?.showConnectionField('server', $values, showConnectionFieldArgs)}
|
||||||
@@ -250,7 +258,11 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if driver?.showConnectionField('useSeparateSchemas', $values, showConnectionFieldArgs)}
|
{#if driver?.showConnectionField('useSeparateSchemas', $values, showConnectionFieldArgs)}
|
||||||
<FormCheckboxField label={`Use schemas separately (use this if you have many large schemas)`} name="useSeparateSchemas" disabled={isConnected} />
|
<FormCheckboxField
|
||||||
|
label={`Use schemas separately (use this if you have many large schemas)`}
|
||||||
|
name="useSeparateSchemas"
|
||||||
|
disabled={isConnected}
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if driver}
|
{#if driver}
|
||||||
|
|||||||
Reference in New Issue
Block a user