fix(performance): 11번가 연결 테스트 — XML 아닌 응답은 실패, 성공 알림은 초록 체크
- 11번가가 200 으로 웹페이지(IP 차단 안내 등)나 XML 아닌 응답을 주면 "0건 정상"으로
오판할 수 있어 실패로 처리
- 공용 알림 창 erpAlert(msg, { tone: "ok" }) — 경고 삼각형 대신 초록 체크.
기존 호출은 그대로. 실적 연결 테스트 성공 알림에 적용
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,11 @@
|
||||
color: var(--color-callout-red, #c22b10);
|
||||
}
|
||||
|
||||
/* 성공 알림(erpAlert(msg, { tone: "ok" })) — 초록 체크 */
|
||||
.erp-dialog-icon.is-ok {
|
||||
color: #0f8a3a;
|
||||
}
|
||||
|
||||
/* 확인(질문)용은 붉은 경고색 대신 차분한 검정으로 */
|
||||
.erp-dialog-ask .erp-dialog-icon {
|
||||
color: var(--color-rich-black, #0a0a0a);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
erpConfirm("지울까요?").then(function (ok) { if (ok) ... });
|
||||
erpAlert("실패했습니다.").then(...)
|
||||
erpPrompt("주소를 입력하세요", "https://").then(function (v) { if (v) ... }); // 취소면 null
|
||||
erpAlert("저장했습니다.", { tone: "ok" }) // 성공 알림 — 경고 삼각형 대신 초록 체크
|
||||
|
||||
창 제목은 기본 "No.1 King ERP 프로그램". 화면마다 바꾸려면 그 화면 스크립트에서
|
||||
window.ERP_DIALOG_TITLE = "..." 를 두거나, 한 번만 options.title 로 넘긴다.
|
||||
@@ -31,6 +32,14 @@
|
||||
'<circle cx="12" cy="17.1" r="1.05" fill="currentColor"/>' +
|
||||
"</svg>";
|
||||
|
||||
// 성공(tone: "ok") — 원 안의 체크.
|
||||
var ICON_OK =
|
||||
'<svg width="32" height="32" viewBox="0 0 24 24" fill="none" aria-hidden="true">' +
|
||||
'<circle cx="12" cy="12" r="9.2" stroke="currentColor" stroke-width="1.6"/>' +
|
||||
'<path d="m7.6 12.3 3 3 5.8-6.2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"' +
|
||||
' stroke-linejoin="round"/>' +
|
||||
"</svg>";
|
||||
|
||||
function titleOf(options) {
|
||||
return options.title || window.ERP_DIALOG_TITLE || TITLE;
|
||||
}
|
||||
@@ -54,8 +63,8 @@
|
||||
body.className = "erp-dialog-body";
|
||||
|
||||
var icon = document.createElement("span");
|
||||
icon.className = "erp-dialog-icon";
|
||||
icon.innerHTML = ICON;
|
||||
icon.className = "erp-dialog-icon" + (options.tone === "ok" ? " is-ok" : "");
|
||||
icon.innerHTML = options.tone === "ok" ? ICON_OK : ICON;
|
||||
|
||||
var text = document.createElement("p");
|
||||
text.className = "erp-dialog-message";
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
if (a >= 10000) return s + Math.round(a / 10000).toLocaleString("ko-KR") + "만";
|
||||
return s + fmt(a);
|
||||
}
|
||||
function alertMsg(msg) { return window.erpAlert ? window.erpAlert(msg) : Promise.resolve(window.alert(msg)); }
|
||||
function alertMsg(msg, opts) { return window.erpAlert ? window.erpAlert(msg, opts) : Promise.resolve(window.alert(msg)); }
|
||||
function confirmMsg(msg) { return window.erpConfirm ? window.erpConfirm(msg) : Promise.resolve(window.confirm(msg)); }
|
||||
|
||||
async function api(method, url, body) {
|
||||
@@ -466,7 +466,7 @@
|
||||
btn.textContent = "확인 중…";
|
||||
try {
|
||||
const res = await api("POST", "/performance/api/marketplaces/" + code + "/test", {});
|
||||
await alertMsg(name + " — " + (res.ok ? "정상 연결\n" : res.label + "\n") + res.message);
|
||||
await alertMsg(name + " — " + (res.ok ? "정상 연결\n" : res.label + "\n") + res.message, res.ok ? { tone: "ok" } : undefined);
|
||||
location.reload();
|
||||
} catch (err) {
|
||||
alertMsg(err.message);
|
||||
|
||||
Reference in New Issue
Block a user