Integrate task runner into python tools
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
const output = document.querySelector("#run-output");
|
||||
|
||||
if (output) {
|
||||
const refresh = async () => {
|
||||
const response = await fetch(output.dataset.outputUrl, { cache: "no-store" });
|
||||
if (response.ok) {
|
||||
output.textContent = (await response.json()).output;
|
||||
}
|
||||
const status = document.querySelector("#run-status");
|
||||
if (status) {
|
||||
const stateResponse = await fetch(status.dataset.stateUrl, { cache: "no-store" });
|
||||
if (stateResponse.ok) {
|
||||
status.textContent = (await stateResponse.json()).status;
|
||||
}
|
||||
}
|
||||
};
|
||||
refresh();
|
||||
window.setInterval(refresh, 2000);
|
||||
}
|
||||
Reference in New Issue
Block a user