feat(admin): add "Regenerate All GLB + USD" button
New endpoint POST /admin/settings/regenerate-all-canonical-scenes queues GLB + USD master export for ALL completed CAD files, replacing existing assets. Used after pipeline changes that affect tessellation or normals. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -237,6 +237,12 @@ export default function AdminPage() {
|
||||
onError: (e: any) => toast.error(e.response?.data?.detail || 'Failed'),
|
||||
})
|
||||
|
||||
const regenerateAllCanonicalScenesMut = useMutation({
|
||||
mutationFn: () => api.post('/admin/settings/regenerate-all-canonical-scenes'),
|
||||
onSuccess: (res) => toast.success(res.data.message || 'All canonical scenes re-queued'),
|
||||
onError: (e: any) => toast.error(e.response?.data?.detail || 'Failed'),
|
||||
})
|
||||
|
||||
const [smtpDraft, setSmtpDraft] = useState<Partial<Settings>>({})
|
||||
const smtp = { ...settings, ...smtpDraft } as Settings
|
||||
|
||||
@@ -958,6 +964,18 @@ export default function AdminPage() {
|
||||
</button>
|
||||
<p className="text-xs text-content-muted">Queues geometry GLB + USD master for all completed CAD files missing a canonical scene.</p>
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<button
|
||||
onClick={() => regenerateAllCanonicalScenesMut.mutate()}
|
||||
disabled={regenerateAllCanonicalScenesMut.isPending}
|
||||
className="btn-secondary text-sm w-full justify-start"
|
||||
title="Re-export geometry GLB + USD master for ALL completed CAD files (overwrites existing)"
|
||||
>
|
||||
<RefreshCw size={14} className={regenerateAllCanonicalScenesMut.isPending ? 'animate-spin' : ''} />
|
||||
{regenerateAllCanonicalScenesMut.isPending ? 'Queueing…' : 'Regenerate All GLB + USD'}
|
||||
</button>
|
||||
<p className="text-xs text-content-muted">Re-exports GLB and USD for all completed CAD files, replacing existing assets.</p>
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<button
|
||||
onClick={() => importMediaAssetsMut.mutate()}
|
||||
|
||||
Reference in New Issue
Block a user