feat(frontend): show UI build version on system info page
Inject the frontend package.json version at build time via Vite and render it as a dedicated "UI Version" row in System Info, alongside the existing app (backend) version returned by /system/info. When the two versions differ a warning tag is shown so users can tell at a glance that their weknora-ui image is out of sync with weknora-app (e.g. missing config fields for newer providers like SearXNG). Rename the existing version row label from "System Version" to "App Version" to distinguish it from the new UI version row in all four locales (zh-CN, en-US, ko-KR, ru-RU).
This commit is contained in:
@@ -9,6 +9,9 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const require = createRequire(import.meta.url)
|
||||
|
||||
const pkg = require('./package.json') as { version?: string }
|
||||
const FRONTEND_VERSION = pkg.version ?? 'unknown'
|
||||
|
||||
function resolveVueOfficePptxEntry(): string {
|
||||
try {
|
||||
const pkgDir = dirname(require.resolve('@vue-office/pptx/package.json'))
|
||||
@@ -25,6 +28,9 @@ function resolveVueOfficePptxEntry(): string {
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
define: {
|
||||
__FRONTEND_VERSION__: JSON.stringify(FRONTEND_VERSION),
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
|
||||
Reference in New Issue
Block a user