From ae403a6ba0293994a64f55af25b1dec4697afe34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aleksa=20Siri=C5=A1ki?=
<31509435+aleksasiriski@users.noreply.github.com>
Date: Fri, 21 Jun 2024 00:36:52 +0200
Subject: [PATCH 1/4] feat: agent version in footer
---
src/lib/components/footer/main.svelte | 17 +++++++++++-
src/lib/functions/api/fetchversion.js | 37 +++++++++++++++++++++++++++
src/routes/+layout.js | 9 +++++++
src/routes/+layout.svelte | 5 +++-
src/routes/search/+page.js | 1 -
src/routes/search/+page.svelte | 2 --
6 files changed, 66 insertions(+), 5 deletions(-)
create mode 100644 src/lib/functions/api/fetchversion.js
create mode 100644 src/routes/+layout.js
diff --git a/src/lib/components/footer/main.svelte b/src/lib/components/footer/main.svelte
index 4e39d690..dd548b00 100644
--- a/src/lib/components/footer/main.svelte
+++ b/src/lib/components/footer/main.svelte
@@ -1,10 +1,25 @@
+
+
diff --git a/src/routes/+layout.js b/src/routes/+layout.js
index ac251094..431aeaec 100644
--- a/src/routes/+layout.js
+++ b/src/routes/+layout.js
@@ -1,9 +1,11 @@
+import { PUBLIC_UI_VERSION } from '$env/static/public';
import { fetchVersion } from '$lib/functions/api/fetchversion';
/** @type {import('./$types').LayoutLoad} */
export async function load({ fetch }) {
const apiVersion = await fetchVersion(fetch);
return {
+ uiVersion: PUBLIC_UI_VERSION ?? 'dev',
apiVersion: apiVersion
};
}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 45747691..256c46dc 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -5,6 +5,7 @@
import Footer from '$lib/components/footer/main.svelte';
let { data } = $props();
+ const uiVersion = $derived(data.uiVersion);
const apiVersion = $derived(data.apiVersion);
@@ -18,4 +19,4 @@
- UI ver: {uiVersion.replace(/\;$/, '')} | Agent ver: {apiVersion.replace(/\;$/, '')} + UI ver: {uiVersion} | Agent ver: {apiVersion.replace(/;$/, '')}