mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 19:33:59 +00:00
clickable fk links in column manager
This commit is contained in:
@@ -335,9 +335,9 @@
|
|||||||
tabComponent,
|
tabComponent,
|
||||||
scriptTemplate,
|
scriptTemplate,
|
||||||
{ schemaName, pureName, conid, database, objectTypeField },
|
{ schemaName, pureName, conid, database, objectTypeField },
|
||||||
forceNewTab,
|
forceNewTab?,
|
||||||
initialData,
|
initialData?,
|
||||||
icon
|
icon?
|
||||||
) {
|
) {
|
||||||
const connection = await getConnectionInfo({ conid });
|
const connection = await getConnectionInfo({ conid });
|
||||||
const tooltip = `${getConnectionLabel(connection)}\n${database}\n${fullDisplayName({
|
const tooltip = `${getConnectionLabel(connection)}\n${database}\n${fullDisplayName({
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
export let display: GridDisplay;
|
export let display: GridDisplay;
|
||||||
export let isJsonView = false;
|
export let isJsonView = false;
|
||||||
export let isDynamicStructure = false;
|
export let isDynamicStructure = false;
|
||||||
|
export let conid;
|
||||||
|
export let database;
|
||||||
|
|
||||||
let filter;
|
let filter;
|
||||||
let domFocusField;
|
let domFocusField;
|
||||||
@@ -141,6 +143,8 @@
|
|||||||
{display}
|
{display}
|
||||||
{column}
|
{column}
|
||||||
{isJsonView}
|
{isJsonView}
|
||||||
|
{conid}
|
||||||
|
{database}
|
||||||
isSelected={selectedColumns.includes(column.uniqueName) || currentColumnUniqueName == column.uniqueName}
|
isSelected={selectedColumns.includes(column.uniqueName) || currentColumnUniqueName == column.uniqueName}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
if (domFocusField) domFocusField.focus();
|
if (domFocusField) domFocusField.focus();
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
export let display;
|
export let display;
|
||||||
export let isJsonView = false;
|
export let isJsonView = false;
|
||||||
export let isSelected = false;
|
export let isSelected = false;
|
||||||
|
export let conid;
|
||||||
|
export let database;
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
</script>
|
</script>
|
||||||
@@ -52,7 +54,7 @@
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<ColumnLabel {...column} showDataType />
|
<ColumnLabel {...column} showDataType {conid} {database} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -8,7 +8,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { openDatabaseObjectDetail } from '../appobj/DatabaseObjectAppObject.svelte';
|
||||||
|
|
||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
|
import Link from './Link.svelte';
|
||||||
|
|
||||||
export let notNull = false;
|
export let notNull = false;
|
||||||
export let forceIcon = false;
|
export let forceIcon = false;
|
||||||
@@ -17,6 +20,9 @@
|
|||||||
export let extInfo = null;
|
export let extInfo = null;
|
||||||
export let dataType = null;
|
export let dataType = null;
|
||||||
export let showDataType = false;
|
export let showDataType = false;
|
||||||
|
export let foreignKey;
|
||||||
|
export let conid = undefined;
|
||||||
|
export let database = undefined;
|
||||||
|
|
||||||
$: icon = getColumnIcon($$props, forceIcon);
|
$: icon = getColumnIcon($$props, forceIcon);
|
||||||
</script>
|
</script>
|
||||||
@@ -29,8 +35,31 @@
|
|||||||
{#if extInfo}
|
{#if extInfo}
|
||||||
<span class="extinfo">{extInfo}</span>
|
<span class="extinfo">{extInfo}</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if showDataType && dataType}
|
{#if showDataType}
|
||||||
<span class="extinfo">{dataType.toLowerCase()}</span>
|
{#if foreignKey}
|
||||||
|
<span class="extinfo">
|
||||||
|
<FontIcon icon="icon arrow-right" />
|
||||||
|
{#if conid && database}
|
||||||
|
<Link
|
||||||
|
onClick={e => {
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
openDatabaseObjectDetail('TableDataTab', null, {
|
||||||
|
schemaName: foreignKey.refSchemaName,
|
||||||
|
pureName: foreignKey.refTableName,
|
||||||
|
conid,
|
||||||
|
database,
|
||||||
|
objectTypeField: 'tables',
|
||||||
|
});
|
||||||
|
}}>{foreignKey.refTableName}</Link
|
||||||
|
>
|
||||||
|
{:else}
|
||||||
|
{foreignKey.refTableName}
|
||||||
|
{/if}
|
||||||
|
</span>
|
||||||
|
{:else if dataType}
|
||||||
|
<span class="extinfo">{dataType.toLowerCase()}</span>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|||||||
@@ -563,12 +563,7 @@
|
|||||||
<FontIcon icon="icon invisible-box" />
|
<FontIcon icon="icon invisible-box" />
|
||||||
{/if}
|
{/if}
|
||||||
<span style={`margin-left: ${(col.uniquePath.length - 1) * 20}px`} />
|
<span style={`margin-left: ${(col.uniquePath.length - 1) * 20}px`} />
|
||||||
<ColumnLabel
|
<ColumnLabel {...col} headerText={col.columnName} showDataType {conid} {database} />
|
||||||
{...col}
|
|
||||||
headerText={col.columnName}
|
|
||||||
extInfo={col.foreignKey ? ` -> ${col.foreignKey.refTableName}` : null}
|
|
||||||
showDataType={!col.foreignKey}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<DataGridCell
|
<DataGridCell
|
||||||
|
|||||||
Reference in New Issue
Block a user