34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | {getTitle()}
42 |
43 |
44 |
45 |
46 | {!pathname?.startsWith('/manage') && (
47 | {
51 | // Warm up Manage page list without clearing existing cache (avoid loading spinner).
52 | void queryClient.prefetchInfiniteQuery({
53 | queryKey: queryKeys.images.list({ tag: '', orientation: '', format: 'all', limit: 60 }),
54 | initialPageParam: 1,
55 | queryFn: async ({ pageParam = 1 }) => {
56 | const params: Record = {
57 | page: String(pageParam),
58 | limit: '60',
59 | }
60 | const response = await api.get('/api/images', params)
61 | return response
62 | },
63 | getNextPageParam: (lastPage: ImageListResponse) => {
64 | if (lastPage.page < lastPage.totalPages) return lastPage.page + 1
65 | return undefined
66 | },
67 | })
68 | }}
69 | >
70 |
71 |
72 | )}
73 |
74 | {pathname?.startsWith('/manage') && onTagManageClick && (
75 |
78 | )}
79 |
80 | {pathname?.startsWith('/manage') && onRandomApiClick && (
81 |
84 | )}
85 |
86 |
117 |
118 |
125 |
126 |
127 | )
128 | }
129 |
--------------------------------------------------------------------------------
/app/components/ui/icons.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Image as ImageIcon,
3 | PlusCircle as PlusCircledIcon,
4 | X as Cross1Icon,
5 | MoreHorizontal as DotsHorizontalIcon,
6 | Trash2 as TrashIcon,
7 | Clipboard as ClipboardCopyIcon,
8 | Check as CheckIcon,
9 | ExternalLink as ExternalLinkIcon,
10 | Eye as EyeOpenIcon,
11 | Search as MagnifyingGlassIcon,
12 | KeyRound as LockClosedIcon,
13 | Unlink as LinkBreak2Icon,
14 | ArrowRight as ArrowRightIcon,
15 | ArrowDown as ArrowDownIcon,
16 | Clock as ClockIcon,
17 | Tags as TagIcon,
18 | Plus as PlusIcon,
19 | Minus as MinusIcon,
20 | Info as InfoCircledIcon,
21 | Share as Share1Icon,
22 | ChevronDown as CaretDownIcon,
23 | Download as DownloadIcon,
24 | CornerDownRight as EnterIcon,
25 | Maximize2 as SizeIcon,
26 | AlertTriangle as ExclamationTriangleIcon,
27 | Upload as UploadIcon,
28 | X as Cross2Icon,
29 | File as FileIcon,
30 | Settings as GearIcon,
31 | SlidersHorizontal as MixerHorizontalIcon,
32 | Calendar as CalendarIcon,
33 | ClipboardList as ClipboardIcon,
34 | Copy as CopyIcon,
35 | Move as TransformIcon,
36 | RotateCw as ReloadIcon,
37 | Moon as MoonIcon,
38 | Sun as SunIcon,
39 | Menu as HamburgerMenuIcon,
40 | ChevronRight,
41 | ChevronLeft,
42 | ChevronDown,
43 | ChevronUp,
44 | MoreVertical as DotsVerticalIcon,
45 | Mail as EnvelopeClosedIcon,
46 | User as PersonIcon,
47 | Heart as HeartIcon,
48 | Heart as HeartFilledIcon,
49 | Star as StarIcon,
50 | Star as StarFilledIcon,
51 | HelpCircle as QuestionMarkIcon,
52 | Link as Link1Icon,
53 | Link2 as Link2Icon,
54 | CreditCard as IdCardIcon,
55 | // 新增图标用于不同格式
56 | Camera as CameraIcon,
57 | Sparkles as SparklesIcon,
58 | Zap as ZapIcon,
59 | Shield as ShieldIcon,
60 | Layers as LayersIcon,
61 | Disc as DiscIcon,
62 | Hash as HashIcon,
63 | Code as CodeIcon,
64 | Archive as ArchiveIcon,
65 | Package as PackageIcon
66 | } from 'lucide-react';
67 |
68 | export {
69 | ImageIcon, // 图片图标
70 | PlusCircledIcon, // 添加图标(带圆圈)
71 | PlusIcon, // 添加图标
72 | MinusIcon, // 减号图标
73 | Cross1Icon, // 关闭/删除图标
74 | Cross2Icon, // 替代关闭图标
75 | DotsHorizontalIcon, // 更多操作图标
76 | TrashIcon, // 删除图标
77 | ClipboardCopyIcon, // 复制图标
78 | CheckIcon, // 确认/成功图标
79 | ExternalLinkIcon, // 外部链接图标
80 | EyeOpenIcon, // 查看图标
81 | MagnifyingGlassIcon, // 搜索图标
82 | LockClosedIcon, // 锁定图标
83 | LinkBreak2Icon, // 链接断开图标
84 | ArrowRightIcon, // 右箭头图标
85 | ArrowDownIcon, // 下箭头图标
86 | ClockIcon, // 时钟/计时图标
87 | TagIcon, // 标签图标
88 | InfoCircledIcon, // 信息图标
89 | Share1Icon, // 分享图标
90 | CaretDownIcon, // 下拉箭头图标
91 | DownloadIcon, // 下载图标
92 | EnterIcon, // 确认/进入图标
93 | SizeIcon, // 尺寸图标
94 | ExclamationTriangleIcon, // 警告/错误图标
95 | UploadIcon, // 上传图标
96 | FileIcon, // 文件图标
97 | GearIcon, // 设置图标
98 | MixerHorizontalIcon, // 过滤/筛选图标
99 | CalendarIcon, // 日历图标
100 | ClipboardIcon, // 剪贴板图标
101 | CopyIcon, // 复制图标
102 | TransformIcon, // 变换图标
103 | ReloadIcon, // 重新加载图标
104 | MoonIcon, // 月亮/夜间模式图标
105 | SunIcon, // 太阳/日间模式图标
106 | HamburgerMenuIcon, // 菜单图标
107 | ChevronRight as ChevronRightIcon, // 右箭头
108 | ChevronLeft as ChevronLeftIcon, // 左箭头
109 | ChevronDown as ChevronDownIcon, // 下箭头
110 | ChevronUp as ChevronUpIcon, // 上箭头
111 | DotsVerticalIcon, // 垂直更多操作图标
112 | EnvelopeClosedIcon, // 邮件图标
113 | PersonIcon, // 人物/用户图标
114 | HeartIcon, // 心形/喜欢图标
115 | HeartFilledIcon, // 实心心形图标
116 | StarIcon, // 星形/收藏图标
117 | StarFilledIcon, // 实心星形图标
118 | QuestionMarkIcon, // 问号/帮助图标
119 | Link1Icon, // 链接图标
120 | Link2Icon, // 链接图标(变体)
121 | IdCardIcon, // ID卡/身份图标
122 | // 新增的格式相关图标
123 | CameraIcon, // 相机图标 - 原始图片
124 | SparklesIcon, // 闪亮图标 - 优化格式
125 | ZapIcon, // 闪电图标 - 快速格式
126 | ShieldIcon, // 盾牌图标 - 安全格式
127 | LayersIcon, // 层级图标 - 堆叠格式
128 | DiscIcon, // 圆盘图标 - 存储格式
129 | HashIcon, // 哈希图标 - 编码格式
130 | CodeIcon, // 代码图标 - Markdown格式
131 | ArchiveIcon, // 归档图标 - 压缩格式
132 | PackageIcon // 包装图标 - 打包格式
133 | };
134 |
135 | // 状态图标 - 为不同类型的状态消息提供图标
136 | export const StatusIcon = {
137 | success: ({ className = "" }: { className?: string }) => (
138 |