server version in statusbar

This commit is contained in:
Jan Prochazka 2021-04-25 12:08:47 +02:00
parent 67e1913683
commit d0cbd5d0a4
2 changed files with 18 additions and 1 deletions

View File

@ -19,6 +19,7 @@
'icon sql-generator': 'mdi mdi-cog-transfer',
'icon keyboard': 'mdi mdi-keyboard-settings',
'icon settings': 'mdi mdi-cog',
'icon version': 'mdi mdi-ticket-confirmation',
'icon database': 'mdi mdi-database',
'icon server': 'mdi mdi-server',

View File

@ -15,11 +15,12 @@
import FontIcon from '../icons/FontIcon.svelte';
import { activeTabId, currentDatabase } from '../stores';
import { useDatabaseStatus } from '../utility/metadataLoaders';
import { useDatabaseServerVersion, useDatabaseStatus } from '../utility/metadataLoaders';
$: databaseName = $currentDatabase && $currentDatabase.name;
$: connection = $currentDatabase && $currentDatabase.connection;
$: status = useDatabaseStatus(connection ? { conid: connection._id, database: databaseName } : {});
$: serverVersion = useDatabaseServerVersion(connection ? { conid: connection._id, database: databaseName } : {});
$: contextItems = $statusBarTabInfo[$activeTabId] as any[];
</script>
@ -60,6 +61,14 @@
<FontIcon icon="icon disconnected" /> Not connected
</div>
{/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 class="container">
{#each contextItems || [] as item}
@ -86,4 +95,11 @@
.item {
padding: 2px 10px;
}
.version {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>