mirror of
https://github.com/ClovertaTheTrilobita/cellpose-web.git
synced 2026-04-01 23:14:50 +00:00
feat(frontend): 修改报错提示
This commit is contained in:
parent
98c2114f12
commit
20473453c8
2 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue