Split the web console into by-job files, add page tests and a docs-table test, plus docs

AI Assisted
This commit is contained in:
jparkerweb committed 2026-10-18 15:39:24 -07:00
1 parent 699a827cae
commit 3edb4468a8
121 files changed
+25603 -20145

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
// Plan2Code Web Console - the page talking to its own server.
//
// Only defines.
// POST a JSON body; the status and parsed answer, or status 0 when the
// server could not be reached.
export async function postJson(url, body) {
try {
const res = await fetch(url, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(body || {}),
});
let answer = {};
try {
answer = await res.json();
} catch {}
return { status: res.status, body: answer };
} catch {
return { status: 0, body: {} };
}
}