diff --git a/web/pose_3d.js b/web/pose_3d.js index f45dad3..370c98a 100644 --- a/web/pose_3d.js +++ b/web/pose_3d.js @@ -574,6 +574,21 @@ function bindPoseButtons() { $('p3PoseDelBtn').addEventListener('click', onDeletePose); } +async function onUnlock() { + clearError(); + try { + await jsonFetch('/api/pose_3d/unlock', { method: 'POST' }); + $('p3Status').textContent = '✓ Braccia sbloccate'; + $('p3Status').className = 'p3-status ok'; + } catch (e) { + showError(`Unlock fallito: ${e.message}`); + } +} + +function bindUnlockButton() { + $('p3UnlockBtn').addEventListener('click', onUnlock); +} + // ----- init triggered on first activation ----- let inited = false; function ensureInit() { @@ -590,6 +605,7 @@ function ensureInit() { bindPreciseControl(); bindJogAutoApply(); bindPoseButtons(); + bindUnlockButton(); pollState(); pollTimer = setInterval(pollState, POLL_MS); }