mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-08-23 22:47:00 +00:00
fix: preserve WoL broadcast address (#1097)
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user