mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 22:46:01 +00:00
connection tree UX
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { findEngineDriver } from 'dbgate-tools';
|
import { findEngineDriver, getConnectionLabel } from 'dbgate-tools';
|
||||||
import { currentDatabase, extensions, pinnedDatabases, pinnedTables, focusedConnectionOrDatabase } from '../stores';
|
import {
|
||||||
|
currentDatabase,
|
||||||
|
extensions,
|
||||||
|
pinnedDatabases,
|
||||||
|
pinnedTables,
|
||||||
|
focusedConnectionOrDatabase,
|
||||||
|
openedConnections,
|
||||||
|
} from '../stores';
|
||||||
import { useConfig, useConnectionInfo } from '../utility/metadataLoaders';
|
import { useConfig, useConnectionInfo } from '../utility/metadataLoaders';
|
||||||
|
|
||||||
import ConnectionList from './ConnectionList.svelte';
|
import ConnectionList from './ConnectionList.svelte';
|
||||||
@@ -16,6 +23,7 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import FormStyledButton from '../buttons/FormStyledButton.svelte';
|
import FormStyledButton from '../buttons/FormStyledButton.svelte';
|
||||||
import { switchCurrentDatabase } from '../utility/common';
|
import { switchCurrentDatabase } from '../utility/common';
|
||||||
|
import { openConnection } from '../appobj/ConnectionAppObject.svelte';
|
||||||
|
|
||||||
export let hidden = false;
|
export let hidden = false;
|
||||||
let domSqlObjectList = null;
|
let domSqlObjectList = null;
|
||||||
@@ -92,6 +100,12 @@
|
|||||||
name: $focusedConnectionOrDatabase?.database,
|
name: $focusedConnectionOrDatabase?.database,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
{:else if $focusedConnectionOrDatabase?.connection && !$openedConnections.includes($focusedConnectionOrDatabase?.conid)}
|
||||||
|
<FormStyledButton
|
||||||
|
value={`Connect to ${getConnectionLabel($focusedConnectionOrDatabase?.connection)}`}
|
||||||
|
skipWidth
|
||||||
|
on:click={() => openConnection($focusedConnectionOrDatabase?.connection)}
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</WidgetsInnerContainer>
|
</WidgetsInnerContainer>
|
||||||
</WidgetColumnBarItem>
|
</WidgetColumnBarItem>
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
extensions,
|
extensions,
|
||||||
focusedConnectionOrDatabase,
|
focusedConnectionOrDatabase,
|
||||||
getSelectedDatabaseObjectAppObject,
|
getSelectedDatabaseObjectAppObject,
|
||||||
|
openedConnections,
|
||||||
selectedDatabaseObjectAppObject,
|
selectedDatabaseObjectAppObject,
|
||||||
} from '../stores';
|
} from '../stores';
|
||||||
import newQuery from '../query/newQuery';
|
import newQuery from '../query/newQuery';
|
||||||
@@ -230,11 +231,13 @@
|
|||||||
<div class="m-1 ml-3 mb-3">
|
<div class="m-1 ml-3 mb-3">
|
||||||
<b>{getConnectionLabel($connection)}</b>
|
<b>{getConnectionLabel($connection)}</b>
|
||||||
</div>
|
</div>
|
||||||
<FormStyledButton
|
{#if !$openedConnections.includes($focusedConnectionOrDatabase?.conid)}
|
||||||
value={`Connect to ${getConnectionLabel($focusedConnectionOrDatabase?.connection)}`}
|
<FormStyledButton
|
||||||
skipWidth
|
value={`Connect to ${getConnectionLabel($focusedConnectionOrDatabase?.connection)}`}
|
||||||
on:click={() => openConnection($focusedConnectionOrDatabase?.connection)}
|
skipWidth
|
||||||
/>
|
on:click={() => openConnection($focusedConnectionOrDatabase?.connection)}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
<FormStyledButton
|
<FormStyledButton
|
||||||
value={`Show ${getConnectionLabel($connection)}`}
|
value={`Show ${getConnectionLabel($connection)}`}
|
||||||
skipWidth
|
skipWidth
|
||||||
|
|||||||
Reference in New Issue
Block a user