feat(i18n): add multi-language support (ja/ko/vi/ru/zh-TW) with system auto-detection

- Extend AppLanguage to 7 locales: zh-CN, zh-TW, en, ja, ko, vi, ru
- Auto-detect system language via navigator.languages; fallback to English
- Add BCP47 locale mapping for date formatting and sorting
- Create 50 translation JSON files (5 languages × 10 namespaces, 1137 keys each)
- Update language selector with native language names
- Extend locale key parity test to cover all 7 languages (70 assertions)
- Add VNC/RDP desktop, serial terminal, AI agent, port forwarding, and SFTP features
- Add credential encryption, host metrics, session backup crypto, and zmodem bridge
- Update Rust backend: desktop services, host metrics, SSH/SFTP enhancements
This commit is contained in:
Logan.Li committed 2026-08-12 00:07:48 +08:00
1 parent fea6d8db04
commit b0d0e3a5f3
301 files changed
+28002 -2705

No files matched your search

+14
View File
@@ -2,8 +2,20 @@ export type AiProtocol = 'openai-chat' | 'openai-responses' | 'anthropic'
export type AiAuthStyle = 'bearer' | 'x-api-key' | 'both' | 'none'
/** 计费/部署形态:按量 · Plan/套餐 · 本地私有化 */
export type AiBillingMode = 'payg' | 'plan' | 'local'
/**
* Provider 产品分组(UI / 预设分类):
* - openai_compatible:按量 OpenAI 兼容
* - standalone:Anthropic / Google Gemini
* - plan:套餐/Plan(GLM、MiniMax Token Plan、Kimi Code Plan)
* - local:Ollama / VLLM 私有化
* - custom:未收录供应商自填
*/
export type AiProviderFamily = 'openai_compatible' | 'standalone' | 'plan' | 'local' | 'custom'
export type AiModelCapability = 'chat' | 'reasoning' | 'plan'
export interface AiModelConfig {
@@ -23,6 +35,8 @@ export interface AiProviderConfig {
id: string
name: string
presetId?: string
/** Product family for UI grouping; optional on legacy rows. */
family?: AiProviderFamily
protocol: AiProtocol
authStyle: AiAuthStyle
baseUrl: string
+95
View File
@@ -0,0 +1,95 @@
/** Shared remote-desktop (RDP / VNC) contracts for the renderer. */
export type DesktopProtocol = 'rdp' | 'vnc'
export type DesktopSecurity = 'nla' | 'tls' | 'rdp' | 'auto'
export interface RdpConfig {
host: string
port?: number
username: string
password: string
domain?: string
/** Default NLA (CredSSP). */
security?: DesktopSecurity
width?: number
height?: number
}
export interface VncConfig {
host: string
port?: number
/** Optional VNC password (DES challenge). */
password?: string
width?: number
height?: number
}
export type DesktopSessionConfig =
| { protocol: 'rdp'; config: RdpConfig }
| { protocol: 'vnc'; config: VncConfig }
export interface DesktopOpenResponse {
sessionId: string
}
export interface DesktopStatusEvent {
sessionId: string
status: 'connecting' | 'connected' | 'disconnected' | 'error'
message?: string
width?: number
height?: number
}
/** Dirty-rectangle frame. Prefer JPEG (`encoding: 'jpeg'`); `rgba` is raw w*h*4 fallback. */
export interface DesktopFrameEvent {
sessionId: string
x: number
y: number
width: number
height: number
/** Full framebuffer width (for canvas sizing). */
fbWidth: number
/** Full framebuffer height. */
fbHeight: number
encoding: 'jpeg' | 'rgba'
dataBase64: string
}
export type DesktopPointerButton = 'left' | 'middle' | 'right' | 'wheel_up' | 'wheel_down'
export interface DesktopPointerEvent {
x: number
y: number
button?: DesktopPointerButton
pressed?: boolean
/** true = pointer move (may include held button for drag). */
moving?: boolean
}
export interface DesktopKeyEvent {
key: string
code: string
pressed: boolean
altKey?: boolean
ctrlKey?: boolean
metaKey?: boolean
shiftKey?: boolean
}
export interface RdpClipboardEvent {
sessionId: string
text: string
}
export interface VncClipboardEvent {
sessionId: string
text: string
}
export interface RdpFileDownloadEvent {
sessionId: string
name: string
/** Absolute path in the host Downloads folder. */
path: string
}
+26
View File
@@ -0,0 +1,26 @@
export interface HostDiskMetric {
mount: string
percent: number
usedKb: number
totalKb: number
}
export interface HostMetrics {
/** /etc/os-release PRETTY_NAME, e.g. Ubuntu 24.04.4 LTS */
osPrettyName?: string
timezone?: string
timezoneOffset?: string
uptimeSec?: number
cpuPercent?: number
memUsedKb?: number
memTotalKb?: number
memPercent?: number
disks: HostDiskMetric[]
}
export interface HostMetricsResponse {
success: boolean
skipped?: boolean
metrics?: HostMetrics
error?: string
}
+1
View File
@@ -11,3 +11,4 @@ export * from './ipc.types'
export * from './known-hosts.types'
export * from './serial.types'
export * from './ai.types'
export * from './host-metrics.types'
+5
View File
@@ -1,5 +1,7 @@
export type SerialParity = 'none' | 'odd' | 'even'
export type SerialFlowControl = 'none' | 'software' | 'hardware'
/** What to send when the user presses Enter (UART has no PTY line discipline). */
export type SerialLineEnding = 'lf' | 'cr' | 'crlf'
export interface SerialConfig {
path: string
@@ -8,6 +10,9 @@ export interface SerialConfig {
stopBits: 1 | 2
parity: SerialParity
flowControl: SerialFlowControl
/** Optional local echo — only for serial (PTY backends must stay echo-off). */
localEcho?: boolean
lineEnding?: SerialLineEnding
}
export interface SerialPortSummary {
+28 -2
View File
@@ -6,6 +6,9 @@
// 认证方式
export type AuthType = 'password' | 'key' | 'agent'
/** Persisted session protocol. Missing/undefined means SSH (legacy rows). */
export type SessionProtocol = 'ssh' | 'rdp' | 'vnc'
// 代理类型
export type ProxyType = 'none' | 'http' | 'socks5'
@@ -65,9 +68,12 @@ export interface Session {
port: number
username: string
authType: AuthType
/** Defaults to ssh when omitted (legacy sessions). */
protocol?: SessionProtocol
password?: string // 加密存储
privateKey?: string // 私钥路径或内容
passphrase?: string // 私钥密码
/** 私钥路径或 PEM 正文;落盘时由 Rust 加密 */
privateKey?: string
passphrase?: string // 私钥密码(加密存储)
proxy?: ProxyConfig // 代理配置
/** 连接成功后自动执行的启动命令 */
startupCommand?: string
@@ -79,6 +85,20 @@ export interface Session {
jumpHost?: JumpHostConfig
/** 内联多跳板链 */
jumpHosts?: JumpHostConfig[]
/** RDP domain (optional). */
domain?: string
/** RDP security mode. */
security?: 'nla' | 'tls' | 'rdp' | 'auto'
/** Desktop resolution hint (RDP/VNC). */
width?: number
height?: number
/**
* Detected or manual remote OS / distro icon id
* (ubuntu, debian, windows, vnc, linux, …).
*/
distro?: string
/** Human-readable OS from PRETTY_NAME (e.g. Ubuntu 24.04.4 LTS). */
osPrettyName?: string
group?: string
tags?: string[]
createdAt?: number
@@ -92,6 +112,7 @@ export interface SessionCreateRequest {
port: number
username: string
authType: AuthType
protocol?: SessionProtocol
password?: string
privateKey?: string
passphrase?: string
@@ -101,6 +122,11 @@ export interface SessionCreateRequest {
jumpSessionIds?: string[]
jumpHost?: JumpHostConfig
jumpHosts?: JumpHostConfig[]
domain?: string
security?: 'nla' | 'tls' | 'rdp' | 'auto'
width?: number
height?: number
distro?: string
group?: string
tags?: string[]
}
+2
View File
@@ -26,6 +26,8 @@ export interface TransferTask {
transferred: number
speed?: number // bytes per second
startTime?: number
/** Directory recursive transfer (upload_dir / download_dir). */
isDirectory?: boolean
}
// 传输进度