Update Python tools
This commit is contained in:
@@ -1,21 +1,29 @@
|
||||
const output = document.querySelector("#run-output");
|
||||
|
||||
if (output) {
|
||||
let refreshTimer;
|
||||
const refresh = async () => {
|
||||
const response = await fetch(output.dataset.outputUrl, { cache: "no-store" });
|
||||
if (response.ok) {
|
||||
output.textContent = (await response.json()).output;
|
||||
const nextOutput = (await response.json()).output;
|
||||
if (nextOutput !== output.textContent) {
|
||||
output.textContent = nextOutput;
|
||||
}
|
||||
}
|
||||
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;
|
||||
const state = await stateResponse.json();
|
||||
status.textContent = state.status;
|
||||
if (state.status !== "queued" && state.status !== "running") {
|
||||
window.clearInterval(refreshTimer);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
refresh();
|
||||
window.setInterval(refresh, 2000);
|
||||
refreshTimer = window.setInterval(refresh, 2000);
|
||||
}
|
||||
|
||||
const refreshArtifacts = async (container) => {
|
||||
|
||||
Reference in New Issue
Block a user