feat: wire remote-desktop plugin into core and rename i18n keys

Repoints core consumers (dispatcher, collab, session-sharing, tab
utils) at the plugin, adds isTabTypeAvailable gating for rdp/vnc/
telnet, widens hostCapability to accept an array, and renames the
guacamole i18n namespace to remoteDesktop.
This commit is contained in:
LukeGus committed 2026-09-21 20:26:09 -05:00
1 parent c6bcfdb80d
commit 76b2e5739a
41 files changed
+361 -686

No files matched your search

+26 -23
View File
@@ -539,11 +539,12 @@ export function CommandPalette({
handleAction(() => {
const type = host.enableSsh
? "terminal"
: host.enableRdp
: host.enableRdp && isTabTypeAvailable("rdp")
? "rdp"
: host.enableVnc
: host.enableVnc && isTabTypeAvailable("vnc")
? "vnc"
: host.enableTelnet
: host.enableTelnet &&
isTabTypeAvailable("telnet")
? "telnet"
: "terminal";
onOpenTab(type, host.name);
@@ -599,12 +600,13 @@ export function CommandPalette({
),
)}
{host.enableSsh &&
(host.enableRdp ||
host.enableVnc ||
host.enableTelnet) && (
((host.enableRdp && isTabTypeAvailable("rdp")) ||
(host.enableVnc && isTabTypeAvailable("vnc")) ||
(host.enableTelnet &&
isTabTypeAvailable("telnet"))) && (
<div className="w-px h-3.5 bg-border/60 mx-0.5 shrink-0" />
)}
{host.enableRdp && (
{host.enableRdp && isTabTypeAvailable("rdp") && (
<button
title="RDP"
onClick={(e) => {
@@ -619,7 +621,7 @@ export function CommandPalette({
RDP
</button>
)}
{host.enableVnc && (
{host.enableVnc && isTabTypeAvailable("vnc") && (
<button
title="VNC"
onClick={(e) => {
@@ -634,21 +636,22 @@ export function CommandPalette({
VNC
</button>
)}
{host.enableTelnet && (
<button
title="Telnet"
onClick={(e) => {
e.stopPropagation();
handleAction(() =>
onOpenTab("telnet", host.name),
);
}}
className="flex items-center gap-1 px-2 h-6 rounded text-xs font-medium text-muted-foreground/70 hover:text-foreground hover:bg-muted-foreground/10 transition-colors border border-border/40"
>
<Terminal className="size-3" />
Telnet
</button>
)}
{host.enableTelnet &&
isTabTypeAvailable("telnet") && (
<button
title="Telnet"
onClick={(e) => {
e.stopPropagation();
handleAction(() =>
onOpenTab("telnet", host.name),
);
}}
className="flex items-center gap-1 px-2 h-6 rounded text-xs font-medium text-muted-foreground/70 hover:text-foreground hover:bg-muted-foreground/10 transition-colors border border-border/40"
>
<Terminal className="size-3" />
Telnet
</button>
)}
{canEditHost(host) && (
<>
<div className="w-px h-3.5 bg-border/60 mx-0.5 shrink-0" />
+1
View File
@@ -40,6 +40,7 @@ import {
*/
const BUILT_IN_TABS_BY_PLUGIN: Record<string, string[]> = {
"ssh-terminal": ["terminal"],
"remote-desktop": ["rdp", "vnc", "telnet"],
ai: ["ai"],
};
+6 -3
View File
@@ -39,7 +39,7 @@ import type {
TerminalHandle,
TerminalHostConfig,
} from "@/features/terminal/Terminal";
import type { GuacamoleAppHandle } from "@/features/guacamole/GuacamoleApp";
import type { GuacamoleAppHandle } from "../../../plugins/remote-desktop/frontend/GuacamoleApp";
import { useIsMobile } from "@/hooks/use-mobile";
import type { Tab, TabType, Host } from "@/types/ui-types";
import {
@@ -110,7 +110,7 @@ const loadTmuxMonitor = () =>
}));
const TmuxMonitor = lazy(loadTmuxMonitor);
const loadGuacamoleApp = () =>
import("@/features/guacamole/GuacamoleApp").then((m) => ({
import("../../../plugins/remote-desktop/frontend/GuacamoleApp").then((m) => ({
default: m.default,
}));
const GuacamoleApp = lazy(loadGuacamoleApp);
@@ -655,7 +655,10 @@ export function renderTabContent(
case "telnet":
if (!host)
return (
<EmptyState icon={Monitor} messageKey="guacamole.noHostSelected" />
<EmptyState
icon={Monitor}
messageKey="remoteDesktop.noHostSelected"
/>
);
return withTabSuspense(
<GuacamoleApp