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