diff --git a/frontend/app/home-dock.tsx b/frontend/app/home-dock.tsx
new file mode 100644
index 0000000..b6dd2ab
--- /dev/null
+++ b/frontend/app/home-dock.tsx
@@ -0,0 +1,74 @@
+"use client";
+
+import { Dock, DockIcon } from "@/components/ui/dock";
+import { signOut } from "next-auth/react";
+import { Home, User, LogOut, Download, BookOpen, LayoutDashboard } from "lucide-react";
+
+export function HomeDock({
+ isAuthenticated,
+ onLoginClick,
+}: {
+ isAuthenticated: boolean;
+ onLoginClick?: () => void;
+}) {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {isAuthenticated && (
+
+
+
+
+
+ )}
+
+ {isAuthenticated ? (
+
+ ) : (
+
+ )}
+
+
+
+ );
+}
diff --git a/frontend/app/home-page-client.tsx b/frontend/app/home-page-client.tsx
new file mode 100644
index 0000000..6eeb421
--- /dev/null
+++ b/frontend/app/home-page-client.tsx
@@ -0,0 +1,76 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { useSearchParams } from "next/navigation";
+import { BlurFade } from "@/components/magicui/blur-fade";
+import { HomeDock } from "./home-dock";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
+import { LoginForm } from "./login/login-form";
+
+export function HomePageClient({
+ isAuthenticated,
+ healthText,
+ hasKeycloak,
+}: {
+ isAuthenticated: boolean;
+ healthText: string;
+ hasKeycloak: boolean;
+}) {
+ const searchParams = useSearchParams();
+ const [loginOpen, setLoginOpen] = useState(false);
+
+ useEffect(() => {
+ if (searchParams.get("login") === "1" && !isAuthenticated) {
+ setLoginOpen(true);
+ }
+ }, [searchParams, isAuthenticated]);
+
+ return (
+
+
+
+ EvanPage
+
+
+
+
+
+ 全栈基础框架
+
+
+
+
+
+
+ 后端状态
+
+
+ {healthText}
+
+
+
+
+
!isAuthenticated && setLoginOpen(true)}
+ />
+
+
+
+ );
+}
diff --git a/frontend/app/login-dialog.tsx b/frontend/app/login-dialog.tsx
new file mode 100644
index 0000000..6224847
--- /dev/null
+++ b/frontend/app/login-dialog.tsx
@@ -0,0 +1,38 @@
+"use client";
+
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+import { LoginForm } from "./login/login-form";
+import { ReactNode, useState } from "react";
+
+export function LoginDialog({
+ hasKeycloak,
+ children,
+}: {
+ hasKeycloak: boolean;
+ children?: ReactNode;
+}) {
+ const [open, setOpen] = useState(false);
+
+ return (
+
+ );
+}
diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx
index 887811e..c7ca538 100644
--- a/frontend/app/page.tsx
+++ b/frontend/app/page.tsx
@@ -1,8 +1,14 @@
-import { BlurFade } from "@/components/magicui/blur-fade";
+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 {
@@ -19,46 +25,12 @@ export default async function HomePage() {
}
return (
-
-
-
- EvanPage
-
-
-
-
-
- 全栈基础框架
-
-
-
-
-
-
- 后端状态
-
-
- {healthText}
-
-
-
-
-
-
-
-
+
+
+
);
}