fix: expose failed products and archive row covers

This commit is contained in:
2026-09-12 17:49:09 +08:00
parent fabc6d69f2
commit cde8f377e2
2 changed files with 6 additions and 5 deletions
+1
View File
@@ -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,
+5 -5
View File
@@ -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">