fix(ui): сократить сводку большого списка WAN

This commit is contained in:
Denozordec committed 2026-10-04 23:43:57 +07:00
1 parent 0355343f9f
commit 8e3b7a65ce
7 files changed
+33 -5

No files matched your search

+10 -1
View File
@@ -26,7 +26,16 @@ for (const [wanCount,jhCount] of [[1000,1],[10,100]]) {
const started=Date.now(); await page.goto("/route-optimizer?server=1&keep=1")
const table=page.getByRole("table").filter({hasText:"WAN-аплинк"})
await expect(table.locator("tr[data-row-id]")).toHaveCount(Math.min(50,wanCount))
const profile={wanCount,jhCount,bytes:Buffer.byteLength(JSON.stringify(servers)),rows:await table.locator("tr[data-row-id]").count(),columns:await table.getByRole("columnheader").count(),tableNodes:await table.locator("*").count(),pageNodes:await page.locator("*").count(),readyMs:Date.now()-started}
await page.setViewportSize({width:320,height:1000})
const summary=page.getByText(/^WAN1 \(ISP ·/)
const summaryHeight320=await summary.evaluate(el=>el.getBoundingClientRect().height)
const summaryChars=await summary.evaluate(el=>el.textContent!.length)
await summary.screenshot({path:info.outputPath("wan-summary-320.png"),animations:"disabled"})
await page.setViewportSize({width:1440,height:1000})
const profile={summaryHeight320,summaryChars,wanCount,jhCount,bytes:Buffer.byteLength(JSON.stringify(servers)),rows:await table.locator("tr[data-row-id]").count(),columns:await table.getByRole("columnheader").count(),tableNodes:await table.locator("*").count(),pageNodes:await page.locator("*").count(),readyMs:Date.now()-started}
expect(summaryHeight320).toBeLessThan(160)
expect(summaryChars).toBeLessThan(300)
await expect(page.getByText(`Ещё ${wanCount-3} WAN. Все ${wanCount} аплинков — во вкладке WAN × JH.`,{exact:true})).toBeVisible()
console.log("WAN matrix",JSON.stringify(profile)); writeFileSync(info.outputPath("matrix-profile.json"),JSON.stringify(profile,null,2))
const root=page.getByRole("region",{name:"Матрица WAN и Jump Host"})
await expect(table.getByRole("columnheader")).toHaveCount(3+Math.min(5,jhCount))