feat: plugins only see their own host settings in the browser

This commit is contained in:
LukeGus committed 2026-09-29 13:38:11 -05:00
1 parent 50d43e29fb
commit fb9c168b6b
17 files changed
+488 -52

No files matched your search

+5 -1
View File
@@ -1,6 +1,6 @@
import { Zap } from "lucide-react";
import type { TermixApp } from "@termix/plugin-sdk/frontend";
import { hasMacAddress, wakeHost } from "./host-action.js";
import { hasMacAddress, macAddressOf, wakeHost } from "./host-action.js";
export function activate(app: TermixApp): void {
app.registerHostAction({
@@ -12,4 +12,8 @@ export function activate(app: TermixApp): void {
when: (host) => hasMacAddress(host),
run: (host) => wakeHost(app.api, app.t, String(host.id)),
});
// A saved host's MAC address, for plugins that send their own wake packet.
app.registerAction("wakeOnLan.macAddress", ((hostId: string | number) =>
macAddressOf(app.getHost(hostId))) as never);
}