diff --git a/scripts/assets/web-probe-sentinel-monitor-web/monitor-web.js b/scripts/assets/web-probe-sentinel-monitor-web/monitor-web.js index 3a22534e..7a589aec 100644 --- a/scripts/assets/web-probe-sentinel-monitor-web/monitor-web.js +++ b/scripts/assets/web-probe-sentinel-monitor-web/monitor-web.js @@ -87,8 +87,8 @@ createApp({ try { const [overviewPayload, runsPayload, findingsPayload] = await Promise.all([ fetchJson("/api/overview"), - fetchJson("/api/runs?limit=80&sort=updated"), - fetchJson("/api/findings?limit=80&window=24h"), + fetchJson("/api/runs?limit=30&sort=updated"), + fetchJson("/api/findings?limit=30&window=24h"), ]); overview.value = overviewPayload; runs.value = Array.isArray(runsPayload.runs) ? runsPayload.runs : Array.isArray(runsPayload.items) ? runsPayload.items : []; @@ -97,7 +97,7 @@ createApp({ lastAutoRefreshAt = Date.now(); const keepSelected = runs.value.find((run) => run.id === selectedRunId.value); const nextRun = keepSelected || runs.value[0] || latestRun.value; - if (nextRun?.id) await selectRun(nextRun, true); + if (nextRun?.id) void selectRun(nextRun, true); } catch (cause) { error.value = String(cause?.message || cause); } finally { diff --git a/scripts/src/hwlab-node-web-sentinel-cicd.ts b/scripts/src/hwlab-node-web-sentinel-cicd.ts index 7b8109f6..63492199 100644 --- a/scripts/src/hwlab-node-web-sentinel-cicd.ts +++ b/scripts/src/hwlab-node-web-sentinel-cicd.ts @@ -1979,7 +1979,7 @@ for (let attempt = 1; attempt <= maxNavigationAttempts; attempt += 1) { try { const response = await page.goto(url, { timeout: perAttemptTimeout, waitUntil: "domcontentloaded" }); httpStatus = response?.status() ?? null; - await page.waitForLoadState("networkidle", { timeout: Math.min(5000, perAttemptTimeout) }).catch(() => {}); + await page.waitForLoadState("networkidle", { timeout: Math.min(10000, perAttemptTimeout) }).catch(() => {}); await page.waitForFunction(() => { const root = document.querySelector("#monitor-web-root"); if (!root) return false; @@ -1988,10 +1988,10 @@ for (let attempt = 1; attempt <= maxNavigationAttempts; attempt += 1) { const runs = document.querySelectorAll(".run-list .run-row").length; const trend = document.querySelector("[data-monitor-trend-curve]"); return ready && (error || runs > 0 || trend); - }, null, { timeout: Math.min(5000, perAttemptTimeout) }).catch(() => {}); + }, null, { timeout: Math.min(15000, perAttemptTimeout) }).catch(() => {}); await page.waitForTimeout(500); - const shellReady = await page.evaluate(() => Boolean(document.querySelector("#monitor-web-root"))).catch(() => false); - if (shellReady || attempt === maxNavigationAttempts) break; + const appReady = await page.evaluate(() => document.querySelector("#monitor-web-root")?.getAttribute("data-monitor-ready") === "true").catch(() => false); + if (appReady || attempt === maxNavigationAttempts) break; } catch (error) { navigationError = String(error?.message || error).slice(0, 500); if (attempt === maxNavigationAttempts) break;