From fbaddf545f282bbf9c2a9107c905e6fe220a83c5 Mon Sep 17 00:00:00 2001 From: Asuka <15019597+asuka-civil@user.noreply.gitee.com> Date: Thu, 19 Jun 2025 16:07:40 +0800 Subject: [PATCH] 6.19 --- src/app/dashboard/page.tsx | 4 +- src/app/layout.tsx | 3 +- src/components/nav-projects.tsx | 2 +- src/components/sidebar/app-sidebar.tsx | 9 +- src/components/sidebar/teacher-sidebar.tsx | 132 +++++++++++++++++++++ 5 files changed, 142 insertions(+), 8 deletions(-) create mode 100644 src/components/sidebar/teacher-sidebar.tsx diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index a6876ff..37f7e40 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,4 +1,4 @@ -import { AppSidebar } from "@/components/sidebar/app-sidebar" +import { TeacherSidebar } from "@/components/sidebar/teacher-sidebar" import { Breadcrumb, BreadcrumbItem, @@ -17,7 +17,7 @@ import { export default function Page() { return ( - +
diff --git a/src/app/layout.tsx b/src/app/layout.tsx index d50795c..7726dce 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,6 +6,7 @@ import { NextIntlClientProvider } from "next-intl"; import { ThemeProvider } from "@/components/theme-provider"; import { SettingsDialog } from "@/components/settings-dialog"; + export const metadata: Metadata = { title: "Judge4c", description: @@ -37,4 +38,4 @@ export default async function RootLayout({ children }: RootLayoutProps) { ); -} +} \ No newline at end of file diff --git a/src/components/nav-projects.tsx b/src/components/nav-projects.tsx index b5df78e..b8584c3 100644 --- a/src/components/nav-projects.tsx +++ b/src/components/nav-projects.tsx @@ -155,4 +155,4 @@ export function NavProjects({ ) -} +} \ No newline at end of file diff --git a/src/components/sidebar/app-sidebar.tsx b/src/components/sidebar/app-sidebar.tsx index 24b2d7c..f0ef9ee 100644 --- a/src/components/sidebar/app-sidebar.tsx +++ b/src/components/sidebar/app-sidebar.tsx @@ -27,6 +27,7 @@ import { SidebarMenuItem, } from "@/components/ui/sidebar" + const data = { user: { name: "shadcn", @@ -42,7 +43,7 @@ const data = { items: [ { title: "主页", - url: "/dashboard", + url: "/student/dashboard", }, { title: "历史记录", @@ -92,12 +93,12 @@ const data = { ], navSecondary: [ { - title: "Support", + title: "帮助", url: "/", icon: LifeBuoy, }, { - title: "Feedback", + title: "反馈", url: siteConfig.url.repo.github, icon: Send, }, @@ -151,4 +152,4 @@ export function AppSidebar({ ...props }: React.ComponentProps) { ) -} +} \ No newline at end of file diff --git a/src/components/sidebar/teacher-sidebar.tsx b/src/components/sidebar/teacher-sidebar.tsx new file mode 100644 index 0000000..908dd1e --- /dev/null +++ b/src/components/sidebar/teacher-sidebar.tsx @@ -0,0 +1,132 @@ +"use client" +import { siteConfig } from "@/config/site" +import * as React from "react" +import { + BookOpen, + Command, + Frame, + LifeBuoy, + Map, + PieChart, + Send, + Settings2, + SquareTerminal, +} from "lucide-react" + +import { NavMain } from "@/components/nav-main" +import { NavProjects } from "@/components/nav-projects" +import { NavSecondary } from "@/components/nav-secondary" +import { NavUser } from "@/components/nav-user" +import { + Sidebar, + SidebarContent, + SidebarFooter, + SidebarHeader, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, +} from "@/components/ui/sidebar" + +const data = { + user: { + name: "teacher", + email: "teacher@example.com", + avatar: "/avatars/teacher.jpg", + }, + navMain: [ + { + title: "教师首页", + url: "/teacher/dashboard", + icon: SquareTerminal, + isActive: true, + items: [ + { + title: "课程管理", + url: "/teacher/courses", + }, + { + title: "学生管理", + url: "/teacher/students", + }, + { + title: "题库管理", + url: "/teacher/problems", + }, + ], + }, + { + title: "统计分析", + url: "/teacher/statistics", + icon: PieChart, + items: [ + { + title: "成绩统计", + url: "/teacher/statistics/grades", + }, + { + title: "错题分析", + url: "/teacher/statistics/activity", + }, + ], + }, + { + title: "设置", + url: "#", + icon: Settings2, + items: [ + { + title: "一般设置", + url: "/teacher/profile", + }, + { + title: "语言", + url: "/teacher/settings", + }, + ], + }, + ], + navSecondary: [ + { + title: "帮助", + url: "/", + icon: LifeBuoy, + }, + { + title: "反馈", + url: siteConfig.url.repo.github, + icon: Send, + }, + ], +} + +export function TeacherSidebar({ ...props }: React.ComponentProps) { + return ( + + + + + + +
+ +
+
+ Judge4c 教师端 + Teaching Platform +
+
+
+
+
+
+ + + {/* 教师端可自定义更多内容 */} + + + + + +
+ ) +}