Extend HostProtocol union and host models with ET fields
Add 'et' to HostProtocol union type. Add etEnabled, etPort, and etTerminalPath fields to Host and GroupConfig interfaces. Update vaultImport type guards to exclude 'et' from importable protocols. Register ET fields in groupConfig inheritable keys.
This commit is contained in:
@@ -89,6 +89,7 @@ const INHERITABLE_KEYS: (keyof GroupConfig)[] = [
|
||||
'port', 'protocol', 'agentForwarding', 'proxyProfileId', 'proxyConfig', 'hostChain', 'startupCommand',
|
||||
'legacyAlgorithms', 'skipEcdsaHostKey', 'algorithms',
|
||||
'environmentVariables', 'charset', 'moshEnabled', 'moshServerPath',
|
||||
'etEnabled', 'etPort',
|
||||
'telnetEnabled', 'telnetPort', 'telnetUsername', 'telnetPassword',
|
||||
'theme', 'themeOverride', 'fontFamily', 'fontFamilyOverride', 'fontSize', 'fontSizeOverride', 'fontWeight', 'fontWeightOverride',
|
||||
'backspaceBehavior',
|
||||
|
||||
@@ -46,7 +46,7 @@ export interface EnvVar {
|
||||
}
|
||||
|
||||
// Protocol type for connections
|
||||
export type HostProtocol = 'ssh' | 'telnet' | 'mosh' | 'local' | 'serial';
|
||||
export type HostProtocol = 'ssh' | 'telnet' | 'mosh' | 'et' | 'local' | 'serial';
|
||||
|
||||
// Serial port configuration
|
||||
export type SerialParity = 'none' | 'even' | 'odd' | 'mark' | 'space';
|
||||
@@ -70,6 +70,8 @@ interface ProtocolConfig {
|
||||
enabled: boolean;
|
||||
// Mosh-specific
|
||||
moshServerPath?: string;
|
||||
// EternalTerminal-specific
|
||||
etPort?: number;
|
||||
// Protocol-specific theme override
|
||||
theme?: string;
|
||||
}
|
||||
@@ -114,6 +116,8 @@ export interface Host {
|
||||
charset?: string;
|
||||
moshEnabled?: boolean;
|
||||
moshServerPath?: string; // Custom mosh-server path (e.g., /usr/local/bin/mosh-server)
|
||||
etEnabled?: boolean;
|
||||
etPort?: number; // EternalTerminal server port (default: 2022)
|
||||
theme?: string;
|
||||
themeOverride?: boolean; // Explicitly override the global terminal theme for this host
|
||||
fontFamily?: string; // Terminal font family for this host
|
||||
@@ -261,6 +265,8 @@ export interface GroupConfig {
|
||||
charset?: string;
|
||||
moshEnabled?: boolean;
|
||||
moshServerPath?: string;
|
||||
etEnabled?: boolean;
|
||||
etPort?: number;
|
||||
telnetEnabled?: boolean;
|
||||
telnetPort?: number;
|
||||
telnetUsername?: string;
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface ConnectionLog {
|
||||
hostLabel: string; // Display label (e.g., 'Local Terminal' or host label)
|
||||
hostname: string; // Target hostname or 'localhost'
|
||||
username: string; // SSH username or system username
|
||||
protocol: 'ssh' | 'telnet' | 'local' | 'mosh' | 'serial';
|
||||
protocol: 'ssh' | 'telnet' | 'local' | 'mosh' | 'et' | 'serial';
|
||||
startTime: number; // Connection start timestamp
|
||||
endTime?: number; // Connection end timestamp (undefined if still active)
|
||||
localUsername: string; // System username of the local user
|
||||
|
||||
@@ -327,6 +327,7 @@ export interface TerminalSession {
|
||||
protocol?: 'ssh' | 'telnet' | 'local' | 'serial';
|
||||
port?: number;
|
||||
moshEnabled?: boolean;
|
||||
etEnabled?: boolean;
|
||||
shellType?: 'posix' | 'fish' | 'powershell' | 'cmd' | 'unknown';
|
||||
charset?: string; // Connection-time charset override (e.g. for quick-connect serial)
|
||||
// Serial-specific connection settings
|
||||
|
||||
@@ -119,7 +119,7 @@ const normalizeGroupPath = (raw: string | undefined): string | undefined => {
|
||||
|
||||
const normalizeProtocol = (
|
||||
raw: string | undefined,
|
||||
): Exclude<HostProtocol, "mosh"> | undefined => {
|
||||
): Exclude<HostProtocol, "mosh" | "et"> | undefined => {
|
||||
const s = raw?.trim().toLowerCase();
|
||||
if (!s) return undefined;
|
||||
if (s === "ssh" || s === "ssh2" || s === "ssh-2") return "ssh";
|
||||
@@ -154,7 +154,7 @@ const createHost = (input: {
|
||||
username?: string;
|
||||
password?: string;
|
||||
port?: number;
|
||||
protocol?: Exclude<HostProtocol, "mosh">;
|
||||
protocol?: Exclude<HostProtocol, "mosh" | "et">;
|
||||
group?: string;
|
||||
tags?: string[];
|
||||
notes?: string;
|
||||
@@ -210,7 +210,7 @@ const looksLikeHostnameToken = (token: string): boolean => {
|
||||
|
||||
const parseTarget = (
|
||||
raw: string,
|
||||
): { hostname: string; username?: string; port?: number; protocol?: Exclude<HostProtocol, "mosh"> } | null => {
|
||||
): { hostname: string; username?: string; port?: number; protocol?: Exclude<HostProtocol, "mosh" | "et"> } | null => {
|
||||
const trimmed = raw.trim();
|
||||
if (!trimmed) return null;
|
||||
|
||||
@@ -380,7 +380,7 @@ const importFromPuttyReg = (text: string): VaultImportResult => {
|
||||
hostname?: string;
|
||||
username?: string;
|
||||
port?: number;
|
||||
protocol?: Exclude<HostProtocol, "mosh">;
|
||||
protocol?: Exclude<HostProtocol, "mosh" | "et">;
|
||||
};
|
||||
|
||||
const sessions: Session[] = [];
|
||||
@@ -698,7 +698,7 @@ const importFromSecureCrt = (text: string, fileName?: string): VaultImportResult
|
||||
hostname?: string;
|
||||
username?: string;
|
||||
port?: number;
|
||||
protocol?: Exclude<HostProtocol, "mosh">;
|
||||
protocol?: Exclude<HostProtocol, "mosh" | "et">;
|
||||
};
|
||||
|
||||
const sessions: Session[] = [];
|
||||
@@ -832,7 +832,7 @@ const importFromMobaXterm = (text: string): VaultImportResult => {
|
||||
const group =
|
||||
keyParts.length > 1 ? keyParts.slice(0, -1).join("/") : undefined;
|
||||
|
||||
let protocol: Exclude<HostProtocol, "mosh"> | undefined;
|
||||
let protocol: Exclude<HostProtocol, "mosh" | "et"> | undefined;
|
||||
let hostname: string | undefined;
|
||||
let username: string | undefined;
|
||||
let port: number | undefined;
|
||||
|
||||
Reference in New Issue
Block a user