fix(ui): сохранять снимки OSPF при отказе устройств

This commit is contained in:
Denozordec committed 2026-09-30 17:37:23 +07:00
1 parent a89cefcbf2
commit 4254904c3a
9 files changed
+194 -112

No files matched your search

+2 -2
View File
@@ -22,10 +22,10 @@ async function setup(page: Page, path: string, empty = false) {
await page.route("**/health", route => route.fulfill({ json: { ok: true } }))
await page.route("**/api/**", route => {
const path = new URL(route.request().url()).pathname
const json = path === "/api/ospf/all" ? (empty ? { instances: [], interfaces: [], neighbors: [], routes: [], bfdSessions: [] } : ospf)
const json = path === "/api/ospf/catalog" ? (empty ? { instances: [], interfaces: [], neighbors: [], routes: [], bfdSessions: [], failures: [] } : { ...ospf, failures: [] })
: path === "/api/bgp/catalog" ? { sessions: empty ? [] : bgp, failures: [] }
: path === "/api/auth/config" ? { required: false }
: path === "/api/servers" ? [{ id: 1, name: "Тестовый роутер", host: "192.0.2.100", country: "RU", enabled: true, status: null }] : {}
: path === "/api/servers" ? ids.map(id => ({ id, name: "Тестовый роутер " + id, host: "192.0.2." + id, country: "RU", enabled: true, status: null })) : {}
return route.fulfill({ json })
})
await page.goto(path)