mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-31 23:55:23 +00:00
feat: plugins only see their own host settings in the browser
This commit is contained in:
1 parent
50d43e29fb
commit
fb9c168b6b
17 files changed
+488
-52
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user