fix: expose failed products and archive row covers
This commit is contained in:
@@ -77,6 +77,7 @@ def main() -> None:
|
||||
"known_job_ids": len(known_job_ids),
|
||||
"temporary_jobs": [item.model_dump(mode="json") for item in cleanup_report.temporary_jobs],
|
||||
"pending_product_ids": [item.product_id for item in cleanup_report.pending_products],
|
||||
"failed_product_ids": [item.product_id for item in cleanup_report.failed_products],
|
||||
"reminder_job_ids": cleanup_report.reminder_job_ids,
|
||||
"stale_job_count": len(orphaned),
|
||||
"reclaimable_bytes": reclaimable,
|
||||
|
||||
@@ -275,9 +275,9 @@ export default function ProductArchivePage({
|
||||
{loading && <div className="table-empty">加载中…</div>}
|
||||
{!loading && products.length === 0 && <div className="table-empty">暂无产品档案</div>}
|
||||
{products.map(product => {
|
||||
const coverId = product.cover_image_id;
|
||||
const rowDetail = detail?.product_id === product.product_id ? detail : null;
|
||||
const rowCover = rowDetail?.images.find(image => image.image_id === coverId);
|
||||
const coverUrl = product.cover_image_id
|
||||
? `/api/products/${product.product_id}/images/${product.cover_image_id}`
|
||||
: "";
|
||||
return (
|
||||
<button
|
||||
key={product.product_id}
|
||||
@@ -285,8 +285,8 @@ export default function ProductArchivePage({
|
||||
onClick={() => setSelectedId(product.product_id)}
|
||||
>
|
||||
<span className="product-archive-thumb">
|
||||
{rowCover?.image_url
|
||||
? <img src={rowCover.image_url} alt={product.name} />
|
||||
{coverUrl
|
||||
? <img src={coverUrl} alt={product.name} />
|
||||
: <span className="product-archive-thumb-empty">暂无预览图</span>}
|
||||
</span>
|
||||
<span className="product-archive-row-body">
|
||||
|
||||
Reference in New Issue
Block a user