feat: show server version in sidebar header
Version injected at build time via VITE_APP_VERSION env var. CI sets it to branch@sha. Falls back to 'dev' in local dev. Displayed next to "Cameleer" in the sidebar header. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,7 @@ jobs:
|
|||||||
npm run build
|
npm run build
|
||||||
env:
|
env:
|
||||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
VITE_APP_VERSION: ${{ github.ref_name }}@${{ github.sha }}
|
||||||
|
|
||||||
- name: Build and Test
|
- name: Build and Test
|
||||||
run: mvn clean verify -DskipITs -U --batch-mode
|
run: mvn clean verify -DskipITs -U --batch-mode
|
||||||
|
|||||||
@@ -500,6 +500,7 @@ function LayoutContent() {
|
|||||||
<Sidebar.Header
|
<Sidebar.Header
|
||||||
logo={camelLogo}
|
logo={camelLogo}
|
||||||
title="Cameleer"
|
title="Cameleer"
|
||||||
|
version={__APP_VERSION__}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Applications section */}
|
{/* Applications section */}
|
||||||
|
|||||||
2
ui/src/vite-env.d.ts
vendored
2
ui/src/vite-env.d.ts
vendored
@@ -1 +1,3 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare const __APP_VERSION__: string;
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import react from '@vitejs/plugin-react';
|
|||||||
const apiTarget = process.env.VITE_API_TARGET || 'http://localhost:8081';
|
const apiTarget = process.env.VITE_API_TARGET || 'http://localhost:8081';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
define: {
|
||||||
|
__APP_VERSION__: JSON.stringify(process.env.VITE_APP_VERSION || 'dev'),
|
||||||
|
},
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
|
|||||||
Reference in New Issue
Block a user