mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-05 16:44:22 +00:00
Add VITE_APP_VERSION to environment and update SystemInfoDialog to display version
This commit is contained in:
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -29,6 +29,8 @@ jobs:
|
||||
npm ci
|
||||
|
||||
- name: Build Web UI
|
||||
env:
|
||||
VITE_APP_VERSION: ${{ github.ref_name }}
|
||||
run: |
|
||||
cd webui
|
||||
npm run build
|
||||
|
||||
@@ -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<string, string>).VITE_APP_VERSION || 'unknown'
|
||||
} catch {
|
||||
return 'unknown'
|
||||
}
|
||||
}
|
||||
|
||||
interface SystemInfoModalProps {
|
||||
open: boolean
|
||||
onOpenChange: (open: boolean) => void
|
||||
@@ -109,9 +118,20 @@ const SystemInfoDialog: React.FC<SystemInfoModalProps> = ({
|
||||
</div>
|
||||
) : systemInfo ? (
|
||||
<div className="space-y-6">
|
||||
{/* Version Section */}
|
||||
{/* Llamactl Version Section */}
|
||||
<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="mb-2">
|
||||
|
||||
13
webui/src/vite-env.d.ts
vendored
Normal file
13
webui/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
declare global {
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_APP_VERSION?: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
@@ -18,8 +18,9 @@
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src"],
|
||||
"types": ["vite/client"]
|
||||
},
|
||||
"include": ["src", "src/vite-env.d.ts"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user