fix: preserve WoL broadcast address (#1097)

This commit is contained in:
ZacharyZcR
2026-07-28 01:47:42 +08:00
committed by GitHub
parent c12fc19c76
commit 5c30c5862f
2 changed files with 19 additions and 0 deletions
+1
View File
@@ -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),
@@ -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");
});
});