feat: Introduce application version display in the frontend footer, showing both frontend and backend versions with integrated build arguments.
All checks were successful
Release and Build Docker Images / release-and-build (push) Successful in 1m29s

This commit is contained in:
almazlar
2026-02-21 10:34:08 +03:00
parent bbd3beb22a
commit 37ae9dbe53
7 changed files with 91 additions and 4 deletions

View File

@@ -1,12 +1,34 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import TodoList from './components/TodoList';
import { getVersion } from './services/api';
import './App.css';
function App() {
const [backendVersion, setBackendVersion] = useState('...');
const frontendVersion = import.meta.env.VITE_APP_VERSION || 'dev';
useEffect(() => {
const fetchVersion = async () => {
try {
const data = await getVersion();
setBackendVersion(data.version || 'dev');
} catch (error) {
console.error('Error fetching backend version:', error);
setBackendVersion('unknown');
}
};
fetchVersion();
}, []);
return (
<main>
<TodoList />
</main>
<div className="app-container">
<main className="main-content">
<TodoList />
</main>
<footer className="app-footer">
<p>Frontend <code>{frontendVersion}</code> | Backend <code>{backendVersion}</code></p>
</footer>
</div>
);
}