feat(library): add Retry button for error-status assets in library grid
Error assets now show an amber circular-arrow action button on hover. Clicking it calls POST /api/v1/assets/:id/retry, resets status to 'processing', and refreshes the grid — no manual DB intervention needed when a proxy job fails.
This commit is contained in:
parent
130906ef42
commit
d18fa2f761
1 changed files with 9 additions and 1 deletions
|
|
@ -502,7 +502,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/api.js?v=5"></script>
|
||||
<script src="js/api.js?v=6"></script>
|
||||
<script src="js/topbar-strip.js?v=1"></script>
|
||||
<script src="js/preview.js?v=4"></script>
|
||||
<script src="js/selection.js?v=1"></script>
|
||||
|
|
@ -710,6 +710,7 @@
|
|||
<button class="asset-action-btn" onclick="openInEditor('${asset.id}', event)" title="Open in Editor">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="3" width="14" height="10" rx="1"/><path d="M1 7h14M5 3v10M5 7l3-2v4l-3-2z"/></svg>
|
||||
</button>
|
||||
${asset.status === 'error' ? `<button class="asset-action-btn" onclick="handleRetryAsset('${asset.id}', event)" title="Retry processing" style="color:oklch(74% 0.18 55);"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 8a6 6 0 1 0 1-3.5"/><path d="M1 3v3h3"/></svg></button>` : ''}
|
||||
<button class="asset-action-btn" onclick="deleteAssetPrompt('${asset.id}', event)" title="Delete">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3 4h10M6 4V2h4v2M5 4v9h6V4"/></svg>
|
||||
</button>
|
||||
|
|
@ -757,6 +758,13 @@
|
|||
else toast('Delete failed', r.error, 'error');
|
||||
}
|
||||
|
||||
async function handleRetryAsset(id, e) {
|
||||
e.stopPropagation();
|
||||
const r = await retryAsset(id);
|
||||
if (r.success) { toast('Asset queued for reprocessing', '', 'success'); loadAssets(); }
|
||||
else toast('Retry failed', r.error, 'error');
|
||||
}
|
||||
|
||||
function openInEditor(assetId, e) {
|
||||
e.stopPropagation();
|
||||
const projectId = state.currentProjectId;
|
||||
|
|
|
|||
Loading…
Reference in a new issue