@zhangfengshun/dsh-remote-ssh 1.8.1 → 1.8.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  本文件的版本号与 `package.json` 的 `version` 保持一致。每个版本对应一个 Cordis Package 快照(`pkg-N`)。
4
4
 
5
+ ## [1.8.2] — 修复浏览按钮:本地回退 + 远程打开主目录
6
+ ### 修复
7
+ - **本地浏览**:`pickDirectory()` 在仅有 `browse` capability(无 `native`)的 DSH 环境下会报错 `host.pickDirectory needs the native capability`。现改为:尝试原生选择框,失败时静默回退到加载用户主目录(`listDirectory` 默认列举 home)。用户取消也回到主目录。
8
+ - **远程浏览**:点击「浏览」改为打开**远程用户主目录**(`~`),而非按输入框路径刷新。
9
+ - 路径输入框支持**回车导航**:输入路径后按 Enter 即跳转到该目录。
10
+
5
11
  ## [1.8.1] — 浏览按钮调用原生目录选择框
6
12
  ### 修复
7
13
  - **「浏览」按钮**:本地模式下点击调用 `ctx.workspaces.pickDirectory()` 弹出操作系统原生目录选择框(默认打开用户主目录),选中后自动加载该目录的文件树并填入路径栏。原先该按钮只是按输入框路径刷新树,没有实际选择作用。远程模式无系统对话框,仍按输入路径刷新远端文件树。
package/README.md CHANGED
@@ -30,7 +30,7 @@ dsh plugin --profile <name> add /absolute/path/to/dsh-remote-ssh
30
30
  ### 发布后安装
31
31
 
32
32
  ```bash
33
- dsh plugin --profile <name> add @zhangfengshun/dsh-remote-ssh@1.8.1
33
+ dsh plugin --profile <name> add @zhangfengshun/dsh-remote-ssh@1.8.2
34
34
  ```
35
35
 
36
36
  > ⚠️ 安装后需**重启 DSH** 才生效;后续仅修改 Client 半边时刷新浏览器即可。
package/lib/client.js CHANGED
@@ -809,26 +809,34 @@ window.__ModuleLoader__.load({
809
809
  if (up !== null) load(up);
810
810
  }
811
811
 
812
- // 浏览按钮:本地模式弹原生系统目录选择框(默认打开用户主目录),远程模式按输入路径刷新文件树。
812
+ // 浏览按钮:
813
+ // 本地模式:尝试弹原生系统目录选择框(pickDirectory),若 native capability 不可用
814
+ // 则回退到加载用户主目录(load(undefined) 列举 home)。
815
+ // 远程模式:打开远程用户主目录(load(undefined) → remoteRoot/~)。
813
816
  function browse() {
814
817
  if (pickRef.current) {
815
818
  setLoading(true); setErr(null);
816
819
  pickRef.current().then(function (picked) {
817
820
  setLoading(false);
818
821
  if (picked) load(picked);
822
+ else load(undefined); // 用户取消 → 回到主目录
819
823
  }).catch(function (e) {
820
824
  setLoading(false);
821
- setErr(String(e && e.message ? e.message : e));
825
+ // native capability 不可用("browse" only)→ 回退到加载主目录
826
+ load(undefined);
822
827
  });
823
828
  } else {
824
- load(path);
829
+ load(undefined); // 远程:打开用户主目录(~)
825
830
  }
826
831
  }
827
832
 
828
- // 路径栏:输入框 + 浏览按钮(紧挨在右侧)+ 上级
833
+ // 路径栏:输入框(回车导航)+ 浏览按钮(紧挨在右侧)+ 上级
829
834
  return h("div", null,
830
835
  h("div", { className: "rssh-pathbar" },
831
- h("input", { className: "rssh-input", value: path, onChange: function (e) { setPath(e.target.value); }, placeholder: props.placeholder || t("picker.dir") }),
836
+ h("input", { className: "rssh-input", value: path,
837
+ onChange: function (e) { setPath(e.target.value); },
838
+ onKeyDown: function (e) { if (e.key === "Enter") { e.preventDefault(); load(path); } },
839
+ placeholder: props.placeholder || t("picker.dir") }),
832
840
  h("button", { className: "rssh-btn", onClick: browse, disabled: loading }, t("flow.browse")),
833
841
  h("button", { className: "rssh-btn", onClick: goUp }, t("common.up"))
834
842
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhangfengshun/dsh-remote-ssh",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "DSH web plugin: VSCode Remote-SSH-like remote development (SSH to supercomputers/servers, remote workspace, file explorer, integrated terminal), integrated with dsh-better-sidebar and DSH settings.",
5
5
  "keywords": [
6
6
  "dsh",