fix(ui): завершить переходы к объектам дашборда через VXLAN

This commit is contained in:
Denozordec committed 2026-09-20 22:08:00 +07:00
1 parent af84f0135d
commit d25afa4b9e
6 files changed
+190 -23

No files matched your search

+5 -5
View File
@@ -224,10 +224,10 @@ function mockOverlayItems(): OverlayItem[] {
})),
)
const vx: OverlayItem[] = mockVxlan.map((t) => ({
id: `vx-${t.id}`,
id: JSON.stringify(["vxlan", t.serverId, t.id]),
name: t.name,
kind: "vxlan",
href: "/vxlan",
href: "/vxlan?server=" + encodeURIComponent(t.serverId) + "&tunnel=" + encodeURIComponent(t.id),
status: t.status,
}))
return [...gre, ...wg, ...vx]
@@ -282,7 +282,7 @@ export function useDashboardLive() {
apiFetch<{ tunnels?: ApiGreTunnelRow[] }>("/api/filters/gre-tunnels"),
listWireGuard(backendUrl),
apiFetch<{ servers?: TrafficServerRow[] }>("/api/traffic/servers?range=1h"),
apiFetch<{ tunnels?: Array<{ id: string; name: string; status: OverlayItem["status"] }> }>("/api/vxlan"),
apiFetch<{ tunnels?: Array<{ id: string; serverId: string; name: string; status: OverlayItem["status"] }> }>("/api/vxlan"),
])
if (!current()) return
@@ -340,10 +340,10 @@ export function useDashboardLive() {
const vxItems: OverlayItem[] =
vxRes.status === "fulfilled"
? (vxRes.value.tunnels ?? []).map((t) => ({
id: `vx-${t.id}`,
id: JSON.stringify(["vxlan", t.serverId, t.id]),
name: t.name,
kind: "vxlan" as const,
href: "/vxlan",
href: "/vxlan?server=" + encodeURIComponent(t.serverId) + "&tunnel=" + encodeURIComponent(t.id),
status: t.status === "up" ? "up" : "down",
}))
: []