@hyzyn/dsh-tty 0.19.1 → 0.19.2
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 +6 -6
- package/README.md +5 -5
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -179,12 +179,12 @@ lacks that service the box is switched back off and disabled, with a note that o
|
|
|
179
179
|
empty or 22 (the default)** — matching the connecting side's `spec.port ?? 22` (empty means 22), so
|
|
180
180
|
“empty / `22` / `" 22 "`” all collapse into one key and the same account never ends up with two names or one
|
|
181
181
|
password stored twice; a non-default port does take part (the same host on another port is often a different
|
|
182
|
-
box behind NAT). `field` is `PASSWORD` / `PASSPHRASE`; e.g. `hsadmin@192.
|
|
182
|
+
box behind NAT). `field` is `PASSWORD` / `PASSPHRASE`; e.g. `hsadmin@192.0.2.10:22` →
|
|
183
183
|
`DSH_TTY_HSADMIN_192_168_80_248_PASSWORD`. It is **derived from the resource identity and carries no hash** — the
|
|
184
184
|
same school as git-credential-store's `protocol://username@host` and docker credential helpers'
|
|
185
185
|
`ServerURL` + `Username`: host and username **are ASCII identifiers already**, so nothing needs sanitizing and
|
|
186
186
|
nothing needs a hash to disambiguate. The old hash-based version was patching over "sanitize a human label into a
|
|
187
|
-
key": the reference grammar accepts ASCII only, so `HS 248` / `
|
|
187
|
+
key": the reference grammar accepts ASCII only, so `HS 248` / `lab-a` / `HS_248` collapse to exactly the same
|
|
188
188
|
string and only a hash could stop them silently overwriting each other. A resource identity has no such trap — a
|
|
189
189
|
collision can only happen for **the same host, the same user, the same port**, which is the same password by
|
|
190
190
|
definition (sharing it is correct behaviour). **The connection name never takes part in the key**, so renaming a
|
|
@@ -559,7 +559,7 @@ single command** (the typical use is dsh-docker’s card “Terminal” button
|
|
|
559
559
|
ctx.inject(['ttyTerminal'], (c) => {
|
|
560
560
|
c.ttyTerminal.open({
|
|
561
561
|
command: "docker exec -it 'ems-consumer-test' sh", // required, single line, ≤2000 characters
|
|
562
|
-
book: '
|
|
562
|
+
book: 'lab-a', // one of the two: connection-book entry name → SSH tab
|
|
563
563
|
// spec: { host, port, username, auth, agentForward }, // inline SSH fields
|
|
564
564
|
// (neither = local tab, with cwd giving the working directory)
|
|
565
565
|
label: 'ems-consumer-test · exec',
|
|
@@ -592,7 +592,7 @@ ctx.inject(['ttyTerminal'], (c) => {
|
|
|
592
592
|
if (Number(c.ttyTerminal.version ?? 0) < 2) { /* older version: fall back to open */ }
|
|
593
593
|
const dispose = c.ttyTerminal.mount(hostEl, {
|
|
594
594
|
command: "docker exec -it 'ems-consumer-test' sh", // the same set of options as open
|
|
595
|
-
book: '
|
|
595
|
+
book: 'lab-a', // book > spec > local
|
|
596
596
|
label: 'ems-consumer-test · exec',
|
|
597
597
|
})
|
|
598
598
|
// When collapsing your own drawer:
|
|
@@ -628,8 +628,8 @@ A mount slot is **connection-scoped**: its credentials / target come from the te
|
|
|
628
628
|
So since 0.19.0 every pane records its **owner tab** (`options.ownerSid`, defaulting to the active tab at
|
|
629
629
|
mount time): switching to another tab **hides** the pane (`data-dock-hidden`; its DOM and your rendered tree
|
|
630
630
|
survive, in-flight transfers keep running) and switching back restores the scene; closing the owner tab tears
|
|
631
|
-
the pane down. Without this, the pane stayed put across a tab switch — its title read `SFTP ·
|
|
632
|
-
while the active tab was `192.
|
|
631
|
+
the pane down. Without this, the pane stayed put across a tab switch — its title read `SFTP · lab-b`
|
|
632
|
+
while the active tab was `192.0.2.10`, leaving **another host**’s file listing on screen (worst case:
|
|
633
633
|
uploading to the wrong host). Passing `ownerSid: null` means “owned by no tab” (always visible); that is what
|
|
634
634
|
happens automatically when the panel is open with no tabs at all, and a consumer can use it to declare “this
|
|
635
635
|
pane has nothing to do with tabs, do not hide it on a switch”.
|
package/README.md
CHANGED
|
@@ -166,12 +166,12 @@ SSH 会话同表调度:`tty_list` 里 `kind: 'ssh'` 的条目按 `target`
|
|
|
166
166
|
- **名字**(规则恒定):`DSH_TTY_<用户名>_<主机>[_<端口>]_<字段>`,**端口留空或 22(默认)时省略**
|
|
167
167
|
—— 与连接侧的 `spec.port ?? 22` 一致(留空即 22),所以"留空 / `22` / `" 22 "`"三种写法归成同一个键,
|
|
168
168
|
同一个账号不会有两个名字、同一个密码不会存两份;非默认端口进键(同一主机不同端口常是 NAT 后面的
|
|
169
|
-
不同盒子)。字段 = `PASSWORD` / `PASSPHRASE`;例 `hsadmin@192.
|
|
169
|
+
不同盒子)。字段 = `PASSWORD` / `PASSPHRASE`;例 `hsadmin@192.0.2.10:22` →
|
|
170
170
|
`DSH_TTY_HSADMIN_192_168_80_248_PASSWORD`。**按资源身份派生、不带哈希**——与
|
|
171
171
|
git-credential-store 的 `protocol://username@host`、docker credential helpers 的
|
|
172
172
|
`ServerURL` + `Username` 同一派:host 与 username **本来就是 ASCII 标识符**,不需要清洗、
|
|
173
173
|
也就不需要哈希兜底。曾经的哈希版是在补救"把人类标签清洗成键":引用文法只认 ASCII,
|
|
174
|
-
`HS 248` / `
|
|
174
|
+
`HS 248` / `lab-a` / `HS_248` 折出来完全一样,只能靠哈希避免静默覆盖 ✗。资源身份没有这个
|
|
175
175
|
死结——撞名只可能发生在**同一主机、同一用户、同一端口**,而那本来就该是同一个密码(共享是
|
|
176
176
|
正确行为)。**连接名完全不参与键**,所以改连接名/改备注都不会换键。空主机或空用户名则拒绝
|
|
177
177
|
存入(键的全部来源,缺一就退化成常量)。代价是可读性弱于人类标签:本对话框的「存入」**只按
|
|
@@ -516,7 +516,7 @@ ctx.inject(['ttyConnbar'], (c) => {
|
|
|
516
516
|
ctx.inject(['ttyTerminal'], (c) => {
|
|
517
517
|
c.ttyTerminal.open({
|
|
518
518
|
command: "docker exec -it 'ems-consumer-test' sh", // 必填,单行,≤2000 字符
|
|
519
|
-
book: '
|
|
519
|
+
book: 'lab-a', // 二选一:连接簿条目名 → SSH 标签
|
|
520
520
|
// spec: { host, port, username, auth, agentForward }, // 内联 SSH 字段
|
|
521
521
|
// (都不传 = 本地标签,用 cwd 指定工作目录)
|
|
522
522
|
label: 'ems-consumer-test · exec',
|
|
@@ -546,7 +546,7 @@ ctx.inject(['ttyTerminal'], (c) => {
|
|
|
546
546
|
if (Number(c.ttyTerminal.version ?? 0) < 2) { /* 老版本:退回 open */ }
|
|
547
547
|
const dispose = c.ttyTerminal.mount(hostEl, {
|
|
548
548
|
command: "docker exec -it 'ems-consumer-test' sh", // 与 open 同一套 options
|
|
549
|
-
book: '
|
|
549
|
+
book: 'lab-a', // book > spec > 本地
|
|
550
550
|
label: 'ems-consumer-test · exec',
|
|
551
551
|
})
|
|
552
552
|
// 收起自己的抽屉时:
|
|
@@ -578,7 +578,7 @@ ctx.inject(['ttyTerminal'], (c) => {
|
|
|
578
578
|
pane 记一个「归属标签」(`options.ownerSid`,默认 = 挂载那一刻的活动标签):切到别的
|
|
579
579
|
标签时整块**收起**(`data-dock-hidden`,DOM 与你 render 的树都保活,在途传输继续跑),
|
|
580
580
|
切回来恢复现场;归属标签被关掉时 pane 一并收掉。不这么做的话,切完标签面板还停在原处
|
|
581
|
-
——标题写着 `SFTP ·
|
|
581
|
+
——标题写着 `SFTP · lab-b`、底下活动标签却是 `192.0.2.10`,面板里躺着**另一台
|
|
582
582
|
主机**的文件列表(最坏的情况是往错主机上传)。显式传 `ownerSid: null` 表示「不隶属任何
|
|
583
583
|
标签」(一直可见)——面板开着但一个标签都没有时自动落进这一档;消费方也可以用它声明
|
|
584
584
|
「这块与标签无关,别跟着切」。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyzyn/dsh-tty",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.2",
|
|
4
4
|
"description": "DSH Web GUI 的终端面板插件:侧边栏「终端」大弹窗,xterm.js + PTY 全交互终端(路线1),ssh2 原生 SSH 远程连接(方案 C),tmux 会话持久化(0.10.0),连接栏扩展点 ttyConnbar(0.13.0)、终端服务 ttyTerminal(0.14.0 open / 0.15.0 mount 就地嵌入)、面板内挂载位 ttyPanel(0.16.0 右侧 dock)、服务器状态条(0.17.0:按标签可见性采端主机 CPU / 内存 / 磁盘 / 在线时长 / TCP / 网速 / 温度,SSH 走同连接的非 PTY exec channel、本地走 os/proc,best-effort、不碰 PTY 流)、连接密码存入官方凭据存储(0.18.0:字段里只留 env: 引用、引用名按资源身份派生、候选来自凭据存储 ∪ 连接簿;设置卡片的连接编辑与连接对话框共用同一套表单)、Windows 宿主支持(0.18.1:默认 shell = %COMSPEC%、不做 POSIX 包装层、PowerShell 走 -NoLogo/-Command;shell 集成 / tmux / 状态条三项在 Windows 本地不适用,README 有完整边界)。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|