Sidebar becomes 5 groups (overview / resources / subscriptions / organize / system). Pending items move to a top-bar inbox with badge and grouped dropdown. Engine panel, schedules and identity pages redirect to the task page, its plan tab and media overview views; the download plan becomes a second tab of the download panel. nav.test and smoke cover the new routes. 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>
|
|
</>
|
|
);
|
|
}
|