diff --git a/tone-page-web/app/console/page.tsx b/tone-page-web/app/console/(with-menu)/layout.tsx similarity index 50% rename from tone-page-web/app/console/page.tsx rename to tone-page-web/app/console/(with-menu)/layout.tsx index 240524a..83eb31c 100644 --- a/tone-page-web/app/console/page.tsx +++ b/tone-page-web/app/console/(with-menu)/layout.tsx @@ -2,19 +2,20 @@ import { AppSidebar } from "@/components/app-sidebar" import { Breadcrumb, BreadcrumbItem, - BreadcrumbLink, BreadcrumbList, BreadcrumbPage, - BreadcrumbSeparator, } from "@/components/ui/breadcrumb" -import { Separator } from "@/components/ui/separator" import { SidebarInset, SidebarProvider, SidebarTrigger, } from "@/components/ui/sidebar" -export default function Page() { +export default function ConsoleMenuLayout({ + children, +}: { + children: React.ReactNode +}) { return ( @@ -22,29 +23,23 @@ export default function Page() {
- +
- - - Building Your Application - - - - Data Fetching + + {new Intl.DateTimeFormat('en-US', { + year: 'numeric', + month: 'long' + }).format(new Date())} +
-
-
-
-
-
-
+ {children}
diff --git a/tone-page-web/app/console/(with-menu)/page.tsx b/tone-page-web/app/console/(with-menu)/page.tsx new file mode 100644 index 0000000..136b4fe --- /dev/null +++ b/tone-page-web/app/console/(with-menu)/page.tsx @@ -0,0 +1,3 @@ +export default function Page() { + return
console
+} \ No newline at end of file diff --git a/tone-page-web/app/console/(with-menu)/storage/page.tsx b/tone-page-web/app/console/(with-menu)/storage/page.tsx new file mode 100644 index 0000000..fd727f1 --- /dev/null +++ b/tone-page-web/app/console/(with-menu)/storage/page.tsx @@ -0,0 +1,5 @@ +export default function Page() { + return ( +
storage
+ ) +} \ No newline at end of file diff --git a/tone-page-web/app/console/(with-menu)/user/page.tsx b/tone-page-web/app/console/(with-menu)/user/page.tsx new file mode 100644 index 0000000..3995d69 --- /dev/null +++ b/tone-page-web/app/console/(with-menu)/user/page.tsx @@ -0,0 +1,5 @@ +export default function Page() { + return ( +
user
+ ) +} \ No newline at end of file diff --git a/tone-page-web/app/console/(with-menu)/user/role/page.tsx b/tone-page-web/app/console/(with-menu)/user/role/page.tsx new file mode 100644 index 0000000..3ab9dc7 --- /dev/null +++ b/tone-page-web/app/console/(with-menu)/user/role/page.tsx @@ -0,0 +1,5 @@ +export default function Page() { + return ( +
role
+ ) +} \ No newline at end of file diff --git a/tone-page-web/app/console/(with-menu)/vserver/page.tsx b/tone-page-web/app/console/(with-menu)/vserver/page.tsx new file mode 100644 index 0000000..c3ab1cc --- /dev/null +++ b/tone-page-web/app/console/(with-menu)/vserver/page.tsx @@ -0,0 +1,5 @@ +export default function Page() { + return ( +
vserver
+ ) +} \ No newline at end of file diff --git a/tone-page-web/app/console/(with-menu)/vspace/page.tsx b/tone-page-web/app/console/(with-menu)/vspace/page.tsx new file mode 100644 index 0000000..07c8007 --- /dev/null +++ b/tone-page-web/app/console/(with-menu)/vspace/page.tsx @@ -0,0 +1,5 @@ +export default function Page() { + return ( +
vspace
+ ) +} \ No newline at end of file diff --git a/tone-page-web/app/console/(with-menu)/web/blog/page.tsx b/tone-page-web/app/console/(with-menu)/web/blog/page.tsx new file mode 100644 index 0000000..3279ab0 --- /dev/null +++ b/tone-page-web/app/console/(with-menu)/web/blog/page.tsx @@ -0,0 +1,7 @@ +export default function Page() { + return ( + <> + Blog + + ) +} \ No newline at end of file diff --git a/tone-page-web/app/console/(with-menu)/web/resource/page.tsx b/tone-page-web/app/console/(with-menu)/web/resource/page.tsx new file mode 100644 index 0000000..ecc0b0a --- /dev/null +++ b/tone-page-web/app/console/(with-menu)/web/resource/page.tsx @@ -0,0 +1,7 @@ +export default function Page() { + return ( + <> + resource + + ) +} \ No newline at end of file diff --git a/tone-page-web/components/app-sidebar.tsx b/tone-page-web/components/app-sidebar.tsx index 94ad3a0..70a7080 100644 --- a/tone-page-web/components/app-sidebar.tsx +++ b/tone-page-web/components/app-sidebar.tsx @@ -2,30 +2,27 @@ import * as React from "react" import { - AudioWaveform, - BookOpen, - Bot, - Command, - Frame, - GalleryVerticalEnd, - Map, - PieChart, - Settings2, + CloudUpload, + Inbox, + Server, SquareTerminal, + UsersRound, } from "lucide-react" import { NavMain } from "@/components/nav-main" -import { NavProjects } from "@/components/nav-projects" import { NavUser } from "@/components/nav-user" -import { TeamSwitcher } from "@/components/team-switcher" import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, SidebarRail, } from "@/components/ui/sidebar" - +import { useRouter } from "next/navigation" +import Link from "next/link" // This is sample data. const data = { user: { @@ -33,125 +30,51 @@ const data = { email: "m@example.com", avatar: "/avatars/shadcn.jpg", }, - teams: [ - { - name: "Acme Inc", - logo: GalleryVerticalEnd, - plan: "Enterprise", - }, - { - name: "Acme Corp.", - logo: AudioWaveform, - plan: "Startup", - }, - { - name: "Evil Corp.", - logo: Command, - plan: "Free", - }, - ], navMain: [ { - title: "Playground", - url: "#", + title: "网站管理", + url: "/console/web", icon: SquareTerminal, - isActive: true, items: [ { - title: "History", - url: "#", + title: "资源", + url: "/console/web/resource", }, { - title: "Starred", - url: "#", - }, - { - title: "Settings", - url: "#", + title: "博客", + url: "/console/web/blog", }, ], }, { - title: "Models", - url: "#", - icon: Bot, + title: "用户管理", + url: "/console/user", + icon: UsersRound, items: [ { - title: "Genesis", - url: "#", + title: "用户", + url: "/console/user", }, { - title: "Explorer", - url: "#", - }, - { - title: "Quantum", - url: "#", + title: "角色/权限", + url: "/console/user/role", }, ], }, { - title: "Documentation", - url: "#", - icon: BookOpen, - items: [ - { - title: "Introduction", - url: "#", - }, - { - title: "Get Started", - url: "#", - }, - { - title: "Tutorials", - url: "#", - }, - { - title: "Changelog", - url: "#", - }, - ], + title: "文件存储", + url: "/console/storage", + icon: CloudUpload, }, { - title: "Settings", - url: "#", - icon: Settings2, - items: [ - { - title: "General", - url: "#", - }, - { - title: "Team", - url: "#", - }, - { - title: "Billing", - url: "#", - }, - { - title: "Limits", - url: "#", - }, - ], - }, - ], - projects: [ - { - name: "Design Engineering", - url: "#", - icon: Frame, + title: "虚拟云空间", + url: "/console/vspace", + icon: Inbox, }, { - name: "Sales & Marketing", - url: "#", - icon: PieChart, - }, - { - name: "Travel", - url: "#", - icon: Map, + title: "虚拟主机", + url: "/console/vserver", + icon: Server, }, ], } @@ -160,11 +83,26 @@ export function AppSidebar({ ...props }: React.ComponentProps) { return ( - + + + + +
+
+ +
+
+ 特恩的日志 - 控制台 + v1.0.0 +
+
+
+ +
+
- diff --git a/tone-page-web/components/nav-main.tsx b/tone-page-web/components/nav-main.tsx index 1d71af1..dd5e19d 100644 --- a/tone-page-web/components/nav-main.tsx +++ b/tone-page-web/components/nav-main.tsx @@ -17,6 +17,9 @@ import { SidebarMenuSubButton, SidebarMenuSubItem, } from "@/components/ui/sidebar" +import Link from "next/link" +import { usePathname } from "next/navigation" +import { useState, useEffect } from "react" export function NavMain({ items, @@ -34,38 +37,50 @@ export function NavMain({ }) { return ( - Platform + 菜单 {items.map((item) => ( - - - - - {item.icon && } - {item.title} - + (item.items && item.items.length > 0) + ? ( + + + + + {item.icon && } + {item.title} + + + + + + {item.items?.map((subItem) => ( + + + + {subItem.title} + + + + ))} + + + + + ) : ( + + + + {item.icon && } + {item.title} + - - - - {item.items?.map((subItem) => ( - - - - {subItem.title} - - - - ))} - - - - + + ) ))} diff --git a/tone-page-web/components/nav-projects.tsx b/tone-page-web/components/nav-projects.tsx deleted file mode 100644 index f50b20d..0000000 --- a/tone-page-web/components/nav-projects.tsx +++ /dev/null @@ -1,89 +0,0 @@ -"use client" - -import { - Folder, - Forward, - MoreHorizontal, - Trash2, - type LucideIcon, -} from "lucide-react" - -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu" -import { - SidebarGroup, - SidebarGroupLabel, - SidebarMenu, - SidebarMenuAction, - SidebarMenuButton, - SidebarMenuItem, - useSidebar, -} from "@/components/ui/sidebar" - -export function NavProjects({ - projects, -}: { - projects: { - name: string - url: string - icon: LucideIcon - }[] -}) { - const { isMobile } = useSidebar() - - return ( - - Projects - - {projects.map((item) => ( - - - - - {item.name} - - - - - - - More - - - - - - View Project - - - - Share Project - - - - - Delete Project - - - - - ))} - - - - More - - - - - ) -} diff --git a/tone-page-web/components/team-switcher.tsx b/tone-page-web/components/team-switcher.tsx deleted file mode 100644 index 083e9ec..0000000 --- a/tone-page-web/components/team-switcher.tsx +++ /dev/null @@ -1,91 +0,0 @@ -"use client" - -import * as React from "react" -import { ChevronsUpDown, Plus } from "lucide-react" - -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu" -import { - SidebarMenu, - SidebarMenuButton, - SidebarMenuItem, - useSidebar, -} from "@/components/ui/sidebar" - -export function TeamSwitcher({ - teams, -}: { - teams: { - name: string - logo: React.ElementType - plan: string - }[] -}) { - const { isMobile } = useSidebar() - const [activeTeam, setActiveTeam] = React.useState(teams[0]) - - if (!activeTeam) { - return null - } - - return ( - - - - - -
- -
-
- {activeTeam.name} - {activeTeam.plan} -
- -
-
- - - Teams - - {teams.map((team, index) => ( - setActiveTeam(team)} - className="gap-2 p-2" - > -
- -
- {team.name} - ⌘{index + 1} -
- ))} - - -
- -
-
Add team
-
-
-
-
-
- ) -} diff --git a/tone-page-web/next.config.ts b/tone-page-web/next.config.ts index 34b5c62..5c971d2 100644 --- a/tone-page-web/next.config.ts +++ b/tone-page-web/next.config.ts @@ -2,6 +2,10 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ + reactStrictMode: true, + devIndicators: { + position: 'bottom-right', + }, async rewrites() { return [ {