Xinyun-Liu commited on
Commit
78037d4
·
verified ·
1 Parent(s): bb61836

Update review save mode labels

Browse files
web-review/service/static/review.html CHANGED
@@ -114,7 +114,7 @@
114
  const storageKey = "worldmodelbench-review-v1";
115
  const annotatorKey = "worldmodelbench-review-annotator-v1";
116
  const fields = ["decision", "track", "scene", "spatialAbility", "perspective", "textCaption"];
117
- const state = { source: null, query: "", decision: "all", page: 1, pageSize: 12, drafts: loadDrafts() };
118
  const sourceView = document.querySelector("#source-view");
119
  const reviewView = document.querySelector("#review-view");
120
  const sourceGrid = document.querySelector("#source-grid");
@@ -257,7 +257,7 @@
257
  const datasource = el("input", { type: "text", value: item.sourceDataset, readonly: "" });
258
  fieldGrid.append(el("label", { className: "wide" }, [el("span", { text: "Data Source" }), datasource]));
259
  fieldGrid.append(inputField(item, "textCaption", true));
260
- const submitButton = el("button", { className: "button primary", type: "button", text: "提交此条", onClick: event => submitCard(item, card, event.currentTarget) });
261
  const submitted = draftFor(item).submittedAt ? "已提交" : draftFor(item).localSavedAt ? "已保存到本机" : "本地草稿";
262
  body.append(fieldGrid, el("div", { className: "submit-row" }, [submitButton, el("span", { className: `submit-state ${draftFor(item).submittedAt ? "success" : ""}`, text: submitted })]), el("p", { className: "metadata", text: item.videoPath }));
263
  card.append(video, body);
@@ -315,7 +315,7 @@
315
  document.querySelector("#import-input").addEventListener("change", event => { if (event.target.files[0]) importDrafts(event.target.files[0]); event.target.value = ""; });
316
  annotatorInput.value = localStorage.getItem(annotatorKey) || "";
317
  annotatorInput.addEventListener("input", () => localStorage.setItem(annotatorKey, annotatorInput.value));
318
- fetch("/api/health", { cache: "no-store" }).then(response => response.ok ? response.json() : Promise.reject()).then(() => { serviceStatus.textContent = "共享提交已连接"; serviceStatus.classList.add("connected"); }).catch(() => { serviceStatus.textContent = "本地草稿模式"; });
319
  renderSources();
320
  })();
321
  </script>
 
114
  const storageKey = "worldmodelbench-review-v1";
115
  const annotatorKey = "worldmodelbench-review-annotator-v1";
116
  const fields = ["decision", "track", "scene", "spatialAbility", "perspective", "textCaption"];
117
+ const state = { source: null, query: "", decision: "all", page: 1, pageSize: 12, drafts: loadDrafts(), serviceOnline: false };
118
  const sourceView = document.querySelector("#source-view");
119
  const reviewView = document.querySelector("#review-view");
120
  const sourceGrid = document.querySelector("#source-grid");
 
257
  const datasource = el("input", { type: "text", value: item.sourceDataset, readonly: "" });
258
  fieldGrid.append(el("label", { className: "wide" }, [el("span", { text: "Data Source" }), datasource]));
259
  fieldGrid.append(inputField(item, "textCaption", true));
260
+ const submitButton = el("button", { className: "button primary", "data-submit-button": "", type: "button", text: state.serviceOnline ? "提交到共享记录" : "保存本条", onClick: event => submitCard(item, card, event.currentTarget) });
261
  const submitted = draftFor(item).submittedAt ? "已提交" : draftFor(item).localSavedAt ? "已保存到本机" : "本地草稿";
262
  body.append(fieldGrid, el("div", { className: "submit-row" }, [submitButton, el("span", { className: `submit-state ${draftFor(item).submittedAt ? "success" : ""}`, text: submitted })]), el("p", { className: "metadata", text: item.videoPath }));
263
  card.append(video, body);
 
315
  document.querySelector("#import-input").addEventListener("change", event => { if (event.target.files[0]) importDrafts(event.target.files[0]); event.target.value = ""; });
316
  annotatorInput.value = localStorage.getItem(annotatorKey) || "";
317
  annotatorInput.addEventListener("input", () => localStorage.setItem(annotatorKey, annotatorInput.value));
318
+ fetch("/api/health", { cache: "no-store" }).then(response => response.ok ? response.json() : Promise.reject()).then(() => { state.serviceOnline = true; serviceStatus.textContent = "共享提交已连接"; serviceStatus.classList.add("connected"); document.querySelectorAll("[data-submit-button]").forEach(button => { button.textContent = "提交到共享记录"; }); }).catch(() => { serviceStatus.textContent = "本地草稿模式"; });
319
  renderSources();
320
  })();
321
  </script>