Merge branch 'dl2b'

Co-Authored-By: Claude Fable 5.1 <[email protected]>

# Conflicts:
#	apps/web/app/components/library/versions.tsx
This commit is contained in:
root committed 2026-09-29 22:15:35 +08:00
commit 606e97815f
11 files changed
+105 -35

No files matched your search

+22 -15
View File
@@ -4,13 +4,14 @@ import { useState } from "react";
import { Link } from "react-router";
import { PLAN_STATUS_LABEL, useDownloadTasks, usePlans } from "~/api/downloads.ts";
import { type DataColumn, DataTable } from "~/components/console/data-table.tsx";
import { DetailSection, DetailSheet } from "~/components/console/detail-sheet.tsx";
import { DetailSheet } from "~/components/console/detail-sheet.tsx";
import { FilterBar, FilterSelect } from "~/components/console/filter-bar.tsx";
import { JsonView } from "~/components/console/json-view.tsx";
import { KvList } from "~/components/console/kv-list.tsx";
import { consolePath } from "~/components/console/nav.ts";
import { PageHeader } from "~/components/console/page-header.tsx";
import { StatusBadge } from "~/components/console/status-badge.tsx";
import { TechInfo } from "~/components/console/tech-info.tsx";
import { useQueryState } from "~/components/console/use-query-state.ts";
import { DownloadsTabs } from "~/components/downloads/downloads-tabs.tsx";
import { PRIORITY } from "~/components/library/labels.ts";
@@ -42,12 +43,9 @@ export default function DownloadPlansPage() {
key: "purpose",
header: "计划",
cell: (p) => (
<div className="min-w-0">
<p className="text-foreground">
{PURPOSE[p.purpose]} · 优先级 {PRIORITY[p.priority as keyof typeof PRIORITY] ?? p.priority}
</p>
<p className="truncate font-mono text-meta text-muted-foreground">{p.id.slice(0, 8)}</p>
</div>
<p className="text-foreground">
{PURPOSE[p.purpose]} · 优先级 {PRIORITY[p.priority as keyof typeof PRIORITY] ?? p.priority}
</p>
),
},
{
@@ -103,7 +101,7 @@ export default function DownloadPlansPage() {
empty={{
icon: ClipboardList,
title: f.active ? "没有符合筛选的下载计划" : "还没有下载计划",
description: f.active ? undefined : "候选被选中后出现在这里。",
description: f.active ? undefined : "选中可下载的资源后出现在这里。",
}}
/>
@@ -130,18 +128,27 @@ export default function DownloadPlansPage() {
<StatusBadge tone={planTone(openPlan.status)}>{PLAN_STATUS_LABEL[openPlan.status]}</StatusBadge>
),
},
{ label: "优先级", value: openPlan.priority },
{
label: "优先级",
value: PRIORITY[openPlan.priority as keyof typeof PRIORITY] ?? openPlan.priority,
},
{ label: "预留空间", value: formatBytes(openPlan.reservedBytes, 1) },
{ label: "过期于", value: formatDateTime(openPlan.expiresAt) },
{ label: "创建", value: formatDateTime(openPlan.createdAt) },
{ label: "收录版本", value: openPlan.slotId, mono: true },
{ label: "资源", value: openPlan.sourceReleaseId, mono: true, wide: true },
]}
/>
<DetailSection title="评估依据">
<JsonView value={openPlan.evaluation} />
</DetailSection>
<JsonView label="预算预留" value={openPlan.budgetReservation} />
<TechInfo
className="mt-4"
items={[
{ label: "计划 ID", value: openPlan.id, wide: true },
{ label: "收录版本 ID", value: openPlan.slotId, wide: true },
{ label: "资源 ID", value: openPlan.sourceReleaseId, wide: true },
{ label: "说明原码", value: openPlan.statusReason },
]}
>
<JsonView label="评估依据" value={openPlan.evaluation} defaultOpen={false} />
<JsonView label="预算预留" value={openPlan.budgetReservation} defaultOpen={false} />
</TechInfo>
</>
) : null}
</DetailSheet>