frontend: rebuild bookmark page with drag-and-drop, search, and theme system
- bookmark management with dnd-kit reordering, bulk edit, search, category filter/rename, and meta auto-fetch - migrate /bookmarks → /dashboard/bookmarks under (main) layout - homepage redesign with category grid, /-key search, dock tooltips - theme toggle + use-theme, sonner toasts, alert-dialog/skeleton, visual refresh of auth pages Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
16
frontend/app/(main)/dashboard/bookmarks/page.tsx
Normal file
16
frontend/app/(main)/dashboard/bookmarks/page.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { Metadata } from "next";
|
||||
import { redirect } from "next/navigation";
|
||||
import { auth } from "@/auth";
|
||||
import { BookmarkManager } from "./bookmark-manager";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "书签管理",
|
||||
};
|
||||
|
||||
export default async function BookmarksPage() {
|
||||
const session = await auth();
|
||||
const role = (session?.user as { role?: string } | undefined)?.role;
|
||||
if (role !== "admin") redirect("/unauthorized");
|
||||
|
||||
return <BookmarkManager />;
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
import type { Metadata } from "next";
|
||||
import { auth } from "@/auth";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Globe, ExternalLink } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "仪表盘",
|
||||
};
|
||||
|
||||
const SERVER_API_URL = process.env.SERVER_API_URL || "http://backend:8080";
|
||||
|
||||
interface Bookmark {
|
||||
@@ -65,7 +70,7 @@ export default async function DashboardPage() {
|
||||
<CardTitle>最近书签</CardTitle>
|
||||
{isAdmin && (
|
||||
<Link
|
||||
href="/bookmarks"
|
||||
href="/dashboard/bookmarks"
|
||||
className="text-sm text-primary hover:underline"
|
||||
>
|
||||
管理 →
|
||||
@@ -92,6 +97,9 @@ export default async function DashboardPage() {
|
||||
<img
|
||||
src={bm.icon}
|
||||
alt=""
|
||||
width={16}
|
||||
height={16}
|
||||
loading="lazy"
|
||||
className="size-4 object-contain"
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user