Files
evanpage/frontend/app/page.tsx
evan 9f9f57b379 frontend: redesign homepage with magic dock and login dialog
- Replace top login/register buttons with magic dock navigation
- Add dock items: home, downloads, blog, and conditional login/logout
- Show dashboard icon in dock when authenticated
- Extract HomePageClient for client-side dialog state
2026-04-16 16:55:20 +00:00

37 lines
899 B
TypeScript

import { Suspense } from "react";
import { auth } from "@/auth";
import { HomePageClient } from "./home-page-client";
const SERVER_API_URL = process.env.SERVER_API_URL || "http://backend:8080";
const hasKeycloak = !!process.env.AUTH_KEYCLOAK_ISSUER;
export default async function HomePage() {
const session = await auth();
const isAuthenticated = !!session?.user;
let healthText = "无法连接到后端服务";
try {
const res = await fetch(`${SERVER_API_URL}/api/health`, {
cache: "no-store",
});
if (res.ok) {
healthText = await res.text();
} else {
healthText = `后端异常: ${res.status}`;
}
} catch (err) {
healthText = "后端连接失败";
}
return (
<Suspense>
<HomePageClient
isAuthenticated={isAuthenticated}
healthText={healthText}
hasKeycloak={hasKeycloak}
/>
</Suspense>
);
}