fix(performance): 매출 업데이트 결과 — 인증정보 미설정 쇼핑몰은 실패(빨강)가 아닌 회색 한 줄로
실패는 인증 실패·API 오류처럼 손봐야 하는 것만 표시. 미설정/연동 준비 중은 이름만 모아 표시. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -127,13 +127,16 @@
|
||||
syncBtn.textContent = "업데이트 중…";
|
||||
try {
|
||||
const res = await api("POST", "/performance/api/sync", {});
|
||||
const ok = [], bad = [], pending = [], busy = [];
|
||||
// 실패(빨강)는 인증 실패·API 오류처럼 손봐야 하는 것만. 인증정보를 아직 안 넣은 쇼핑몰(미설정)과
|
||||
// 수집을 아직 만들지 않은 쇼핑몰(연동 준비 중)은 회색 한 줄로 이름만.
|
||||
const ok = [], bad = [], pending = [], unset = [], busy = [];
|
||||
let changed = 0;
|
||||
(res.results || []).forEach(function (r) {
|
||||
const name = (data.names || {})[r.code] || r.code;
|
||||
if (r.skipped) busy.push(name);
|
||||
else if (r.ok) { ok.push(name + " " + fmt(r.upserted) + "건"); changed += r.upserted; }
|
||||
else if (r.status === "not_implemented") pending.push(name);
|
||||
else if (r.status === "not_configured") unset.push(name);
|
||||
else bad.push(name + "(" + (r.label || r.status) + (r.message ? ": " + r.message : "") + ")");
|
||||
});
|
||||
const parts = [];
|
||||
@@ -141,6 +144,7 @@
|
||||
if (bad.length) parts.push("<b>실패</b> " + esc(bad.join(", ")));
|
||||
if (busy.length) parts.push("<b>이미 진행 중</b> " + esc(busy.join(", ")));
|
||||
if (pending.length) parts.push('<span class="perf-muted">연동 준비 중: ' + esc(pending.join(", ")) + "</span>");
|
||||
if (unset.length) parts.push('<span class="perf-muted">인증정보 미설정: ' + esc(unset.join(", ")) + "</span>");
|
||||
resultBox.innerHTML = parts.join(" · ") || "업데이트할 쇼핑몰이 없습니다.";
|
||||
resultBox.className = "perf-notice" + (bad.length ? " is-warn" : " is-ok");
|
||||
resultBox.hidden = false;
|
||||
|
||||
Reference in New Issue
Block a user