From 20473453c82754f91cf6ec17be500649d04d3ccb Mon Sep 17 00:00:00 2001 From: ClovertaTheTrilobita Date: Fri, 17 Oct 2025 13:54:40 +0000 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/flaskApp.py | 1 + frontend/train_result.html | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/flaskApp.py b/backend/flaskApp.py index 5441dbc..40109f5 100644 --- a/backend/flaskApp.py +++ b/backend/flaskApp.py @@ -244,6 +244,7 @@ def status(): """ task_id = request.args.get('id') st = get_status(task_id) + print(st) if not st: return jsonify({"ok": True, "exists": False, "status": "not_found"}), 200 return jsonify({"ok": True, "exists": True, **st}), 200 diff --git a/frontend/train_result.html b/frontend/train_result.html index de088ef..6b6c062 100644 --- a/frontend/train_result.html +++ b/frontend/train_result.html @@ -138,12 +138,17 @@ const data = res.data; if (!exists) { - msg.textContent = `id "${ID}" 不存在`; + msg.textContent = `任务 "${ID}" 不存在`; msg.hidden = false; cava.hidden = true; } else if (status == "running") { - msg.textContent = `id "${ID}" 仍在运行中,请耐心等待片刻后刷新。`; + msg.textContent = `任务 "${ID}" 仍在运行中,请耐心等待片刻后刷新。`; + msg.hidden = false; + cava.hidden = true; + } + else if (status == "failed") { + msg.textContent = `任务 "${ID}" 运行失败,由于:"Error: ${data.error}",请检查上传数据集是否存在问题`; msg.hidden = false; cava.hidden = true; }