@fish-under-sea/dsh-ssh-fish 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +4 -4
- package/README.md +4 -4
- package/package.json +1 -1
- package/README.i18n.yaml +0 -6
- package/README.zh.md +0 -31
- package/lib/client.js +0 -17100
- package/lib/client.js.map +0 -1
- package/lib/index.js +0 -3625
- package/lib/types/client/api.d.ts +0 -162
- package/lib/types/client/index.d.ts +0 -37
- package/lib/types/client/locales.d.ts +0 -175
- package/lib/types/client/native-panel.d.ts +0 -70
- package/lib/types/client/panel/ClusterTab.d.ts +0 -7
- package/lib/types/client/panel/HostFormDialog.d.ts +0 -12
- package/lib/types/client/panel/HostsTab.d.ts +0 -25
- package/lib/types/client/panel/SshPanel.d.ts +0 -14
- package/lib/types/client/panel/TerminalTab.d.ts +0 -27
- package/lib/types/client/panel/TransferTab.d.ts +0 -7
- package/lib/types/client/panel/TunnelsTab.d.ts +0 -19
- package/lib/types/client/panel/controller.d.ts +0 -253
- package/lib/types/client/panel/helpers.d.ts +0 -45
- package/lib/types/client/panel/xterm.css.d.ts +0 -2
- package/lib/types/client/settings-binding.d.ts +0 -61
- package/lib/types/dsh-home.d.ts +0 -16
- package/lib/types/engine/cluster.d.ts +0 -19
- package/lib/types/engine/connection-pool.d.ts +0 -163
- package/lib/types/engine/proxy-command.d.ts +0 -36
- package/lib/types/engine/pty.d.ts +0 -32
- package/lib/types/engine/sftp.d.ts +0 -20
- package/lib/types/engine/terminal-sessions.d.ts +0 -67
- package/lib/types/engine/tunnel.d.ts +0 -36
- package/lib/types/engine.d.ts +0 -96
- package/lib/types/http.d.ts +0 -59
- package/lib/types/index.d.ts +0 -93
- package/lib/types/loopback.d.ts +0 -64
- package/lib/types/mount-once.d.ts +0 -55
- package/lib/types/protocol.d.ts +0 -256
- package/lib/types/routes.d.ts +0 -33
- package/lib/types/ssh-config.d.ts +0 -34
- package/lib/types/store.d.ts +0 -78
- package/lib/types/tool-surface.d.ts +0 -72
- package/lib/types/tools.d.ts +0 -43
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-side API client for the /api/dsh-ssh route family. The only data
|
|
3
|
-
* access path the panel components use — plain fetch/WebSocket, same origin.
|
|
4
|
-
*/
|
|
5
|
-
import { type ClusterResult, type ExecResult, type HostPayload, type ImportResult, type RemoteDirEntry, type SshHostSummary, type TestResult, type TransferProgress, type TunnelInfo } from '../protocol.ts';
|
|
6
|
-
/** Error carrying the route's JSON error message. */
|
|
7
|
-
export declare class SshApiError extends Error {
|
|
8
|
-
constructor(message: string);
|
|
9
|
-
}
|
|
10
|
-
/** The location facts a terminal socket URL is built from. */
|
|
11
|
-
interface PageLocation {
|
|
12
|
-
/** Page scheme with its colon (for example `https:` or `dsh-app:`). */
|
|
13
|
-
protocol: string;
|
|
14
|
-
/** Page authority, empty for a scheme that carries none. */
|
|
15
|
-
host: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* The WebSocket URL the terminal route is reached at, or undefined when this
|
|
19
|
-
* page cannot carry one.
|
|
20
|
-
*
|
|
21
|
-
* A web page resolves the socket against its own origin, exactly as before.
|
|
22
|
-
*
|
|
23
|
-
* A page delivered by an application on this machine (the official DSH Desktop
|
|
24
|
-
* shell serves its Web GUI from `dsh-app://app/`) cannot carry a socket on its
|
|
25
|
-
* own scheme: the protocol handler forwards HTTP to the local Host but has no
|
|
26
|
-
* upgrade to forward. That is exactly the case the official transport hook
|
|
27
|
-
* covers - the shell publishes `__DSH_TRANSPORT__.streamBaseUrl`, the loopback
|
|
28
|
-
* authority of the Host it owns and already forwards every other request to
|
|
29
|
-
* (issue #1744). The socket is therefore dialed there instead, with the `ws`/
|
|
30
|
-
* `wss` scheme derived from that base, which is what the shell's
|
|
31
|
-
* `onBeforeSendHeaders` hook expects to see before it attaches its
|
|
32
|
-
* authority-bound credential.
|
|
33
|
-
*
|
|
34
|
-
* The base is used only on an application-delivered page. A web page that
|
|
35
|
-
* somehow carries the hook (the remote channel grants `ownsHost` to a paired
|
|
36
|
-
* LAN page, and that page is fenced behind a pairing channel) keeps resolving
|
|
37
|
-
* against its own origin, so this cannot reroute gated traffic onto a host the
|
|
38
|
-
* page is not entitled to reach. A blank authority is treated the same as an
|
|
39
|
-
* application scheme with no base: there is nothing to dial, and the caller
|
|
40
|
-
* gets the actionable reason instead of a socket that can only fail.
|
|
41
|
-
*
|
|
42
|
-
* @param location - the page location to read.
|
|
43
|
-
* @param search - the query string carrying `alias` or `session`.
|
|
44
|
-
* @param streamBaseUrl - `__DSH_TRANSPORT__.streamBaseUrl`, when the shell published one.
|
|
45
|
-
* @returns the absolute `ws:`/`wss:` URL, or undefined when the page cannot carry one.
|
|
46
|
-
*/
|
|
47
|
-
export declare function terminalSocketUrl(location: PageLocation, search: string, streamBaseUrl?: string | undefined): string | undefined;
|
|
48
|
-
/** One open terminal connection (WebSocket JSON frames). */
|
|
49
|
-
export interface TerminalConnection {
|
|
50
|
-
/** Fired on the ready frame (shell is up); carries the host session id and alias. */
|
|
51
|
-
onReady: ((sessionId: string, alias: string) => void) | undefined;
|
|
52
|
-
/** Fired on every output frame. */
|
|
53
|
-
onOutput: ((data: string) => void) | undefined;
|
|
54
|
-
/** Fired on the exit frame (or transport error). */
|
|
55
|
-
onExit: ((code: number | null, error?: string) => void) | undefined;
|
|
56
|
-
/** Fired when the server requests keyboard-interactive 2FA. */
|
|
57
|
-
onAuthPrompt: ((name: string, instructions: string, prompts: Array<{
|
|
58
|
-
prompt: string;
|
|
59
|
-
echo: boolean;
|
|
60
|
-
}>) => void) | undefined;
|
|
61
|
-
/** Send raw input to the remote shell. */
|
|
62
|
-
send(data: string): void;
|
|
63
|
-
/** Resize the remote PTY. */
|
|
64
|
-
resize(cols: number, rows: number): void;
|
|
65
|
-
/** Send interactive 2FA response codes to the remote server. */
|
|
66
|
-
sendAuthResponse(responses: string[]): void;
|
|
67
|
-
/**
|
|
68
|
-
* Leave the socket while the host keeps the remote shell alive, so a later
|
|
69
|
-
* {@link SshApi.attachTerminal} picks the session up where it left off.
|
|
70
|
-
* This is what a view does on unmount; it is not a disconnect.
|
|
71
|
-
*/
|
|
72
|
-
detach(): void;
|
|
73
|
-
/** Close the socket and end the remote session. */
|
|
74
|
-
close(): void;
|
|
75
|
-
}
|
|
76
|
-
/** The browser half's only data entry point. */
|
|
77
|
-
export declare class SshApi {
|
|
78
|
-
listHosts(queryText?: string): Promise<SshHostSummary[]>;
|
|
79
|
-
createHost(payload: HostPayload): Promise<SshHostSummary>;
|
|
80
|
-
updateHost(alias: string, patch: HostPayload): Promise<SshHostSummary>;
|
|
81
|
-
deleteHost(alias: string): Promise<void>;
|
|
82
|
-
importSshConfig(): Promise<ImportResult>;
|
|
83
|
-
testHost(alias: string): Promise<TestResult>;
|
|
84
|
-
exec(alias: string, command: string, timeoutMs?: number): Promise<ExecResult>;
|
|
85
|
-
cluster(options: {
|
|
86
|
-
command: string;
|
|
87
|
-
aliases?: string[];
|
|
88
|
-
environment?: string;
|
|
89
|
-
tags?: string[];
|
|
90
|
-
timeoutMs?: number;
|
|
91
|
-
maxWorkers?: number;
|
|
92
|
-
}): Promise<ClusterResult[]>;
|
|
93
|
-
ls(alias: string, path: string): Promise<RemoteDirEntry[]>;
|
|
94
|
-
listTunnels(): Promise<TunnelInfo[]>;
|
|
95
|
-
startTunnel(options: {
|
|
96
|
-
alias: string;
|
|
97
|
-
remotePort: number;
|
|
98
|
-
remoteHost?: string;
|
|
99
|
-
localPort?: number;
|
|
100
|
-
}): Promise<TunnelInfo>;
|
|
101
|
-
stopTunnel(tunnelId: string): Promise<boolean>;
|
|
102
|
-
stopAllTunnels(alias?: string): Promise<number>;
|
|
103
|
-
/**
|
|
104
|
-
* Upload one file (raw bytes) to a remote path. Progress arrives through
|
|
105
|
-
* the NDJSON response stream; resolves when the result frame lands.
|
|
106
|
-
*/
|
|
107
|
-
uploadFile(file: File, alias: string, remotePath: string, onProgress?: (progress: TransferProgress) => void): Promise<{
|
|
108
|
-
transferredBytes: number;
|
|
109
|
-
}>;
|
|
110
|
-
/**
|
|
111
|
-
* Download a remote file with client-side progress. Streams straight to
|
|
112
|
-
* disk when the File System Access API is available (no full-file RAM
|
|
113
|
-
* copy); otherwise falls back to an in-memory Blob.
|
|
114
|
-
*/
|
|
115
|
-
downloadFile(alias: string, remotePath: string, onProgress?: (progress: TransferProgress) => void): Promise<{
|
|
116
|
-
blob?: Blob;
|
|
117
|
-
filename: string;
|
|
118
|
-
streamed: boolean;
|
|
119
|
-
bytes: number;
|
|
120
|
-
}>;
|
|
121
|
-
/**
|
|
122
|
-
* Open a new host terminal session for the alias.
|
|
123
|
-
* @param alias - the configured host alias.
|
|
124
|
-
* @param cols - initial PTY width.
|
|
125
|
-
* @param rows - initial PTY height.
|
|
126
|
-
* @returns the live connection; its ready callback carries the session id
|
|
127
|
-
* {@link attachTerminal} uses after a view detach.
|
|
128
|
-
*/
|
|
129
|
-
openTerminal(alias: string, cols: number, rows: number): TerminalConnection;
|
|
130
|
-
/**
|
|
131
|
-
* Reattach to a host-side session that outlived its view (a panel switch, a
|
|
132
|
-
* page navigation). The host replays its scrollback before the ready frame.
|
|
133
|
-
* @param sessionId - the id the previous connection reported on ready.
|
|
134
|
-
* @param cols - the view's current width.
|
|
135
|
-
* @param rows - the view's current height.
|
|
136
|
-
*/
|
|
137
|
-
attachTerminal(sessionId: string, cols: number, rows: number): TerminalConnection;
|
|
138
|
-
/**
|
|
139
|
-
* End a host session this view is not attached to (closing a background
|
|
140
|
-
* tab). The session has no other handle from the browser: giving it a
|
|
141
|
-
* dedicated HTTP route would widen the host's surface for one frame, so this
|
|
142
|
-
* opens one short-lived attach instead and sends the close frame as soon as
|
|
143
|
-
* the socket is open.
|
|
144
|
-
*
|
|
145
|
-
* The answer is "is this session no longer running", which has three
|
|
146
|
-
* truthful answers and one lie to avoid:
|
|
147
|
-
* - the frame went out on an open socket: the host ends the session;
|
|
148
|
-
* - the host answered with an exit frame: an unknown id is reported as
|
|
149
|
-
* `terminal session expired` and an ended shell also exits, and in both
|
|
150
|
-
* cases nothing is running, so the tab really is closed;
|
|
151
|
-
* - the socket errored, closed before opening, or never settled inside
|
|
152
|
-
* `timeoutMs`: delivery is unproven, so the session may still be alive and
|
|
153
|
-
* the caller must keep the tab instead of claiming it closed.
|
|
154
|
-
* @param sessionId - the session id the host reported on its ready frame.
|
|
155
|
-
* @param timeoutMs - bounded wait for the delivery signal (default 5000).
|
|
156
|
-
* @returns true when the session is known to be gone.
|
|
157
|
-
*/
|
|
158
|
-
closeTerminalSession(sessionId: string, timeoutMs?: number): Promise<boolean>;
|
|
159
|
-
/** One terminal socket over either an alias (open) or a session id (attach). */
|
|
160
|
-
private terminalSocket;
|
|
161
|
-
}
|
|
162
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-half entry for the dsh-ssh plugin — runs inside the dsh web GUI.
|
|
3
|
-
*
|
|
4
|
-
* Registers the dsh-ssh locale dictionaries and mounts the two DOM surfaces:
|
|
5
|
-
* the sidebar entry row (toggles the panel) and the SSH operations panel in
|
|
6
|
-
* the center column. Failure policy: DOM mounting problems are logged, never
|
|
7
|
-
* thrown — the web shell fails the whole boot when a plugin apply throws, and
|
|
8
|
-
* an external plugin must not take the GUI down.
|
|
9
|
-
*
|
|
10
|
-
* Export discipline (packages/client rule): the /client surface carries what
|
|
11
|
-
* cordis loading needs plus types only — all value exports stay internal.
|
|
12
|
-
*/
|
|
13
|
-
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
14
|
-
import { type SshKey } from './locales.ts';
|
|
15
|
-
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
16
|
-
interface LocaleNamespaceMap {
|
|
17
|
-
/** dsh-ssh surface copy. */
|
|
18
|
-
'dsh-ssh': SshKey;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/** Required services (fiber inject waiting — the runtime must be up first). */
|
|
22
|
-
export declare const inject: string[];
|
|
23
|
-
/** Type-only surface (export discipline: no value exports beyond the plugin contract). */
|
|
24
|
-
export type { PanelControllerSnapshot } from './panel/controller.ts';
|
|
25
|
-
export type { SshPanelProps } from './panel/SshPanel.tsx';
|
|
26
|
-
export type { HostsTabProps } from './panel/HostsTab.tsx';
|
|
27
|
-
export type { HostFormDialogProps } from './panel/HostFormDialog.tsx';
|
|
28
|
-
export type { TerminalTabProps } from './panel/TerminalTab.tsx';
|
|
29
|
-
export type { TransferTabProps } from './panel/TransferTab.tsx';
|
|
30
|
-
export type { TunnelsTabProps } from './panel/TunnelsTab.tsx';
|
|
31
|
-
export type { ClusterTabProps } from './panel/ClusterTab.tsx';
|
|
32
|
-
export type { SshKey } from './locales.ts';
|
|
33
|
-
/**
|
|
34
|
-
* Mount the SSH panel.
|
|
35
|
-
* @param ctx - client root context (locale service).
|
|
36
|
-
*/
|
|
37
|
-
export declare function apply(ctx: ClientContext): void;
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dsh-ssh surface copy: zh is the key source, en mirrors every key.
|
|
3
|
-
*/
|
|
4
|
-
export declare const zh: {
|
|
5
|
-
readonly 'entry.label': "SSH";
|
|
6
|
-
readonly 'entry.tooltip': "远程 SSH 运维面板";
|
|
7
|
-
readonly 'panel.title': "远程 SSH";
|
|
8
|
-
readonly 'panel.backToConversation': "返回会话";
|
|
9
|
-
readonly 'tab.hosts': "主机";
|
|
10
|
-
readonly 'tab.terminal': "终端";
|
|
11
|
-
readonly 'tab.transfer': "传输";
|
|
12
|
-
readonly 'tab.tunnels': "隧道";
|
|
13
|
-
readonly 'tab.cluster': "集群";
|
|
14
|
-
readonly 'hosts.empty': "尚未配置主机。点击「新增主机」添加,或从 ~/.ssh/config 导入。";
|
|
15
|
-
readonly 'hosts.add': "新增主机";
|
|
16
|
-
readonly 'hosts.import': "导入 ~/.ssh/config";
|
|
17
|
-
readonly 'hosts.search': "搜索别名 / 描述 / 标签…";
|
|
18
|
-
readonly 'hosts.groupBy.label': "分组方式";
|
|
19
|
-
readonly 'hosts.groupBy.none': "不分组";
|
|
20
|
-
readonly 'hosts.groupBy.environment': "按环境分组";
|
|
21
|
-
readonly 'hosts.groupBy.tags': "按标签分组";
|
|
22
|
-
readonly 'hosts.group.ungrouped': "未设置环境";
|
|
23
|
-
readonly 'hosts.group.noTags': "无标签";
|
|
24
|
-
readonly 'hosts.group.count': "{count} 台";
|
|
25
|
-
readonly 'hosts.group.testAll': "测试全部";
|
|
26
|
-
readonly 'hosts.col.alias': "别名";
|
|
27
|
-
readonly 'hosts.col.host': "主机";
|
|
28
|
-
readonly 'hosts.col.user': "用户";
|
|
29
|
-
readonly 'hosts.col.auth': "认证";
|
|
30
|
-
readonly 'hosts.col.environment': "环境";
|
|
31
|
-
readonly 'hosts.col.tags': "标签";
|
|
32
|
-
readonly 'hosts.col.description': "备注";
|
|
33
|
-
readonly 'hosts.col.actions': "操作";
|
|
34
|
-
readonly 'hosts.test': "测试";
|
|
35
|
-
readonly 'hosts.edit': "编辑";
|
|
36
|
-
readonly 'hosts.delete': "删除";
|
|
37
|
-
readonly 'hosts.deleteConfirm': "确定删除主机「{alias}」?将同时停止其隧道。";
|
|
38
|
-
readonly 'hosts.imported': "解析 {parsed} 个配置块,新增 {added} 台主机,跳过 {skipped} 个。";
|
|
39
|
-
readonly 'hosts.proxyBadge': "代理";
|
|
40
|
-
readonly 'hosts.forwardAgentBadge': "Agent 转发";
|
|
41
|
-
readonly 'hosts.forwardAgentHint': "仅对可信主机开启:远端可用本机私钥签名(等价 ssh -A)。";
|
|
42
|
-
readonly 'import.reason.wildcard': "通配符 pattern,需手动配置";
|
|
43
|
-
readonly 'import.reason.existing': "别名已存在";
|
|
44
|
-
readonly 'import.reason.match': "Match 条件块,不支持";
|
|
45
|
-
readonly 'import.reason.invalid': "字段不合法,无法导入";
|
|
46
|
-
readonly 'import.more': "其余 {count} 个未显示";
|
|
47
|
-
readonly 'hosts.testing': "连接测试中…";
|
|
48
|
-
readonly 'hosts.testOk': "连接成功({latency} ms)";
|
|
49
|
-
readonly 'hosts.testFail': "连接失败:{error}";
|
|
50
|
-
readonly 'hosts.connected': "连接";
|
|
51
|
-
readonly 'hosts.notConnected': "未连接";
|
|
52
|
-
readonly 'form.title.create': "新增主机";
|
|
53
|
-
readonly 'form.title.edit': "编辑主机 {alias}";
|
|
54
|
-
readonly 'form.alias': "别名";
|
|
55
|
-
readonly 'form.aliasHint': "小写字母、数字与单连字符,操作时使用";
|
|
56
|
-
readonly 'form.host': "主机地址";
|
|
57
|
-
readonly 'form.port': "端口";
|
|
58
|
-
readonly 'form.user': "用户名";
|
|
59
|
-
readonly 'form.auth': "认证方式";
|
|
60
|
-
readonly 'form.auth.key': "密钥";
|
|
61
|
-
readonly 'form.auth.password': "密码";
|
|
62
|
-
readonly 'form.auth.agent': "SSH Agent";
|
|
63
|
-
readonly 'form.agentPath': "Agent 路径";
|
|
64
|
-
readonly 'form.agentPathHint': "留空自动检测(SSH_AUTH_SOCK;Windows 上为原生 ssh-agent 命名管道);也可填 socket 路径或 pageant";
|
|
65
|
-
readonly 'form.authKeepHint': "编辑时密码 / 私钥留空将保留已存凭据;Agent 路径留空是合法的自动检测,选「SSH Agent」即切换到 agent 认证。";
|
|
66
|
-
readonly 'form.keyPath': "私钥路径";
|
|
67
|
-
readonly 'form.keyPathHint': "如 ~/.ssh/id_ed25519";
|
|
68
|
-
readonly 'form.passphrase': "密钥口令";
|
|
69
|
-
readonly 'form.password': "密码";
|
|
70
|
-
readonly 'form.passwordHint': "明文保存在 $DSH_HOME/dsh-ssh.json(本机私有文件)";
|
|
71
|
-
readonly 'form.passwordRequired': "密码认证需要填写密码。";
|
|
72
|
-
readonly 'form.proxyJump': "跳板机别名";
|
|
73
|
-
readonly 'form.proxyJumpHint': "逗号分隔的本地主机别名,或 [user@]host[:port] 地址,按顺序连接";
|
|
74
|
-
readonly 'form.proxyCommand': "ProxyCommand";
|
|
75
|
-
readonly 'form.proxyCommandHint': "OpenSSH ProxyCommand:%h 主机、%p 端口、%r 用户、%n 别名;留空或填 none 表示不使用。与跳板机别名互斥。";
|
|
76
|
-
readonly 'form.forwardAgent': "启用 Agent 转发";
|
|
77
|
-
readonly 'form.forwardAgentHint': "把本机 SSH Agent 转发到该主机(等价 ssh -A):远端可用本机私钥签名。仅对可信主机开启。";
|
|
78
|
-
readonly 'form.description': "备注";
|
|
79
|
-
readonly 'form.environment': "环境";
|
|
80
|
-
readonly 'form.environmentHint': "如 development / production";
|
|
81
|
-
readonly 'form.tags': "标签";
|
|
82
|
-
readonly 'form.tagsHint': "逗号分隔";
|
|
83
|
-
readonly 'form.location': "位置";
|
|
84
|
-
readonly 'form.save': "保存";
|
|
85
|
-
readonly 'form.cancel': "取消";
|
|
86
|
-
readonly 'form.required': "请填写必填字段:别名、主机地址、用户名。";
|
|
87
|
-
readonly 'form.portInvalid': "端口必须是 1-65535 之间的整数。";
|
|
88
|
-
readonly 'terminal.selectHost': "选择主机";
|
|
89
|
-
readonly 'terminal.connect': "连接";
|
|
90
|
-
readonly 'terminal.disconnect': "断开";
|
|
91
|
-
readonly 'terminal.placeholder': "选择主机后点击「连接」打开远程终端。";
|
|
92
|
-
readonly 'terminal.connecting': "正在连接…";
|
|
93
|
-
readonly 'terminal.ready': "终端已连接({alias})";
|
|
94
|
-
readonly 'terminal.exited': "终端已退出({alias})";
|
|
95
|
-
readonly 'terminal.error': "终端错误:{error}";
|
|
96
|
-
readonly 'terminal.noWebSocket': "当前页面不支持 WebSocket(应用外壳没有可连接的本地主机地址),请改用浏览器打开的 Web 界面使用终端。";
|
|
97
|
-
readonly 'terminal.auth.title': "二次身份验证 (2FA / 交互式认证)";
|
|
98
|
-
readonly 'terminal.auth.submit': "提交验证码";
|
|
99
|
-
readonly 'terminal.auth.cancel': "取消";
|
|
100
|
-
readonly 'terminal.auth.placeholder': "请输入验证码或口令";
|
|
101
|
-
readonly 'terminal.auth.hint': "服务器请求进行交互式二次验证(输入仅本次生效,不落盘):";
|
|
102
|
-
readonly 'terminal.tabs': "终端标签";
|
|
103
|
-
readonly 'terminal.newTab': "按当前主机新开标签";
|
|
104
|
-
readonly 'terminal.closeTab': "关闭标签";
|
|
105
|
-
readonly 'terminal.authPending': "待验证";
|
|
106
|
-
readonly 'terminal.tabExited': "已退出";
|
|
107
|
-
readonly 'terminal.tabError': "出错";
|
|
108
|
-
readonly 'terminal.closeFailed': "无法确认该标签已关闭:关闭帧未送达宿主。标签已保留——可重试,或切到该标签前台,用它自己的连接关闭。";
|
|
109
|
-
readonly 'transfer.selectHost': "选择主机";
|
|
110
|
-
readonly 'transfer.remotePath': "远程路径";
|
|
111
|
-
readonly 'transfer.remotePathHint': "如 /tmp/ 或 /home/user/app.tar.gz";
|
|
112
|
-
readonly 'transfer.upload': "上传";
|
|
113
|
-
readonly 'transfer.uploading': "正在上传 {file}…";
|
|
114
|
-
readonly 'transfer.download': "下载";
|
|
115
|
-
readonly 'transfer.downloading': "正在下载…";
|
|
116
|
-
readonly 'transfer.done': "完成:{bytes} 字节";
|
|
117
|
-
readonly 'transfer.failed': "传输失败:{error}";
|
|
118
|
-
readonly 'transfer.browseRemote': "浏览远程目录";
|
|
119
|
-
readonly 'transfer.refresh': "刷新";
|
|
120
|
-
readonly 'transfer.name': "名称";
|
|
121
|
-
readonly 'transfer.upLevel': "上级目录";
|
|
122
|
-
readonly 'transfer.size': "大小";
|
|
123
|
-
readonly 'transfer.modified': "修改时间";
|
|
124
|
-
readonly 'transfer.bytes': "{value} B";
|
|
125
|
-
readonly 'transfer.kib': "{value} KB";
|
|
126
|
-
readonly 'transfer.mib': "{value} MB";
|
|
127
|
-
readonly 'transfer.gib': "{value} GB";
|
|
128
|
-
readonly 'transfer.percent': "{value}%";
|
|
129
|
-
readonly 'transfer.speed': "{value}/s";
|
|
130
|
-
readonly 'transfer.dir': "目录";
|
|
131
|
-
readonly 'transfer.file': "文件";
|
|
132
|
-
readonly 'tunnel.empty': "没有活跃的隧道。";
|
|
133
|
-
readonly 'tunnel.start': "新建隧道";
|
|
134
|
-
readonly 'tunnel.alias': "主机别名";
|
|
135
|
-
readonly 'tunnel.remotePort': "远程端口";
|
|
136
|
-
readonly 'tunnel.remoteHost': "远程主机";
|
|
137
|
-
readonly 'tunnel.remoteHostHint': "默认 127.0.0.1(服务器自身)";
|
|
138
|
-
readonly 'tunnel.localPort': "本地端口";
|
|
139
|
-
readonly 'tunnel.localPortHint': "留空自动分配";
|
|
140
|
-
readonly 'tunnel.stop': "停止";
|
|
141
|
-
readonly 'tunnel.stopAll': "全部停止";
|
|
142
|
-
readonly 'tunnel.stopAllConfirm': "确定停止全部隧道吗?";
|
|
143
|
-
readonly 'tunnel.row': "{alias}: 127.0.0.1:{localPort} -> {remoteHost}:{remotePort}";
|
|
144
|
-
readonly 'tunnel.started': "隧道已建立:127.0.0.1:{localPort}";
|
|
145
|
-
readonly 'tunnel.failed': "隧道启动失败:{error}";
|
|
146
|
-
readonly 'cluster.command': "命令";
|
|
147
|
-
readonly 'cluster.run': "执行";
|
|
148
|
-
readonly 'cluster.confirm': "确定在匹配的主机上执行该命令吗?该操作会真实运行在远程服务器上。";
|
|
149
|
-
readonly 'cluster.aliases': "主机别名(逗号分隔,与环境、标签至少填一项)";
|
|
150
|
-
readonly 'cluster.environment': "环境过滤";
|
|
151
|
-
readonly 'cluster.tags': "标签过滤(逗号分隔)";
|
|
152
|
-
readonly 'cluster.results': "执行结果";
|
|
153
|
-
readonly 'cluster.empty': "输入命令后点击「执行」。";
|
|
154
|
-
readonly 'cluster.noMatch': "没有匹配的主机。";
|
|
155
|
-
readonly 'cluster.ok': "成功";
|
|
156
|
-
readonly 'cluster.fail': "失败";
|
|
157
|
-
readonly 'cluster.timeout': "超时";
|
|
158
|
-
readonly 'cluster.col.alias': "主机";
|
|
159
|
-
readonly 'cluster.col.status': "状态";
|
|
160
|
-
readonly 'cluster.col.exit': "退出码";
|
|
161
|
-
readonly 'cluster.col.stdout': "标准输出";
|
|
162
|
-
readonly 'cluster.col.stderr': "标准错误";
|
|
163
|
-
readonly 'cluster.col.error': "错误";
|
|
164
|
-
readonly 'cluster.col.duration': "耗时";
|
|
165
|
-
readonly 'common.loading': "加载中…";
|
|
166
|
-
readonly 'common.error': "出错:{error}";
|
|
167
|
-
readonly 'common.refresh': "刷新";
|
|
168
|
-
readonly 'common.confirm': "确定";
|
|
169
|
-
readonly 'error.disabled': "SSH 插件在宿主端未启用。请前往「设置 → Web 插件 → SSH」打开 enabled 开关。";
|
|
170
|
-
};
|
|
171
|
-
export declare const en: Record<keyof typeof zh, string>;
|
|
172
|
-
/** Locale key union. */
|
|
173
|
-
export type SshKey = keyof typeof zh;
|
|
174
|
-
/** Tiny interpolation: {name} -> value. */
|
|
175
|
-
export declare function t(dictionary: Record<string, string>, key: string, values?: Record<string, string | number>): string;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Native panel registration for the SSH panel.
|
|
3
|
-
*
|
|
4
|
-
* The panel is an official-style center-column page, not a DOM takeover: it
|
|
5
|
-
* contributes a row into the sidebar shell's own global panel list
|
|
6
|
-
* (`sidebar.panellist`) and its page into the layout's keyed `main` slot. The
|
|
7
|
-
* shell then owns the row box, the label, the active highlight, the collapsed
|
|
8
|
-
* rail and the panel switch, exactly as it does for the shipped Plugins and
|
|
9
|
-
* Schedule pages and for the task board and the skill center.
|
|
10
|
-
*
|
|
11
|
-
* Both registrations go through `ctx.slots.inject`, which fires only once the
|
|
12
|
-
* owning shell entry has declared the seat: load order between this plugin and
|
|
13
|
-
* ui-layout / ui-sidebar therefore does not matter, and neither does a shell
|
|
14
|
-
* that cannot serve the seats (the callback simply never runs).
|
|
15
|
-
*
|
|
16
|
-
* The terminal's PTY shell lives on the host and outlives this page (see
|
|
17
|
-
* engine/terminal-sessions.ts), so the layout unmounting a deselected page
|
|
18
|
-
* costs the view its xterm instance, not the remote session: the terminal tab
|
|
19
|
-
* reattaches by session id when the page mounts again.
|
|
20
|
-
*
|
|
21
|
-
* @module @fish-under-sea/dsh-ssh-fish/client
|
|
22
|
-
*/
|
|
23
|
-
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
24
|
-
import type { SshApi } from './api.ts';
|
|
25
|
-
import { SSH_PANEL_ID, type PanelController } from './panel/controller.ts';
|
|
26
|
-
import { type TerminalFontSource } from './panel/helpers.ts';
|
|
27
|
-
/** The panel id shared by the sidebar row and the main-slot occupant. */
|
|
28
|
-
export { SSH_PANEL_ID };
|
|
29
|
-
/**
|
|
30
|
-
* The sidebar row glyph the shell asks for at its own size and active state.
|
|
31
|
-
* The shell owns the button, label, tooltip and rail geometry; this component
|
|
32
|
-
* draws only the glyph, like every other panel row.
|
|
33
|
-
*
|
|
34
|
-
* The glyph carries `data-dsh-panel-entry` because it is the only DOM this
|
|
35
|
-
* panel's own code owns inside that shell-owned row: the L2 contract (skins)
|
|
36
|
-
* resolves which row belongs to which plugin through it, since the shell
|
|
37
|
-
* stamps no per-entry hook of its own (see contracts/semantic-attrs-v1.md).
|
|
38
|
-
* @param props - the shell's icon share: square edge and selection state.
|
|
39
|
-
* @returns the decorative terminal glyph.
|
|
40
|
-
*/
|
|
41
|
-
export declare function SshPanelIcon({ size }: {
|
|
42
|
-
size: number;
|
|
43
|
-
active: boolean;
|
|
44
|
-
}): React.ReactElement;
|
|
45
|
-
/**
|
|
46
|
-
* The main-slot page. The layout mounts it only while this panel is selected;
|
|
47
|
-
* the wrapper carries the pinned `data-dsh-ssh-view` semantic anchor (L2
|
|
48
|
-
* contract, skins) the takeover container used to own.
|
|
49
|
-
* @param props - the framework main-slot share plus this entry's injected face.
|
|
50
|
-
* @returns the SSH panel page.
|
|
51
|
-
*/
|
|
52
|
-
export declare function SshPanelPage({ controller, api, terminalFont }: {
|
|
53
|
-
controller: PanelController;
|
|
54
|
-
api: SshApi;
|
|
55
|
-
terminalFont?: TerminalFontSource;
|
|
56
|
-
}): React.ReactElement;
|
|
57
|
-
/**
|
|
58
|
-
* Register the SSH panel's sidebar row and center-column page.
|
|
59
|
-
*
|
|
60
|
-
* Both seats are declared by shell plugins this package does not depend on at
|
|
61
|
-
* runtime, so each registration is wrapped in `ctx.slots.inject`: the callback
|
|
62
|
-
* runs only after the owning entry declares the seat, and a shell that never
|
|
63
|
-
* declares it leaves the panel simply absent instead of failing boot.
|
|
64
|
-
* @param ctx - client root context (services: slots).
|
|
65
|
-
* @param controller - the controller the page and the row drive.
|
|
66
|
-
* @param api - the SSH API client the page operates through.
|
|
67
|
-
* @param terminalFont - live terminal-font setting source (issue #577).
|
|
68
|
-
* @returns disposer releasing both registrations.
|
|
69
|
-
*/
|
|
70
|
-
export declare function registerSshPanel(ctx: ClientContext, controller: PanelController, api: SshApi, terminalFont?: TerminalFontSource): () => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SshApi } from '../api.ts';
|
|
2
|
-
import type { SshHostSummary } from '../../protocol.ts';
|
|
3
|
-
/** Host form dialog props. */
|
|
4
|
-
export interface HostFormDialogProps {
|
|
5
|
-
api: SshApi;
|
|
6
|
-
/** The host being edited; null/undefined means create. */
|
|
7
|
-
editing?: SshHostSummary | null;
|
|
8
|
-
onClose: () => void;
|
|
9
|
-
onSaved: (host: SshHostSummary) => void;
|
|
10
|
-
}
|
|
11
|
-
/** The create/edit host modal. */
|
|
12
|
-
export declare function HostFormDialog({ api, editing, onClose, onSaved }: HostFormDialogProps): import("react").JSX.Element;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { SshApi } from '../api.ts';
|
|
2
|
-
import type { SshHostSummary } from '../../protocol.ts';
|
|
3
|
-
/** Hosts tab props. */
|
|
4
|
-
export interface HostsTabProps {
|
|
5
|
-
api: SshApi;
|
|
6
|
-
/** Connect the given alias in the terminal tab. */
|
|
7
|
-
onConnect: (alias: string) => void;
|
|
8
|
-
}
|
|
9
|
-
/** Host list grouping modes (#379). */
|
|
10
|
-
export type HostGroupBy = 'none' | 'environment' | 'tags';
|
|
11
|
-
/** One collapsible group section of the grouped host list. */
|
|
12
|
-
export interface HostGroup {
|
|
13
|
-
/** Group key: the environment name, one tag, or '' for the ungrouped bucket. */
|
|
14
|
-
key: string;
|
|
15
|
-
hosts: SshHostSummary[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Bucket hosts into collapsible groups (#379). Grouping by tags places a
|
|
19
|
-
* multi-tag host in every one of its tag groups (folder view); hosts without
|
|
20
|
-
* the grouping key land in the '' bucket, which always sorts last. Groups
|
|
21
|
-
* sort alphabetically; host order inside a group follows the API listing.
|
|
22
|
-
*/
|
|
23
|
-
export declare function groupHosts(hosts: SshHostSummary[], groupBy: HostGroupBy): HostGroup[];
|
|
24
|
-
/** The hosts table plus its toolbar and dialogs. */
|
|
25
|
-
export declare function HostsTab({ api, onConnect }: HostsTabProps): import("react").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SshApi } from '../api.ts';
|
|
2
|
-
import type { PanelController } from './controller.ts';
|
|
3
|
-
import { type TerminalFontSource } from './helpers.ts';
|
|
4
|
-
/** Panel shell props. */
|
|
5
|
-
export interface SshPanelProps {
|
|
6
|
-
/** The panel state owner (open/close/toggle, active tab, terminal session). */
|
|
7
|
-
controller: PanelController;
|
|
8
|
-
/** The SSH API client every tab operates through. */
|
|
9
|
-
api: SshApi;
|
|
10
|
-
/** Live terminal-font setting source handed to the terminal tab (issue #577). */
|
|
11
|
-
terminalFont?: TerminalFontSource;
|
|
12
|
-
}
|
|
13
|
-
/** The tabbed SSH panel. */
|
|
14
|
-
export declare function SshPanel({ controller, api, terminalFont }: SshPanelProps): import("react").JSX.Element;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { SshApi } from '../api.ts';
|
|
2
|
-
import type { PanelController } from './controller.ts';
|
|
3
|
-
import { type TerminalFontSource } from './helpers.ts';
|
|
4
|
-
/** Terminal tab props. */
|
|
5
|
-
export interface TerminalTabProps {
|
|
6
|
-
api: SshApi;
|
|
7
|
-
/** The panel controller that owns the tabs and their host session ids. */
|
|
8
|
-
controller: PanelController;
|
|
9
|
-
/** Alias preselected by a "connect" action from the hosts tab. */
|
|
10
|
-
presetAlias?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Live terminal-font setting source (issue #577). Absent in tests and
|
|
13
|
-
* legacy mounts: the font then comes from the CSS custom-property chain.
|
|
14
|
-
*/
|
|
15
|
-
terminalFont?: TerminalFontSource;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Whether the visible challenge form may answer on the bound socket: the form
|
|
19
|
-
* and the socket must belong to the same tab. Both are read at submit time, and
|
|
20
|
-
* the window between a tab switch's commit and the effect that rebinds the
|
|
21
|
-
* socket is exactly when they can disagree.
|
|
22
|
-
* @param linkTabId - the tab the bound socket belongs to.
|
|
23
|
-
* @param formTabId - the tab whose challenge form is on screen.
|
|
24
|
-
*/
|
|
25
|
-
export declare function challengeBelongsToLink(linkTabId: string | undefined, formTabId: string | undefined): boolean;
|
|
26
|
-
/** The terminal view with its tab strip. */
|
|
27
|
-
export declare function TerminalTab({ api, controller, presetAlias, terminalFont }: TerminalTabProps): import("react").JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { SshApi } from '../api.ts';
|
|
2
|
-
import type { TunnelInfo } from '../../protocol.ts';
|
|
3
|
-
/** Live-tunnel polling interval while the tab and page are visible (ms). */
|
|
4
|
-
export declare const TUNNEL_POLL_MS = 5000;
|
|
5
|
-
/**
|
|
6
|
-
* Return `next` only when the tunnel list changed in a user-visible way
|
|
7
|
-
* (identity, ordering or any renderable field), else `null` so a poll tick
|
|
8
|
-
* with no real change keeps the previous reference and React skips the
|
|
9
|
-
* re-render. `prev === null` (first load) always accepts the list.
|
|
10
|
-
*/
|
|
11
|
-
export declare function diffTunnels(prev: TunnelInfo[] | null, next: TunnelInfo[]): TunnelInfo[] | null;
|
|
12
|
-
/** Tunnels tab props. */
|
|
13
|
-
export interface TunnelsTabProps {
|
|
14
|
-
api: SshApi;
|
|
15
|
-
/** Pause automatic reads while the owning panel is closed, preserving form state. */
|
|
16
|
-
active?: boolean;
|
|
17
|
-
}
|
|
18
|
-
/** The tunnels tab. */
|
|
19
|
-
export declare function TunnelsTab({ api, active }: TunnelsTabProps): import("react").JSX.Element;
|