From 20af81a5dc92fdce4ee461b3a23e5b8a45adffa9 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Thu, 2 Apr 2026 22:42:06 +0200 Subject: [PATCH] feat: show server version in sidebar header Version injected at build time via VITE_APP_VERSION env var. CI sets it to branch@sha. Falls back to 'dev' in local dev. Displayed next to "Cameleer" in the sidebar header. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/ci.yml | 1 + ui/src/components/LayoutShell.tsx | 1 + ui/src/vite-env.d.ts | 2 ++ ui/vite.config.ts | 3 +++ 4 files changed, 7 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 558694c4..582560f0 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -53,6 +53,7 @@ jobs: npm run build env: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + VITE_APP_VERSION: ${{ github.ref_name }}@${{ github.sha }} - name: Build and Test run: mvn clean verify -DskipITs -U --batch-mode diff --git a/ui/src/components/LayoutShell.tsx b/ui/src/components/LayoutShell.tsx index 6430d8f7..1551ecfc 100644 --- a/ui/src/components/LayoutShell.tsx +++ b/ui/src/components/LayoutShell.tsx @@ -500,6 +500,7 @@ function LayoutContent() { {/* Applications section */} diff --git a/ui/src/vite-env.d.ts b/ui/src/vite-env.d.ts index 11f02fe2..dbb4c627 100644 --- a/ui/src/vite-env.d.ts +++ b/ui/src/vite-env.d.ts @@ -1 +1,3 @@ /// + +declare const __APP_VERSION__: string; diff --git a/ui/vite.config.ts b/ui/vite.config.ts index 4c5e1017..db5bbe6a 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -6,6 +6,9 @@ import react from '@vitejs/plugin-react'; const apiTarget = process.env.VITE_API_TARGET || 'http://localhost:8081'; export default defineConfig({ + define: { + __APP_VERSION__: JSON.stringify(process.env.VITE_APP_VERSION || 'dev'), + }, plugins: [react()], server: { proxy: {