- Updated Nginx config to serve static SPA from web-client-new/dist/ - All API requests now proxy directly to Tracker (port 8100) - WebSocket connections go directly to Tracker with JWT auth - Stopped and disabled team-board-bff and team-board-web services - Fixed file permissions for nginx to serve static files - Migration complete: Next.js+BFF → Vite+React+Direct-Tracker
31 lines
792 B
TypeScript
31 lines
792 B
TypeScript
import { useEffect } from "react";
|
||
import { Navigate } from "react-router-dom";
|
||
import { getProjects } from "@/lib/api";
|
||
import { useState } from "react";
|
||
|
||
export default function HomePage() {
|
||
const [projects, setProjects] = useState<any[]>([]);
|
||
const [loading, setLoading] = useState(true);
|
||
|
||
useEffect(() => {
|
||
getProjects()
|
||
.then(setProjects)
|
||
.catch(() => {})
|
||
.finally(() => setLoading(false));
|
||
}, []);
|
||
|
||
if (loading) {
|
||
return (
|
||
<div className="flex h-screen items-center justify-center text-[var(--muted)]">
|
||
Загрузка...
|
||
</div>
|
||
);
|
||
}
|
||
|
||
if (projects.length === 0) {
|
||
return <Navigate to="/projects/new" replace />;
|
||
}
|
||
|
||
// Redirect to first project
|
||
return <Navigate to={`/projects/${projects[0].slug}`} replace />;
|
||
} |