Wait for registered monitor error detail
This commit is contained in:
@@ -430,12 +430,14 @@ createApp({
|
||||
}
|
||||
|
||||
async function openCheckDetail(item) {
|
||||
activeCheckItem.value = item || null;
|
||||
detailCopyState.value = "";
|
||||
const errorId = checkErrorId(item);
|
||||
const runId = item?.latestRunId || item?.runId || item?.run?.id || selectedRunId.value || "";
|
||||
if (runId) syncMonitorDeepLink(runId, "detail", errorId);
|
||||
if (!errorId) return;
|
||||
if (!errorId) {
|
||||
activeCheckItem.value = item || null;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const payload = await fetchJson(`/api/errors/${encodeURIComponent(errorId)}`);
|
||||
activeCheckItem.value = { ...item, ...(payload.finding || {}), errorId, detail: payload.detail || item.detail || null };
|
||||
|
||||
@@ -1219,7 +1219,8 @@ if (expectedErrorId) {
|
||||
for (let index = 0; index < 120; index += 1) {
|
||||
const dialog = document.querySelector("[data-check-dialog='true']");
|
||||
const dialogErrorId = dialog?.getAttribute("data-error-id") || "";
|
||||
if (dialog instanceof HTMLElement && dialogErrorId === errorId) return { requestedErrorId: errorId, ok: true, reason: "dialog-open" };
|
||||
const title = String(document.querySelector("#check-dialog-title")?.textContent || "").replace(/\s+/g, " ").trim();
|
||||
if (dialog instanceof HTMLElement && dialogErrorId === errorId && title && title !== "未登记监测项") return { requestedErrorId: errorId, ok: true, reason: "dialog-open-registered" };
|
||||
const row = document.querySelector('[data-error-id="' + CSS.escape(errorId) + '"]');
|
||||
if (row instanceof HTMLElement) row.click();
|
||||
await wait(150);
|
||||
|
||||
Reference in New Issue
Block a user