- Sidebar: 概览/资源/订阅/下载/整理/Agent/系统, 18 items (+ 定时任务); single active item via findNavItem; 待处理 badge; collapsed rail groups; mobile drawer shares NAV_GROUPS. - New pages: /downloads (queue + cache watermark header), /downloads/plans, /downloads/:id, /tasks (business tasks only) + /tasks/:id detail, /rules. - Legacy links: ?tab= on tasks/subscriptions/sources redirect via clientLoader; /tasks/:downloadId falls back to /downloads/:id. - List filters in URL query; settingsPath() helper for settings deep links. - Copy per glossary (待处理, 收录策略, 引擎面板, 文件管理, 版本目标). Co-Authored-By: Claude Opus 5.5 <[email protected]>
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { ArrowLeft } from "lucide-react";
|
|
import { Link, useParams } from "react-router";
|
|
import { useDownloadTask } from "~/api/downloads.ts";
|
|
import { ErrorState, LoadingState } from "~/components/console/empty-state.tsx";
|
|
import { consolePath } from "~/components/console/nav.ts";
|
|
import { PageHeader } from "~/components/console/page-header.tsx";
|
|
import { DownloadDetail } from "~/components/downloads/download-detail.tsx";
|
|
import { Button } from "~/components/ui/button.tsx";
|
|
|
|
export const meta = () => [{ title: "下载任务 · UHD 媒体自动化控制台" }];
|
|
|
|
export default function DownloadTaskPage() {
|
|
const { id = "" } = useParams();
|
|
const task = useDownloadTask(id);
|
|
const t = task.data;
|
|
return (
|
|
<>
|
|
<PageHeader
|
|
title={t?.name ?? "下载任务"}
|
|
className="[&_h1]:break-all"
|
|
actions={
|
|
<Button asChild variant="ghost" size="sm">
|
|
<Link to={consolePath("downloads")}>
|
|
<ArrowLeft />
|
|
下载队列
|
|
</Link>
|
|
</Button>
|
|
}
|
|
/>
|
|
<div className="pg-slab rounded-xl p-4 md:p-5">
|
|
{task.isPending ? (
|
|
<LoadingState rows={5} />
|
|
) : task.error ? (
|
|
<ErrorState plain error={task.error} onRetry={() => void task.refetch()} />
|
|
) : (
|
|
<DownloadDetail task={task.data} />
|
|
)}
|
|
</div>
|
|
</>
|
|
);
|
|
}
|