diff --git a/src/ui/sidebar/HostManagerData.ts b/src/ui/sidebar/HostManagerData.ts index 2f2d466e..c0f9ffb5 100644 --- a/src/ui/sidebar/HostManagerData.ts +++ b/src/ui/sidebar/HostManagerData.ts @@ -63,6 +63,7 @@ export function sshHostToHost(h: SSHHostWithStatus): Host { notes: h.notes, pin: h.pin ?? false, macAddress: h.macAddress, + wolBroadcastAddress: h.wolBroadcastAddress, enableSsh: h.enableSsh != null ? h.enableSsh : isSshHost, enableTerminal: h.enableTerminal ?? (h.enableSsh != null ? h.enableSsh : isSshHost), diff --git a/src/ui/tests/sidebar/HostManagerData.test.ts b/src/ui/tests/sidebar/HostManagerData.test.ts new file mode 100644 index 00000000..a45556fb --- /dev/null +++ b/src/ui/tests/sidebar/HostManagerData.test.ts @@ -0,0 +1,18 @@ +import { describe, expect, it } from "vitest"; +import type { SSHHostWithStatus } from "@/main-axios"; +import { sshHostToHost } from "@/sidebar/HostManagerData"; + +describe("sshHostToHost", () => { + it("preserves the Wake-on-LAN broadcast address for editing", () => { + const host = sshHostToHost({ + id: 1, + name: "server", + ip: "192.168.0.10", + port: 22, + username: "root", + wolBroadcastAddress: "192.168.0.255", + } as SSHHostWithStatus); + + expect(host.wolBroadcastAddress).toBe("192.168.0.255"); + }); +});