mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +00:00
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:
1 parent
c6bcfdb80d
commit
76b2e5739a
41 files changed
+361
-686
No files matched your search
@@ -67,6 +67,38 @@ function aiPlugin(overrides: Partial<PluginSummary> = {}): PluginSummary {
|
||||
});
|
||||
}
|
||||
|
||||
function remoteDesktopPlugin(
|
||||
overrides: Partial<PluginSummary> = {},
|
||||
): PluginSummary {
|
||||
return plugin({
|
||||
id: "remote-desktop",
|
||||
name: "Remote Desktop",
|
||||
contributes: {
|
||||
tabs: [
|
||||
{
|
||||
id: "rdp",
|
||||
titleKey: "hosts.tabRdp",
|
||||
icon: "Monitor",
|
||||
openFrom: ["host-context-menu", "palette"],
|
||||
},
|
||||
{
|
||||
id: "vnc",
|
||||
titleKey: "hosts.tabVnc",
|
||||
icon: "MousePointerClick",
|
||||
openFrom: ["host-context-menu", "palette"],
|
||||
},
|
||||
{
|
||||
id: "telnet",
|
||||
titleKey: "hosts.tabTelnet",
|
||||
icon: "Terminal",
|
||||
openFrom: ["host-context-menu", "palette"],
|
||||
},
|
||||
],
|
||||
},
|
||||
...overrides,
|
||||
});
|
||||
}
|
||||
|
||||
describe("plugin state applied to the shell", () => {
|
||||
afterEach(() => {
|
||||
resetPluginState();
|
||||
@@ -181,6 +213,39 @@ describe("plugin state applied to the shell", () => {
|
||||
expect(isTabTypeAvailable("terminal")).toBe(true);
|
||||
});
|
||||
|
||||
it("allows rdp/vnc/telnet tabs while remote-desktop is enabled", () => {
|
||||
applyPluginState([remoteDesktopPlugin({ enabled: true })]);
|
||||
expect(isTabTypeAvailable("rdp")).toBe(true);
|
||||
expect(isTabTypeAvailable("vnc")).toBe(true);
|
||||
expect(isTabTypeAvailable("telnet")).toBe(true);
|
||||
});
|
||||
|
||||
it("blocks rdp/vnc/telnet tabs when remote-desktop is disabled", () => {
|
||||
applyPluginState([remoteDesktopPlugin({ enabled: false })]);
|
||||
expect(isTabTypeAvailable("rdp")).toBe(false);
|
||||
expect(isTabTypeAvailable("vnc")).toBe(false);
|
||||
expect(isTabTypeAvailable("telnet")).toBe(false);
|
||||
});
|
||||
|
||||
it("allows rdp/vnc/telnet tabs again when remote-desktop is re-enabled", () => {
|
||||
applyPluginState([remoteDesktopPlugin({ enabled: false })]);
|
||||
expect(isTabTypeAvailable("rdp")).toBe(false);
|
||||
|
||||
applyPluginState([remoteDesktopPlugin({ enabled: true })]);
|
||||
expect(isTabTypeAvailable("rdp")).toBe(true);
|
||||
expect(isTabTypeAvailable("vnc")).toBe(true);
|
||||
expect(isTabTypeAvailable("telnet")).toBe(true);
|
||||
});
|
||||
|
||||
it("disabling remote-desktop does not affect the terminal, and vice versa", () => {
|
||||
applyPluginState([
|
||||
remoteDesktopPlugin({ enabled: false }),
|
||||
plugin({ enabled: true }),
|
||||
]);
|
||||
expect(isTabTypeAvailable("rdp")).toBe(false);
|
||||
expect(isTabTypeAvailable("terminal")).toBe(true);
|
||||
});
|
||||
|
||||
it("reports enablement, defaulting to true before the first load", () => {
|
||||
expect(isPluginEnabled("ssh-terminal")).toBe(true);
|
||||
|
||||
|
||||
Reference in new issue
Block a user