mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: finish the remote-desktop plugin (B14)
This commit is contained in:
1 parent
0af2c94983
commit
14eb558b85
215 files changed
+30029
-3921
No files matched your search
@@ -8,29 +8,24 @@ export const SUPPORTED_AUTH_OVERRIDE_PROTOCOLS =
|
||||
export const AUTH_PROTOCOL_METADATA = {
|
||||
ssh: {
|
||||
label: "SSH",
|
||||
enableField: "enableSsh",
|
||||
credentialField: "credentialId",
|
||||
},
|
||||
rdp: {
|
||||
label: "RDP",
|
||||
enableField: "enableRdp",
|
||||
credentialField: "rdpCredentialId",
|
||||
},
|
||||
vnc: {
|
||||
label: "VNC",
|
||||
enableField: "enableVnc",
|
||||
credentialField: "vncCredentialId",
|
||||
},
|
||||
telnet: {
|
||||
label: "Telnet",
|
||||
enableField: "enableTelnet",
|
||||
credentialField: "telnetCredentialId",
|
||||
},
|
||||
} as const satisfies Record<
|
||||
AuthOverrideProtocol,
|
||||
{
|
||||
label: string;
|
||||
enableField: "enableSsh" | "enableRdp" | "enableVnc" | "enableTelnet";
|
||||
credentialField:
|
||||
| "credentialId"
|
||||
| "rdpCredentialId"
|
||||
|
||||
Vendored
-6
@@ -50,12 +50,6 @@ export type LocalPathMutationResult =
|
||||
export interface ElectronAPI {
|
||||
getAppVersion: () => Promise<string>;
|
||||
getPlatform: () => Promise<string>;
|
||||
openNativeRdp: (options: {
|
||||
host: string;
|
||||
port?: number;
|
||||
username?: string;
|
||||
domain?: string;
|
||||
}) => Promise<{ success: boolean; error?: string }>;
|
||||
getSetting?: (key: string) => Promise<string | null | undefined>;
|
||||
setSetting?: (key: string, value: string) => Promise<void>;
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
/**
|
||||
* Per-host Guacamole connection settings, as edited in the host editor and
|
||||
* forwarded to guacd. Field names are camelCase here and translated to the
|
||||
* hyphenated protocol parameters in toGuacamoleParams().
|
||||
*/
|
||||
export interface GuacamoleConfig {
|
||||
colorDepth?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
dpi?: number;
|
||||
resizeMethod?: string;
|
||||
forceLossless?: boolean;
|
||||
disableAudio?: boolean;
|
||||
enableAudioInput?: boolean;
|
||||
enableWallpaper?: boolean;
|
||||
enableTheming?: boolean;
|
||||
enableFontSmoothing?: boolean;
|
||||
enableFullWindowDrag?: boolean;
|
||||
enableDesktopComposition?: boolean;
|
||||
enableMenuAnimations?: boolean;
|
||||
disableBitmapCaching?: boolean;
|
||||
disableOffscreenCaching?: boolean;
|
||||
disableGlyphCaching?: boolean;
|
||||
disableGfx?: boolean;
|
||||
enablePrinting?: boolean;
|
||||
printerName?: string;
|
||||
enableDrive?: boolean;
|
||||
driveName?: string;
|
||||
drivePath?: string;
|
||||
createDrivePath?: boolean;
|
||||
disableDownload?: boolean;
|
||||
disableUpload?: boolean;
|
||||
enableTouch?: boolean;
|
||||
clientName?: string;
|
||||
console?: boolean;
|
||||
initialProgram?: string;
|
||||
serverLayout?: string;
|
||||
timezone?: string;
|
||||
gatewayHostname?: string;
|
||||
gatewayPort?: number;
|
||||
gatewayUsername?: string;
|
||||
gatewayPassword?: string;
|
||||
gatewayDomain?: string;
|
||||
remoteApp?: string;
|
||||
remoteAppDir?: string;
|
||||
remoteAppArgs?: string;
|
||||
normalizeClipboard?: string;
|
||||
disableCopy?: boolean;
|
||||
disablePaste?: boolean;
|
||||
cursor?: string;
|
||||
swapRedBlue?: boolean;
|
||||
readOnly?: boolean;
|
||||
recordingPath?: string;
|
||||
recordingName?: string;
|
||||
createRecordingPath?: boolean;
|
||||
recordingExcludeOutput?: boolean;
|
||||
recordingExcludeMouse?: boolean;
|
||||
recordingIncludeKeys?: boolean;
|
||||
wolSendPacket?: boolean;
|
||||
wolMacAddr?: string;
|
||||
wolBroadcastAddr?: string;
|
||||
wolUdpPort?: number;
|
||||
wolWaitTime?: number;
|
||||
}
|
||||
@@ -36,7 +36,8 @@ export interface HostSidebarFilterState {
|
||||
status: ("online" | "offline" | "pinned")[];
|
||||
/** SSH auth type ids; plugins add their own. */
|
||||
authType: string[];
|
||||
protocol: ("ssh" | "rdp" | "vnc" | "telnet")[];
|
||||
/** "ssh" or a plugin protocol id. */
|
||||
protocol: string[];
|
||||
features: ("terminal" | "fileManager" | "tunnel" | "docker")[];
|
||||
tags: string[];
|
||||
}
|
||||
@@ -93,14 +94,8 @@ const FILTER_STATUS: HostSidebarFilterState["status"] = [
|
||||
"offline",
|
||||
"pinned",
|
||||
];
|
||||
/** Same shape as a manifest's contributes.auth.sshAuthTypes entries. */
|
||||
/** Same shape as a manifest's auth type and protocol ids. */
|
||||
const AUTH_TYPE_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
||||
const FILTER_PROTOCOL: HostSidebarFilterState["protocol"] = [
|
||||
"ssh",
|
||||
"rdp",
|
||||
"vnc",
|
||||
"telnet",
|
||||
];
|
||||
const FILTER_FEATURES: HostSidebarFilterState["features"] = [
|
||||
"terminal",
|
||||
"fileManager",
|
||||
@@ -174,7 +169,9 @@ export function sanitizeHostSidebarPreferences(
|
||||
authType: sanitizeStringArray(filtersObj.authType).filter((value) =>
|
||||
AUTH_TYPE_PATTERN.test(value),
|
||||
),
|
||||
protocol: sanitizeEnumArray(filtersObj.protocol, FILTER_PROTOCOL),
|
||||
protocol: sanitizeStringArray(filtersObj.protocol).filter((value) =>
|
||||
AUTH_TYPE_PATTERN.test(value),
|
||||
),
|
||||
features: sanitizeEnumArray(filtersObj.features, FILTER_FEATURES),
|
||||
tags: sanitizeStringArray(filtersObj.tags),
|
||||
};
|
||||
|
||||
+4
-25
@@ -1,4 +1,3 @@
|
||||
import type { GuacamoleConfig } from "./guacamole-config.js";
|
||||
import type { StatsConfig } from "./stats-widgets.js";
|
||||
import type { Request } from "express";
|
||||
import type { RefObject } from "react";
|
||||
@@ -250,29 +249,19 @@ export type Host = {
|
||||
delay?: number;
|
||||
}>;
|
||||
|
||||
connectionType?: "ssh" | "rdp" | "vnc" | "telnet";
|
||||
/** "ssh", or the id of the plugin protocol a host without SSH uses. */
|
||||
connectionType?: string;
|
||||
domain?: string;
|
||||
security?: string;
|
||||
ignoreCert?: boolean;
|
||||
guacamoleConfig?: string | GuacamoleConfig;
|
||||
dockerConfig?: Record<string, unknown> | null;
|
||||
enableWebUi?: boolean;
|
||||
webUiConfig?: WebUiConfig | null;
|
||||
|
||||
enableSsh?: boolean;
|
||||
enableRdp?: boolean;
|
||||
enableVnc?: boolean;
|
||||
enableTelnet?: boolean;
|
||||
sshPort?: number;
|
||||
rdpPort?: number;
|
||||
vncPort?: number;
|
||||
telnetPort?: number;
|
||||
rdpCredentialId?: number | null;
|
||||
rdpUser?: string;
|
||||
rdpPassword?: string;
|
||||
rdpDomain?: string;
|
||||
rdpSecurity?: string;
|
||||
rdpIgnoreCert?: boolean;
|
||||
vncCredentialId?: number | null;
|
||||
vncPassword?: string;
|
||||
vncUser?: string;
|
||||
@@ -415,29 +404,19 @@ export interface HostData {
|
||||
delay?: number;
|
||||
}>;
|
||||
|
||||
connectionType?: "ssh" | "rdp" | "vnc" | "telnet";
|
||||
/** "ssh", or the id of the plugin protocol a host without SSH uses. */
|
||||
connectionType?: string;
|
||||
domain?: string;
|
||||
security?: string;
|
||||
ignoreCert?: boolean;
|
||||
guacamoleConfig?: GuacamoleConfig | null;
|
||||
dockerConfig?: Record<string, unknown> | null;
|
||||
enableWebUi?: boolean;
|
||||
webUiConfig?: WebUiConfig | null;
|
||||
|
||||
enableSsh?: boolean;
|
||||
enableRdp?: boolean;
|
||||
enableVnc?: boolean;
|
||||
enableTelnet?: boolean;
|
||||
sshPort?: number;
|
||||
rdpPort?: number;
|
||||
vncPort?: number;
|
||||
telnetPort?: number;
|
||||
rdpCredentialId?: number | null;
|
||||
rdpUser?: string;
|
||||
rdpPassword?: string;
|
||||
rdpDomain?: string;
|
||||
rdpSecurity?: string;
|
||||
rdpIgnoreCert?: boolean;
|
||||
vncCredentialId?: number | null;
|
||||
vncPassword?: string;
|
||||
vncUser?: string;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { GuacamoleConfig } from "./guacamole-config.js";
|
||||
import type { TerminalConfig } from "./index.js";
|
||||
import type { StatsConfig } from "./stats-widgets.js";
|
||||
import type { HostAuthOverrides } from "./auth-protocols.js";
|
||||
@@ -152,14 +151,8 @@ export type Host = {
|
||||
quickActions: { name: string; snippetId: string }[];
|
||||
|
||||
enableSsh: boolean;
|
||||
enableRdp: boolean;
|
||||
enableVnc: boolean;
|
||||
enableTelnet: boolean;
|
||||
|
||||
sshPort: number;
|
||||
rdpPort: number;
|
||||
vncPort: number;
|
||||
telnetPort: number;
|
||||
|
||||
rdpAuthType?: "direct" | "credential" | "none";
|
||||
rdpCredentialId?: string;
|
||||
@@ -167,8 +160,6 @@ export type Host = {
|
||||
rdpPassword?: string;
|
||||
hasRdpPassword?: boolean;
|
||||
domain?: string;
|
||||
security?: string;
|
||||
ignoreCert?: boolean;
|
||||
|
||||
vncAuthType?: "direct" | "credential";
|
||||
vncCredentialId?: string;
|
||||
@@ -182,7 +173,6 @@ export type Host = {
|
||||
telnetPassword?: string;
|
||||
hasTelnetPassword?: boolean;
|
||||
|
||||
guacamoleConfig?: GuacamoleConfig;
|
||||
/** Host-scope plugin settings, keyed by plugin id. Secrets are redacted. */
|
||||
pluginSettings?: Record<string, Record<string, unknown>>;
|
||||
forceKeyboardInteractive?: boolean;
|
||||
|
||||
Reference in new issue
Block a user