Skip to content

Commit 9bae8ff

Browse files
authored
Merge pull request #312 from fractal-analytics-platform/footer-version
Displayed fractal-web version in the footer
2 parents f61d59f + 57b1c99 commit 9bae8ff

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Unreleased
44

5+
* Added fractal-web version to the footer (\#312).
56
* Added new modal for create/update dataset feature (\#310).
67
* Standardized modal management to fix some bugs (\#306).
78
* Added proxy endpoints and refactored error propagation (\#288).

src/routes/+layout.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
55
$: userLoggedIn = !!$page.data.userInfo;
66
$: server = $page.data.serverInfo || {};
7+
// @ts-ignore
8+
// eslint-disable-next-line no-undef
9+
let clientVersion = __APP_VERSION__;
710
811
// Detects page change
912
$: if ($navigating) cleanupModalBackdrop();
@@ -59,7 +62,9 @@
5962
>
6063
<div class="col d-flex justify-content-center">
6164
<div class="hstack gap-3">
62-
<span class="font-monospace">{server.version}</span>
65+
<span class="font-monospace">
66+
fractal-server {server.version}, fractal-web {clientVersion}
67+
</span>
6368
</div>
6469
</div>
6570
</footer>

vite.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import { sveltekit } from '@sveltejs/kit/vite';
2+
import { readFileSync } from 'fs';
3+
import { fileURLToPath } from 'url';
4+
5+
const packageJsonFile = fileURLToPath(new URL('package.json', import.meta.url));
6+
const packageJsonData = readFileSync(packageJsonFile);
7+
const pkg = JSON.parse(packageJsonData);
28

39
/** @type {import('vite').UserConfig} */
410
const config = {
511
plugins: [sveltekit()],
12+
define: {
13+
__APP_VERSION__: JSON.stringify(pkg.version)
14+
},
615
test: {
716
globals: true,
817
include: ['**/__tests__/**/*.?(c|m)[jt]s?(x)']

0 commit comments

Comments
 (0)