fix(ui): открывать интерфейс WireGuard с контекстом сервера

This commit is contained in:
Denozordec committed 2026-09-20 21:59:57 +07:00
1 parent 67a152b7c8
commit af84f0135d
7 files changed
+219 -29

No files matched your search

+4 -4
View File
@@ -216,10 +216,10 @@ function mockOverlayItems(): OverlayItem[] {
}))
const wg: OverlayItem[] = mockServers.flatMap((s) =>
(s.wireGuardIfaces ?? []).map((iface) => ({
id: `wg-${iface.id}`,
id: JSON.stringify(["wg", s.id, iface.id]),
name: iface.name,
kind: "wg" as const,
href: "/wireguard",
href: "/wireguard?server=" + encodeURIComponent(s.id) + "&interface=" + encodeURIComponent(iface.id),
status: iface.status,
})),
)
@@ -330,10 +330,10 @@ export function useDashboardLive() {
const wgItems: OverlayItem[] =
wgRes.status === "fulfilled"
? wgRes.value.interfaces.map((iface) => ({
id: `wg-${iface.id}`,
id: JSON.stringify(["wg", iface.serverId, iface.id]),
name: iface.name,
kind: "wg" as const,
href: "/wireguard",
href: "/wireguard?server=" + encodeURIComponent(iface.serverId) + "&interface=" + encodeURIComponent(iface.id),
status: iface.status,
}))
: []