From 36fd166c996de96b80e46a694498a5d89d76cd5e Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Fri, 8 Jul 2022 09:36:08 +0200 Subject: [PATCH] Clickable image links in the output --- src/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index ad03a21..e14b316 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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, + '$&' + ); + stdout.innerHTML = response.output.replace( + /\\/static\\/.*.png/g, + '$&' + ); await sleep(1000); } while (response.status !== "finished"); }