Clickable image links in the output

This commit is contained in:
Kuba Orlik 2022-07-08 09:36:08 +02:00
parent 84c9c6a99a
commit 36fd166c99

View File

@ -80,10 +80,14 @@ router.get("/", async (ctx) => {
const { id } = await (await fetch(url, { method: "post" })).json();
do {
response = await (await fetch(\`/api/requests/\${id}\`)).json();
console.log(response);
output.innerHTML = JSON.stringify(response, null, " ");
console.log(response.output);
stdout.innerHTML = response.output;
output.innerHTML = JSON.stringify(response, null, " ").replace(
/\\/static\\/.*.png/g,
'<a href="$&">$&</a>'
);
stdout.innerHTML = response.output.replace(
/\\/static\\/.*.png/g,
'<a href="$&">$&</a>'
);
await sleep(1000);
} while (response.status !== "finished");
}