diff --git a/web/src/LibraryStorageSection.tsx b/web/src/LibraryStorageSection.tsx index bff3910..9657515 100644 --- a/web/src/LibraryStorageSection.tsx +++ b/web/src/LibraryStorageSection.tsx @@ -76,4 +76,4 @@ export function LibraryStorageSection() { ) -} \ No newline at end of file +} diff --git a/web/src/ReleaseTargets.test.tsx b/web/src/ReleaseTargets.test.tsx index 42db40f..5aab8dd 100644 --- a/web/src/ReleaseTargets.test.tsx +++ b/web/src/ReleaseTargets.test.tsx @@ -153,7 +153,8 @@ const base: ViewProps = { onCapture: vi.fn(), } -const render = (overrides: Partial = {}) => renderToStaticMarkup() +const render = (overrides: Partial = {}) => + renderToStaticMarkup() describe('ReleaseTargetsView(确认稿布局)', () => { it('顶部只有两个知识库页签,且一次只显示选中库的作业区', () => { @@ -254,4 +255,4 @@ describe('ReleaseTargetsView(确认稿布局)', () => { expect(html).toContain('尚无测试封存') expect(html).toContain('还没有测试库封存') }) -}) \ No newline at end of file +}) diff --git a/web/src/ReleaseTargets.tsx b/web/src/ReleaseTargets.tsx index 0b96d4d..080a626 100644 --- a/web/src/ReleaseTargets.tsx +++ b/web/src/ReleaseTargets.tsx @@ -92,7 +92,7 @@ function scopeView( page: LibrarySnapshotList | null, jobs: LibraryCaptureJob[], scope: Scope, - overview: LibraryOverview | null, + overview: LibraryOverview | null ): ScopeView { const history = (page?.snapshots ?? []).filter((item) => item.scope === scope) const scoped = jobs.filter((job) => job.scope === scope) @@ -166,9 +166,7 @@ function StageBar({ view }: { view: ScopeView }) { if (sealJob) { const exportStage = stageOf(sealJob, 'export') first = { - state: toState( - sealJob.state === 'succeeded' ? 'succeeded' : sealJob.state === 'failed' ? 'failed' : 'running', - ), + state: toState(sealJob.state === 'succeeded' ? 'succeeded' : sealJob.state === 'failed' ? 'failed' : 'running'), hint: sealJob.state === 'succeeded' ? `本次作业已封存 ${stamp(sealJob.finished_at ?? exportStage?.updated_at ?? sealJob.updated_at)}` @@ -434,10 +432,7 @@ function ProgressBody({ view, now, onOpen }: { view: ScopeView; now: number; onO card.row && card.row.total && card.row.total > 0 ? Math.min(100, Math.round(((card.row.completed ?? 0) / card.row.total) * 100)) : null, - count: - card.row && card.row.total != null - ? `${card.row.completed ?? '—'} / ${card.row.total}` - : '— / 未知总量', + count: card.row && card.row.total != null ? `${card.row.completed ?? '—'} / ${card.row.total}` : '— / 未知总量', })) return ( @@ -493,7 +488,9 @@ function ProgressBody({ view, now, onOpen }: { view: ScopeView; now: number; onO

{card.title}

- + {card.row ? card.row.state === 'succeeded' ? '已完成' @@ -552,7 +549,9 @@ function ProgressBody({ view, now, onOpen }: { view: ScopeView; now: number; onO {row.stage === 'export' ? '测试封存' : row.stage} {row.total != null ? `${row.completed ?? '—'} / ${row.total}` : '未知总量'} - {row.bytes_total != null ? ` · ${formatBytes(row.bytes_done ?? 0)} / ${formatBytes(row.bytes_total)}` : ''} + {row.bytes_total != null + ? ` · ${formatBytes(row.bytes_done ?? 0)} / ${formatBytes(row.bytes_total)}` + : ''} {row.state === 'succeeded' @@ -604,7 +603,18 @@ interface DrawerProps { onCapture: () => void } -function Drawer({ view, page, now, open, expanded, onExpand, onClose, canCapture, pendingCapture, onCapture }: DrawerProps) { +function Drawer({ + view, + page, + now, + open, + expanded, + onExpand, + onClose, + canCapture, + pendingCapture, + onCapture, +}: DrawerProps) { if (!open) return null const listing = view.history const selected = listing.find((item) => item.snapshot_id === expanded) @@ -763,8 +773,8 @@ function Drawer({ view, page, now, open, expanded, onExpand, onClose, canCapture

归档占用(只读):被版本引用的去重内容 {formatBytes(page?.content_bytes ?? 0)} · 磁盘分配{' '} - {formatBytes(page?.blob_allocated_bytes ?? 0)} · 未被引用 {page?.unreferenced_blobs ?? 0} 个。保留策略与清理在系统设置 → - 存储管理,均未接线。 + {formatBytes(page?.blob_allocated_bytes ?? 0)} · 未被引用 {page?.unreferenced_blobs ?? 0}{' '} + 个。保留策略与清理在系统设置 → 存储管理,均未接线。

@@ -773,14 +783,29 @@ function Drawer({ view, page, now, open, expanded, onExpand, onClose, canCapture export function ReleaseTargetsView(props: ViewProps) { const { - page, jobs, overview, loading, error, notice, scope, onScope, drawerOpen, onDrawer, expandedSnapshot, - onExpandSnapshot, pendingCapture, canCapture, canWrite, now, onRefresh, onCapture, + page, + jobs, + overview, + loading, + error, + notice, + scope, + onScope, + drawerOpen, + onDrawer, + expandedSnapshot, + onExpandSnapshot, + pendingCapture, + canCapture, + canWrite, + now, + onRefresh, + onCapture, } = props const internal = scopeView(page, jobs, 'internal', overview?.scope === 'internal' ? overview : null) const external = scopeView(page, jobs, 'external', overview?.scope === 'external' ? overview : null) const view = scope === 'internal' ? internal : external - const active = - Boolean(view.activeJob) || view.job?.state === 'running' || view.job?.state === 'pending' + const active = Boolean(view.activeJob) || view.job?.state === 'running' || view.job?.state === 'pending' // 三类版本严格分开:target 是测试封存,production 是生产权威版本,prebackup 是本次预备份。 const target = view.overview?.test_sealed const production = view.overview?.production ?? { state: 'unknown' as const } @@ -908,16 +933,18 @@ export function ReleaseTargetsView(props: ViewProps) { {target ? `✓ 文档解析与索引完整(${target.totals.chunks ?? 0} 分块 / ${target.totals.index_documents ?? 0} 索引)` : '○ 文档解析与索引:未接入'} - {target ? 依据 {stamp(target.created_at)} 封存的测试库全库快照,不代表实时测试库已就绪 : null} + {target ? ( + + 依据 {stamp(target.created_at)} 封存的测试库全库快照,不代表实时测试库已就绪 + + ) : null}
  • {target ? `✓ Wiki 快照完整(${target.totals.wiki_pages ?? 0} 页)` : '○ Wiki 快照:未接入'} {target ? 同一份封存快照,不是实时 Wiki 队列状态 : null}
  • - {target - ? `✓ 数据完整性:${target.parts.length} 项摘要逐项一致` - : '○ 数据完整性:尚无封存可核验'} + {target ? `✓ 数据完整性:${target.parts.length} 项摘要逐项一致` : '○ 数据完整性:尚无封存可核验'} {target ? 封存时的逐项校验和,重新封存才会更新 : null}
  • @@ -928,9 +955,7 @@ export function ReleaseTargetsView(props: ViewProps) { ))} ) : null} -

    - 启动后先固定测试版本,再备份生产。备份失败或恢复条件不满足,不进入生产写入。 -

    +

    启动后先固定测试版本,再备份生产。备份失败或恢复条件不满足,不进入生产写入。

    {active ? ( @@ -1068,4 +1093,4 @@ export function ReleaseTargets() { onCapture={() => void startCapture()} /> ) -} \ No newline at end of file +} diff --git a/web/src/releaseTargets.css b/web/src/releaseTargets.css index 5239952..c6c452a 100644 --- a/web/src/releaseTargets.css +++ b/web/src/releaseTargets.css @@ -597,4 +597,4 @@ display: block; overflow-x: auto; } -} \ No newline at end of file +}