diff --git a/backend/flaskApp.py b/backend/flaskApp.py
index ed4f710..03b85bf 100644
--- a/backend/flaskApp.py
+++ b/backend/flaskApp.py
@@ -69,6 +69,9 @@ def upload():
diameter_raw = request.args.get("diameter") or request.form.get("diameter")
diameter = _to_float(diameter_raw, None) if diameter_raw not in (None, "") else None
+ print("cpt:" + str(cellprob_threshold))
+ print("flow:" + str(flow_threshold))
+
# 将文件保存在本地目录中
ts = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S") + f"-{int(time.time()*1000)%1000:03d}"
os.makedirs(UPLOAD_DIR / ts, exist_ok=True)
diff --git a/frontend/index.html b/frontend/index.html
index d7a91a8..47ed71f 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -2,32 +2,63 @@
+
+
+
+
+
+
+
+ document.getElementById("uploadBtn").addEventListener("click", async () => {
+ const input = document.getElementById("fileInput");
+ if (!input.files.length) return alert("请选择文件");
+
+ const fd = new FormData();
+ for (const f of input.files) fd.append("files", f);
+
+ const bar = document.getElementById("bar");
+ try {
+ const URL = buildUrl();
+ const res = await axios.post(URL, fd, {
+ onUploadProgress: (e) => {
+ if (e.total) bar.value = Math.round((e.loaded * 100) / e.total);
+ },
+ // 不要显式设置 Content-Type
+ });
+ alert("上传成功:" + JSON.stringify(res.data));
+ window.location.href = `preview.html?id=${encodeURIComponent(res.data['id'])}`;
+ } catch (e) {
+ alert("上传失败:" + (e.response?.data?.message || e.message));
+ } finally {
+ bar.value = 0;
+ }
+ });
+
\ No newline at end of file