From 1178e539f42addba57ce7fa12acd1d89fce35985 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 9 Feb 2026 00:49:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A0=E9=99=90=E7=94=BB?= =?UTF-8?q?=E5=B8=83=E4=B8=BA=E6=B2=89=E6=B5=B8=E5=B8=83=E5=B1=80=E5=B9=B6?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E4=BE=A7=E6=A0=8F=E5=93=81=E7=89=8C=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/canvas/[id]/layout.tsx | 50 +------------------------------------- app/canvas/[id]/page.tsx | 36 ++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 50 deletions(-) diff --git a/app/canvas/[id]/layout.tsx b/app/canvas/[id]/layout.tsx index 193132a..c7ce48b 100644 --- a/app/canvas/[id]/layout.tsx +++ b/app/canvas/[id]/layout.tsx @@ -1,9 +1,5 @@ import { Metadata } from "next"; import { Suspense } from "react"; -import { cookies } from "next/headers"; -import { auth } from "@/app/(auth)/auth"; -import { TopNavbar } from "@/components/top-navbar"; -import { getSiteSettings, getNavLinks, getTutorialVideos } from "@/lib/db/queries"; export const metadata: Metadata = { title: "无限画布", @@ -17,51 +13,7 @@ export default function CanvasEditorLayout({ }) { return ( }> - {children} +
{children}
); } - -async function CanvasLayoutWrapper({ children }: { children: React.ReactNode }) { - const [session, siteSettings, navLinks, tutorialVideos] = await Promise.all([ - auth(), - getSiteSettings(), - getNavLinks(), - getTutorialVideos(), - ]); - - return ( -
- ({ - id: link.id, - name: link.name, - url: link.url, - order: link.order, - toolboxGroup: link.toolboxGroup || 1, - }))} - toolbox1Name={siteSettings.toolbox1Name || "工具箱"} - toolbox1Enabled={siteSettings.toolbox1Enabled ?? true} - toolbox2Name={siteSettings.toolbox2Name || "工具箱2"} - toolbox2Enabled={siteSettings.toolbox2Enabled ?? false} - tutorialVideos={tutorialVideos.map(v => ({ - id: v.id, - title: v.title, - videoUrl: v.videoUrl, - coverUrl: v.coverUrl, - description: v.description, - order: v.order, - }))} - tutorialEnabled={siteSettings.tutorialEnabled ?? false} - rankingEnabled={siteSettings.rankingEnabled ?? true} - /> -
- {children} -
-
- ); -} diff --git a/app/canvas/[id]/page.tsx b/app/canvas/[id]/page.tsx index 1d05b88..2901db3 100644 --- a/app/canvas/[id]/page.tsx +++ b/app/canvas/[id]/page.tsx @@ -2,6 +2,7 @@ import { useEffect, useState, useCallback, use } from "react"; import { useRouter, useParams } from "next/navigation"; +import useSWR from "swr"; import { ArrowLeft, Save, @@ -65,7 +66,7 @@ import { CanvasChatPanel } from "@/components/canvas/CanvasChatPanel"; import { CanvasFileListPanel } from "@/components/canvas/CanvasFileListPanel"; import { ObjectPickerOverlay } from "@/components/canvas/ObjectPickerOverlay"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { cn } from "@/lib/utils"; +import { cn, fetcher } from "@/lib/utils"; import { MessageSquare, FolderOpen, Grid2X2 } from "lucide-react"; interface PageProps { @@ -122,6 +123,12 @@ export default function CanvasEditorPage({ params }: PageProps) { const [isPanelOpen, setIsPanelOpen] = useState(true); // 面板模式: 'chat' 聊天面板, 'fileList' 文件列表 const [panelMode, setPanelMode] = useState<'chat' | 'fileList'>('chat'); + + const { data: siteSettingsData } = useSWR<{ + siteName?: string; + siteLogo?: string | null; + siteLogoDark?: string | null; + }>("/api/site-settings", fetcher); // 生成配置 const [prompt, setPrompt] = useState(""); @@ -572,6 +579,33 @@ export default function CanvasEditorPage({ params }: PageProps) { {/* 5. Floating Bottom Toolbar (Left) */}
+ + + + + 返回首页 + + + + {/* Tools: Select, Pan, Add Text, Add Image, Add Video */}