feat(deploy): padroniza rx p/ Build Once->Promote->Deploy (CI registry, compose.prod, badge/health)
- .gitea/workflows/build.yml: push->build rx-scoreodonto:<sha> no registry; tag->promote+deploy - docker-compose.prod.yml: image do registry, APP_VERSION/GIT_COMMIT em runtime - deploy-prod.sh: VPS1 pull + up --no-build (antigo vira deploy-prod-legado-webhook.sh) - /api/health usa APP_VERSION (tag) com fallback version.txt; badge no canto - webhook 9003 aposentado (gatilho agora e CI/tag) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
|
||||
import { AuthProvider } from './contexts/AuthContext';
|
||||
import { SocketProvider } from './contexts/SocketContext';
|
||||
@@ -23,8 +24,24 @@ import UsersPage from './pages/UsersPage';
|
||||
import SyncPage from './pages/SyncPage';
|
||||
import ApiDocsPage from './pages/ApiDocsPage';
|
||||
|
||||
// Versão fixa no canto inferior direito (padrão da stack — lê /api/health; não bloqueia cliques).
|
||||
function VersionBadge() {
|
||||
const [ver, setVer] = useState('');
|
||||
useEffect(() => {
|
||||
fetch('/api/health').then(r => (r.ok ? r.json() : null))
|
||||
.then(v => { if (v && v.version) setVer(v.version); }).catch(() => {});
|
||||
}, []);
|
||||
if (!ver) return null;
|
||||
return (
|
||||
<div style={{ position: 'fixed', bottom: 6, right: 8, zIndex: 40, pointerEvents: 'none', userSelect: 'none', fontSize: 10, fontFamily: 'monospace', color: 'rgba(120,120,120,0.7)' }}>
|
||||
v{ver}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<>
|
||||
<BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<AuthProvider>
|
||||
<ToastProvider>
|
||||
@@ -145,5 +162,7 @@ export default function App() {
|
||||
</ToastProvider>
|
||||
</AuthProvider>
|
||||
</BrowserRouter>
|
||||
<VersionBadge />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user