// Pause/resume POST to the *dashboard's* origin (hive-c0re, not this // agent's own `/api/*`) — see dashboardBase.ts. A real `
` submit // rather than `fetch`, kept unchanged from app.js: accessed directly // (not through the gateway proxy), the dashboard is a different origin/ // port, and a cross-origin `fetch` POST needs the response readable // under CORS to report success/failure — a full navigation form submit // sidesteps that (the browser reloads to whatever the endpoint // returns) without needing hive-c0re to grow CORS headers for what's // otherwise a same-origin action behind the gateway. export function submitPauseResume(dashboardBase: string, label: string, verb: 'pause' | 'resume'): void { const form = document.createElement('form'); form.method = 'POST'; form.action = `${dashboardBase}api/${verb}/${label}`; document.body.appendChild(form); form.submit(); }