Add VITE_APP_VERSION to environment and update SystemInfoDialog to display version

This commit is contained in:
2025-08-07 19:01:31 +02:00
parent 0150429e82
commit 3ba62af01a
4 changed files with 40 additions and 4 deletions

View File

@@ -29,6 +29,8 @@ jobs:
npm ci npm ci
- name: Build Web UI - name: Build Web UI
env:
VITE_APP_VERSION: ${{ github.ref_name }}
run: | run: |
cd webui cd webui
npm run build npm run build

View File

@@ -19,6 +19,15 @@ import {
} from 'lucide-react' } from 'lucide-react'
import { serverApi } from '@/lib/api' import { serverApi } from '@/lib/api'
// Helper to get version from environment
const getAppVersion = (): string => {
try {
return (import.meta.env as Record<string, string>).VITE_APP_VERSION || 'unknown'
} catch {
return 'unknown'
}
}
interface SystemInfoModalProps { interface SystemInfoModalProps {
open: boolean open: boolean
onOpenChange: (open: boolean) => void onOpenChange: (open: boolean) => void
@@ -109,9 +118,20 @@ const SystemInfoDialog: React.FC<SystemInfoModalProps> = ({
</div> </div>
) : systemInfo ? ( ) : systemInfo ? (
<div className="space-y-6"> <div className="space-y-6">
{/* Version Section */} {/* Llamactl Version Section */}
<div className="space-y-3"> <div className="space-y-3">
<h3 className="font-semibold">Version</h3> <h3 className="font-semibold">Llamactl Version</h3>
<div className="bg-gray-900 rounded-lg p-4">
<pre className="text-sm text-gray-300 whitespace-pre-wrap font-mono">
{getAppVersion()}
</pre>
</div>
</div>
{/* Llama Server Version Section */}
<div className="space-y-3">
<h3 className="font-semibold">Llama Server Version</h3>
<div className="bg-gray-900 rounded-lg p-4"> <div className="bg-gray-900 rounded-lg p-4">
<div className="mb-2"> <div className="mb-2">

13
webui/src/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
/// <reference types="vite/client" />
declare global {
interface ImportMetaEnv {
readonly VITE_APP_VERSION?: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}
}
export {}

View File

@@ -18,8 +18,9 @@
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"]
} },
"types": ["vite/client"]
}, },
"include": ["src"], "include": ["src", "src/vite-env.d.ts"],
"references": [{ "path": "./tsconfig.node.json" }] "references": [{ "path": "./tsconfig.node.json" }]
} }