mirror of
https://github.com/massbug/judge4c.git
synced 2025-07-04 07:40:51 +00:00
6.19
This commit is contained in:
parent
dcba61b825
commit
fbaddf545f
@ -1,4 +1,4 @@
|
|||||||
import { AppSidebar } from "@/components/sidebar/app-sidebar"
|
import { TeacherSidebar } from "@/components/sidebar/teacher-sidebar"
|
||||||
import {
|
import {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
BreadcrumbItem,
|
BreadcrumbItem,
|
||||||
@ -17,7 +17,7 @@ import {
|
|||||||
export default function Page() {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
<SidebarProvider>
|
<SidebarProvider>
|
||||||
<AppSidebar />
|
<TeacherSidebar />
|
||||||
<SidebarInset>
|
<SidebarInset>
|
||||||
<header className="flex h-16 shrink-0 items-center gap-2">
|
<header className="flex h-16 shrink-0 items-center gap-2">
|
||||||
<div className="flex items-center gap-2 px-4">
|
<div className="flex items-center gap-2 px-4">
|
||||||
|
@ -6,6 +6,7 @@ import { NextIntlClientProvider } from "next-intl";
|
|||||||
import { ThemeProvider } from "@/components/theme-provider";
|
import { ThemeProvider } from "@/components/theme-provider";
|
||||||
import { SettingsDialog } from "@/components/settings-dialog";
|
import { SettingsDialog } from "@/components/settings-dialog";
|
||||||
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Judge4c",
|
title: "Judge4c",
|
||||||
description:
|
description:
|
||||||
@ -37,4 +38,4 @@ export default async function RootLayout({ children }: RootLayoutProps) {
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -155,4 +155,4 @@ export function NavProjects({
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -27,6 +27,7 @@ import {
|
|||||||
SidebarMenuItem,
|
SidebarMenuItem,
|
||||||
} from "@/components/ui/sidebar"
|
} from "@/components/ui/sidebar"
|
||||||
|
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
user: {
|
user: {
|
||||||
name: "shadcn",
|
name: "shadcn",
|
||||||
@ -42,7 +43,7 @@ const data = {
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
title: "主页",
|
title: "主页",
|
||||||
url: "/dashboard",
|
url: "/student/dashboard",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "历史记录",
|
title: "历史记录",
|
||||||
@ -92,12 +93,12 @@ const data = {
|
|||||||
],
|
],
|
||||||
navSecondary: [
|
navSecondary: [
|
||||||
{
|
{
|
||||||
title: "Support",
|
title: "帮助",
|
||||||
url: "/",
|
url: "/",
|
||||||
icon: LifeBuoy,
|
icon: LifeBuoy,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Feedback",
|
title: "反馈",
|
||||||
url: siteConfig.url.repo.github,
|
url: siteConfig.url.repo.github,
|
||||||
icon: Send,
|
icon: Send,
|
||||||
},
|
},
|
||||||
@ -151,4 +152,4 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|||||||
</SidebarFooter>
|
</SidebarFooter>
|
||||||
</Sidebar>
|
</Sidebar>
|
||||||
)
|
)
|
||||||
}
|
}
|
132
src/components/sidebar/teacher-sidebar.tsx
Normal file
132
src/components/sidebar/teacher-sidebar.tsx
Normal file
@ -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<typeof Sidebar>) {
|
||||||
|
return (
|
||||||
|
<Sidebar variant="inset" {...props}>
|
||||||
|
<SidebarHeader>
|
||||||
|
<SidebarMenu>
|
||||||
|
<SidebarMenuItem>
|
||||||
|
<SidebarMenuButton size="lg" asChild>
|
||||||
|
<a href="#">
|
||||||
|
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
|
||||||
|
<Command className="size-4" />
|
||||||
|
</div>
|
||||||
|
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||||
|
<span className="truncate font-semibold">Judge4c 教师端</span>
|
||||||
|
<span className="truncate text-xs">Teaching Platform</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</SidebarMenuButton>
|
||||||
|
</SidebarMenuItem>
|
||||||
|
</SidebarMenu>
|
||||||
|
</SidebarHeader>
|
||||||
|
<SidebarContent>
|
||||||
|
<NavMain items={data.navMain} />
|
||||||
|
{/* 教师端可自定义更多内容 */}
|
||||||
|
<NavSecondary items={data.navSecondary} className="mt-auto" />
|
||||||
|
</SidebarContent>
|
||||||
|
<SidebarFooter>
|
||||||
|
<NavUser user={data.user} />
|
||||||
|
</SidebarFooter>
|
||||||
|
</Sidebar>
|
||||||
|
)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user