From 3ba62af01a071df47a552356b9a77ed53b306628 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Thu, 7 Aug 2025 19:01:31 +0200 Subject: [PATCH] Add VITE_APP_VERSION to environment and update SystemInfoDialog to display version --- .github/workflows/release.yaml | 2 ++ webui/src/components/SystemInfoDialog.tsx | 24 +++++++++++++++++++++-- webui/src/vite-env.d.ts | 13 ++++++++++++ webui/tsconfig.json | 5 +++-- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 webui/src/vite-env.d.ts diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 03fe435..3da0edf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -29,6 +29,8 @@ jobs: npm ci - name: Build Web UI + env: + VITE_APP_VERSION: ${{ github.ref_name }} run: | cd webui npm run build diff --git a/webui/src/components/SystemInfoDialog.tsx b/webui/src/components/SystemInfoDialog.tsx index 2b24a0a..8eb03f5 100644 --- a/webui/src/components/SystemInfoDialog.tsx +++ b/webui/src/components/SystemInfoDialog.tsx @@ -19,6 +19,15 @@ import { } from 'lucide-react' import { serverApi } from '@/lib/api' +// Helper to get version from environment +const getAppVersion = (): string => { + try { + return (import.meta.env as Record).VITE_APP_VERSION || 'unknown' + } catch { + return 'unknown' + } +} + interface SystemInfoModalProps { open: boolean onOpenChange: (open: boolean) => void @@ -109,9 +118,20 @@ const SystemInfoDialog: React.FC = ({ ) : systemInfo ? (
- {/* Version Section */} + {/* Llamactl Version Section */}
-

Version

+

Llamactl Version

+ +
+
+                    {getAppVersion()}
+                  
+
+
+ + {/* Llama Server Version Section */} +
+

Llama Server Version

diff --git a/webui/src/vite-env.d.ts b/webui/src/vite-env.d.ts new file mode 100644 index 0000000..3a1fe33 --- /dev/null +++ b/webui/src/vite-env.d.ts @@ -0,0 +1,13 @@ +/// + +declare global { + interface ImportMetaEnv { + readonly VITE_APP_VERSION?: string + } + + interface ImportMeta { + readonly env: ImportMetaEnv + } +} + +export {} diff --git a/webui/tsconfig.json b/webui/tsconfig.json index c20738e..2eed951 100644 --- a/webui/tsconfig.json +++ b/webui/tsconfig.json @@ -18,8 +18,9 @@ "baseUrl": ".", "paths": { "@/*": ["./src/*"] - } + }, + "types": ["vite/client"] }, - "include": ["src"], + "include": ["src", "src/vite-env.d.ts"], "references": [{ "path": "./tsconfig.node.json" }] }