paths fix
This commit is contained in:
parent
44aeb8cf26
commit
5a2f27de45
@ -44,8 +44,8 @@ function getBackendJobName() {
|
||||
|
||||
function getResultURL() {
|
||||
return chosenAlgorithm === "isolation_forest"
|
||||
? "/get-isolation-forest-result"
|
||||
: "/get-autoencoder-result";
|
||||
? "get-isolation-forest-result"
|
||||
: "get-autoencoder-result";
|
||||
}
|
||||
|
||||
function saveActiveJob() {
|
||||
@ -173,7 +173,7 @@ function startProgressPolling() {
|
||||
|
||||
progressInterval = setInterval(async () => {
|
||||
try {
|
||||
const res = await fetch("/get-status");
|
||||
const res = await fetch("get-status");
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error("Backend status fetch failed");
|
||||
@ -207,7 +207,7 @@ async function restoreRunningJob() {
|
||||
if (!saved) return;
|
||||
|
||||
try {
|
||||
const res = await fetch("/get-status");
|
||||
const res = await fetch("get-status");
|
||||
const status = await res.json();
|
||||
|
||||
applySavedAlgorithm(saved);
|
||||
@ -265,8 +265,8 @@ startBtn.addEventListener("click", () => {
|
||||
|
||||
let url =
|
||||
chosenAlgorithm === "isolation_forest"
|
||||
? "/start-iforest"
|
||||
: "/start-autoencoder";
|
||||
? "start-iforest"
|
||||
: "start-autoencoder";
|
||||
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), 10000);
|
||||
@ -426,7 +426,7 @@ function displayResults(data) {
|
||||
}
|
||||
|
||||
function downloadPDF(results, runtime) {
|
||||
fetch("/download-pdf", {
|
||||
fetch("download-pdf", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
@ -446,7 +446,7 @@ function downloadPDF(results, runtime) {
|
||||
}
|
||||
|
||||
function downloadJSON(results, runtime) {
|
||||
fetch("/download-json", {
|
||||
fetch("download-json", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
|
||||
@ -100,7 +100,7 @@ function resetUploadFlow() {
|
||||
|
||||
async function isBackendBusy() {
|
||||
try {
|
||||
const res = await fetch("/get-status");
|
||||
const res = await fetch("get-status");
|
||||
|
||||
if (!res.ok) {
|
||||
showPopup("Backend status could not be checked.");
|
||||
@ -153,7 +153,7 @@ fileInput.addEventListener("change", async () => {
|
||||
let uploadResponse;
|
||||
|
||||
try {
|
||||
uploadResponse = await fetch("/upload-dataset", {
|
||||
uploadResponse = await fetch("upload-dataset", {
|
||||
method: "POST",
|
||||
body: formData
|
||||
});
|
||||
@ -412,7 +412,7 @@ btnRun.addEventListener("click", async () => {
|
||||
let saveResponse;
|
||||
|
||||
try {
|
||||
saveResponse = await fetch("/save-config", {
|
||||
saveResponse = await fetch("save-config", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(config)
|
||||
|
||||
@ -44,9 +44,9 @@ function getBackendJobName() {
|
||||
|
||||
function getResultURL() {
|
||||
if (chosenAlgorithm === "iforest_custom") {
|
||||
return "/get-isolation-forest-result-custom";
|
||||
return "get-isolation-forest-result-custom";
|
||||
}
|
||||
return "/get-autoencoder-result-custom";
|
||||
return "get-autoencoder-result-custom";
|
||||
}
|
||||
|
||||
function saveActiveJob() {
|
||||
@ -171,9 +171,9 @@ window.fetch = async function (...args) {
|
||||
}
|
||||
} catch (_) {}
|
||||
|
||||
if (url.includes("/upload-dataset")) {
|
||||
if (url.includes("upload-dataset")) {
|
||||
showErrorPopup(message || "Cannot upload a new dataset while an algorithm is running.");
|
||||
} else if (url.includes("/save-config")) {
|
||||
} else if (url.includes("save-config")) {
|
||||
showErrorPopup(message || "Cannot save config while an algorithm is running.");
|
||||
}
|
||||
}
|
||||
@ -224,7 +224,7 @@ function startProgressPolling() {
|
||||
|
||||
progressInterval = setInterval(async () => {
|
||||
try {
|
||||
const res = await fetch("/get-status");
|
||||
const res = await fetch("get-status");
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error("Backend status fetch failed");
|
||||
@ -258,7 +258,7 @@ async function restoreRunningJob() {
|
||||
if (!saved) return;
|
||||
|
||||
try {
|
||||
const res = await fetch("/get-status");
|
||||
const res = await fetch("get-status");
|
||||
const status = await res.json();
|
||||
|
||||
if (status.current_job !== saved.backendJob) {
|
||||
@ -291,7 +291,7 @@ startBtn.addEventListener("click", async () => {
|
||||
if (!chosenAlgorithm) return;
|
||||
|
||||
try {
|
||||
const statusRes = await fetch("/get-status");
|
||||
const statusRes = await fetch("get-status");
|
||||
const status = await statusRes.json();
|
||||
|
||||
if (status.running) {
|
||||
@ -309,9 +309,9 @@ startBtn.addEventListener("click", async () => {
|
||||
|
||||
let url;
|
||||
if (chosenAlgorithm === "iforest_custom") {
|
||||
url = "/start-iforest-custom";
|
||||
url = "start-iforest-custom";
|
||||
} else if (chosenAlgorithm === "autoencoder_custom") {
|
||||
url = "/start-autoencoder-custom";
|
||||
url = "start-autoencoder-custom";
|
||||
}
|
||||
|
||||
const controller = new AbortController();
|
||||
@ -465,7 +465,7 @@ function displayResults(data) {
|
||||
}
|
||||
|
||||
function downloadPDF(results, runtime) {
|
||||
fetch("/download-pdf", {
|
||||
fetch("download-pdf", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
@ -485,7 +485,7 @@ function downloadPDF(results, runtime) {
|
||||
}
|
||||
|
||||
function downloadJSON(results, runtime) {
|
||||
fetch("/download-json", {
|
||||
fetch("download-json", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user