feat(web): simplify subscription and manual download flows and sync UHD styles
This commit is contained in:
1 parent
27c0f27434
commit
c3c4456913
33 files changed
+1083
-633
No files matched your search
@@ -6,8 +6,7 @@ import { toast } from "sonner";
|
||||
import { apiMutate } from "~/api/parse.ts";
|
||||
import { DetailSection } from "~/components/console/detail-sheet.tsx";
|
||||
import { KvList } from "~/components/console/kv-list.tsx";
|
||||
import { consolePath } from "~/components/console/nav.ts";
|
||||
import { recordPath, taskPath } from "~/components/console/record-sheet.tsx";
|
||||
import { subjectLink, taskPath } from "~/components/console/record-sheet.tsx";
|
||||
import { StatusBadge } from "~/components/console/status-badge.tsx";
|
||||
import { Button } from "~/components/ui/button.tsx";
|
||||
import { errorMessage } from "~/lib/api.ts";
|
||||
@@ -62,28 +61,6 @@ export const SUBJECT_LABEL: Record<string, string> = {
|
||||
cache_volume: "下载盘",
|
||||
};
|
||||
|
||||
/** 业务任务的对象 → 它的"家"页面 */
|
||||
export function subjectLink(t: Pick<Task, "subjectType" | "subjectId">): string | null {
|
||||
if (!t.subjectId) return null;
|
||||
switch (t.subjectType) {
|
||||
case "download_task":
|
||||
return recordPath("downloads", t.subjectId);
|
||||
case "acquisition_plan":
|
||||
return `${consolePath("downloads")}?plan=${encodeURIComponent(t.subjectId)}`;
|
||||
case "organization_record":
|
||||
return recordPath("organize", t.subjectId);
|
||||
case "media_entity":
|
||||
return consolePath("library", t.subjectId);
|
||||
case "site":
|
||||
return recordPath("sites", t.subjectId);
|
||||
case "feed_source":
|
||||
// RSS 属于站点(IA-2):按 ?feed= 查所属站点后跳到站点的 RSS Tab
|
||||
return `${consolePath("sources")}?feed=${encodeURIComponent(t.subjectId)}`;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function subjectText(t: Pick<Task, "subjectType" | "subjectId">): string {
|
||||
if (!t.subjectType) return "—";
|
||||
const label = SUBJECT_LABEL[t.subjectType] ?? t.subjectType;
|
||||
|
||||
Reference in new issue
Block a user