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" }] }