style(web): 格式化发布管理相关文件
build / build (push) Failing after 57s

为什么:远端 CI run149–155 连续在 format 步骤失败,报的就是这四个新文件;
不做格式白名单、不跳过检查,直接按仓库既有 prettier 配置格式化。
This commit is contained in:
姚章浩
2026-10-28 14:28:44 +08:00
parent dc9e827656
commit 7e1610da44
4 changed files with 55 additions and 29 deletions
+1 -1
View File
@@ -76,4 +76,4 @@ export function LibraryStorageSection() {
</ul>
</section>
)
}
}
+3 -2
View File
@@ -153,7 +153,8 @@ const base: ViewProps = {
onCapture: vi.fn(),
}
const render = (overrides: Partial<ViewProps> = {}) => renderToStaticMarkup(<ReleaseTargetsView {...base} {...overrides} />)
const render = (overrides: Partial<ViewProps> = {}) =>
renderToStaticMarkup(<ReleaseTargetsView {...base} {...overrides} />)
describe('ReleaseTargetsView(确认稿布局)', () => {
it('顶部只有两个知识库页签,且一次只显示选中库的作业区', () => {
@@ -254,4 +255,4 @@ describe('ReleaseTargetsView(确认稿布局)', () => {
expect(html).toContain('尚无测试封存')
expect(html).toContain('还没有测试库封存')
})
})
})
+50 -25
View File
@@ -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
<article key={card.title} className="rel-datacard">
<header>
<h3>{card.title}</h3>
<span className={`rel-pill ${card.row?.state === 'succeeded' ? 'green' : card.row?.state === 'failed' ? 'red' : card.row?.state === 'running' ? 'blue' : 'gray'}`}>
<span
className={`rel-pill ${card.row?.state === 'succeeded' ? 'green' : card.row?.state === 'failed' ? 'red' : card.row?.state === 'running' ? 'blue' : 'gray'}`}
>
{card.row
? card.row.state === 'succeeded'
? '已完成'
@@ -552,7 +549,9 @@ function ProgressBody({ view, now, onOpen }: { view: ScopeView; now: number; onO
<td>{row.stage === 'export' ? '测试封存' : row.stage}</td>
<td>
{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)}`
: ''}
</td>
<td>
{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
</footer>
<p className="rel-hint">
归档占用(只读):被版本引用的去重内容 {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}{' '}
个。保留策略与清理在系统设置 → 存储管理,均未接线。
</p>
</aside>
</div>
@@ -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 ? <em className="rel-scope">依据 {stamp(target.created_at)} 封存的测试库全库快照,不代表实时测试库已就绪</em> : null}
{target ? (
<em className="rel-scope">
依据 {stamp(target.created_at)} 封存的测试库全库快照,不代表实时测试库已就绪
</em>
) : null}
</li>
<li className={target ? 'ok' : 'unknown'}>
{target ? `✓ Wiki 快照完整(${target.totals.wiki_pages ?? 0} 页)` : '○ Wiki 快照:未接入'}
{target ? <em className="rel-scope">同一份封存快照,不是实时 Wiki 队列状态</em> : null}
</li>
<li className={target ? 'ok' : 'unknown'}>
{target
? `✓ 数据完整性:${target.parts.length} 项摘要逐项一致`
: '○ 数据完整性:尚无封存可核验'}
{target ? `✓ 数据完整性:${target.parts.length} 项摘要逐项一致` : '○ 数据完整性:尚无封存可核验'}
{target ? <em className="rel-scope">封存时的逐项校验和,重新封存才会更新</em> : null}
</li>
</ul>
@@ -928,9 +955,7 @@ export function ReleaseTargetsView(props: ViewProps) {
))}
</ul>
) : null}
<p className="rel-footnote">
启动后先固定测试版本,再备份生产。备份失败或恢复条件不满足,不进入生产写入。
</p>
<p className="rel-footnote">启动后先固定测试版本,再备份生产。备份失败或恢复条件不满足,不进入生产写入。</p>
</div>
{active ? (
@@ -1068,4 +1093,4 @@ export function ReleaseTargets() {
onCapture={() => void startCapture()}
/>
)
}
}
+1 -1
View File
@@ -597,4 +597,4 @@
display: block;
overflow-x: auto;
}
}
}