mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +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
@@ -7,7 +7,6 @@ import {
|
||||
SquareTerminal,
|
||||
Terminal,
|
||||
} from "lucide-react";
|
||||
import { listHosts } from "@termix/plugin-sdk/frontend";
|
||||
import type {
|
||||
PanelProps,
|
||||
PluginHostRecord,
|
||||
@@ -309,9 +308,11 @@ export function activate(app: TermixApp): void {
|
||||
);
|
||||
let host: PluginHostRecord | null | undefined = request.host;
|
||||
if (!host && request.hostId !== undefined) {
|
||||
host = (await listHosts().catch(() => [])).find(
|
||||
(entry) => String(entry.id) === String(request.hostId),
|
||||
);
|
||||
host =
|
||||
app.getHost(request.hostId) ??
|
||||
(await app.listHosts().catch(() => [])).find(
|
||||
(entry) => String(entry.id) === String(request.hostId),
|
||||
);
|
||||
}
|
||||
return resolveTerminalLook({ ...request, host }, settings?.user);
|
||||
}) as never);
|
||||
|
||||
Reference in new issue
Block a user