mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
server version in statusbar
This commit is contained in:
parent
67e1913683
commit
d0cbd5d0a4
@ -19,6 +19,7 @@
|
|||||||
'icon sql-generator': 'mdi mdi-cog-transfer',
|
'icon sql-generator': 'mdi mdi-cog-transfer',
|
||||||
'icon keyboard': 'mdi mdi-keyboard-settings',
|
'icon keyboard': 'mdi mdi-keyboard-settings',
|
||||||
'icon settings': 'mdi mdi-cog',
|
'icon settings': 'mdi mdi-cog',
|
||||||
|
'icon version': 'mdi mdi-ticket-confirmation',
|
||||||
|
|
||||||
'icon database': 'mdi mdi-database',
|
'icon database': 'mdi mdi-database',
|
||||||
'icon server': 'mdi mdi-server',
|
'icon server': 'mdi mdi-server',
|
||||||
|
@ -15,11 +15,12 @@
|
|||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
|
|
||||||
import { activeTabId, currentDatabase } from '../stores';
|
import { activeTabId, currentDatabase } from '../stores';
|
||||||
import { useDatabaseStatus } from '../utility/metadataLoaders';
|
import { useDatabaseServerVersion, useDatabaseStatus } from '../utility/metadataLoaders';
|
||||||
|
|
||||||
$: databaseName = $currentDatabase && $currentDatabase.name;
|
$: databaseName = $currentDatabase && $currentDatabase.name;
|
||||||
$: connection = $currentDatabase && $currentDatabase.connection;
|
$: connection = $currentDatabase && $currentDatabase.connection;
|
||||||
$: status = useDatabaseStatus(connection ? { conid: connection._id, database: databaseName } : {});
|
$: status = useDatabaseStatus(connection ? { conid: connection._id, database: databaseName } : {});
|
||||||
|
$: serverVersion = useDatabaseServerVersion(connection ? { conid: connection._id, database: databaseName } : {});
|
||||||
|
|
||||||
$: contextItems = $statusBarTabInfo[$activeTabId] as any[];
|
$: contextItems = $statusBarTabInfo[$activeTabId] as any[];
|
||||||
</script>
|
</script>
|
||||||
@ -60,6 +61,14 @@
|
|||||||
<FontIcon icon="icon disconnected" /> Not connected
|
<FontIcon icon="icon disconnected" /> Not connected
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if $serverVersion}
|
||||||
|
<div class="item flex" title={$serverVersion.version}>
|
||||||
|
<FontIcon icon="icon version" />
|
||||||
|
<div class="version ml-1">
|
||||||
|
{$serverVersion.version}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{#each contextItems || [] as item}
|
{#each contextItems || [] as item}
|
||||||
@ -86,4 +95,11 @@
|
|||||||
.item {
|
.item {
|
||||||
padding: 2px 10px;
|
padding: 2px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.version {
|
||||||
|
max-width: 200px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user