@zhangfengshun/dsh-remote-ssh 1.8.1 → 1.8.3

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,16 @@
2
2
 
3
3
  本文件的版本号与 `package.json` 的 `version` 保持一致。每个版本对应一个 Cordis Package 快照(`pkg-N`)。
4
4
 
5
+ ## [1.8.3] — 浏览按钮改回「打开」
6
+ ### 变更
7
+ - 「浏览」按钮改回「打开」:按输入框路径加载该路径下的文件树,空路径时打开主目录。本地/远程行为一致,不再调用 `pickDirectory`(该原生对话框在仅有 `browse` capability 的环境下不可用)。回车导航保留。
8
+
9
+ ## [1.8.2] — 修复浏览按钮:本地回退 + 远程打开主目录
10
+ ### 修复
11
+ - **本地浏览**:`pickDirectory()` 在仅有 `browse` capability(无 `native`)的 DSH 环境下会报错 `host.pickDirectory needs the native capability`。现改为:尝试原生选择框,失败时静默回退到加载用户主目录(`listDirectory` 默认列举 home)。用户取消也回到主目录。
12
+ - **远程浏览**:点击「浏览」改为打开**远程用户主目录**(`~`),而非按输入框路径刷新。
13
+ - 路径输入框支持**回车导航**:输入路径后按 Enter 即跳转到该目录。
14
+
5
15
  ## [1.8.1] — 浏览按钮调用原生目录选择框
6
16
  ### 修复
7
17
  - **「浏览」按钮**:本地模式下点击调用 `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.3
34
34
  ```
35
35
 
36
36
  > ⚠️ 安装后需**重启 DSH** 才生效;后续仅修改 Client 半边时刷新浏览器即可。
package/lib/client.js CHANGED
@@ -790,8 +790,6 @@ window.__ModuleLoader__.load({
790
790
 
791
791
  var listFnRef = React.useRef(props.listFn);
792
792
  listFnRef.current = props.listFn;
793
- var pickRef = React.useRef(props.pickNative);
794
- pickRef.current = props.pickNative;
795
793
 
796
794
  function load(p) {
797
795
  setLoading(true); setErr(null);
@@ -809,27 +807,19 @@ window.__ModuleLoader__.load({
809
807
  if (up !== null) load(up);
810
808
  }
811
809
 
812
- // 浏览按钮:本地模式弹原生系统目录选择框(默认打开用户主目录),远程模式按输入路径刷新文件树。
813
- function browse() {
814
- if (pickRef.current) {
815
- setLoading(true); setErr(null);
816
- pickRef.current().then(function (picked) {
817
- setLoading(false);
818
- if (picked) load(picked);
819
- }).catch(function (e) {
820
- setLoading(false);
821
- setErr(String(e && e.message ? e.message : e));
822
- });
823
- } else {
824
- load(path);
825
- }
810
+ // 打开按钮:按输入框路径加载该路径下的文件树。空路径时打开主目录。
811
+ function open() {
812
+ load(path || undefined);
826
813
  }
827
814
 
828
- // 路径栏:输入框 + 浏览按钮(紧挨在右侧)+ 上级
815
+ // 路径栏:输入框(回车导航)+ 打开按钮(紧挨在右侧)+ 上级
829
816
  return h("div", null,
830
817
  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") }),
832
- h("button", { className: "rssh-btn", onClick: browse, disabled: loading }, t("flow.browse")),
818
+ h("input", { className: "rssh-input", value: path,
819
+ onChange: function (e) { setPath(e.target.value); },
820
+ onKeyDown: function (e) { if (e.key === "Enter") { e.preventDefault(); open(); } },
821
+ placeholder: props.placeholder || t("picker.dir") }),
822
+ h("button", { className: "rssh-btn", onClick: open, disabled: loading }, t("common.open")),
833
823
  h("button", { className: "rssh-btn", onClick: goUp }, t("common.up"))
834
824
  ),
835
825
  loading ? h("div", { className: "rssh-muted" }, t("common.loading")) : null,
@@ -898,7 +888,7 @@ window.__ModuleLoader__.load({
898
888
  isRemote
899
889
  ? (profileId ? h(DirPicker, { resetKey: profileId, placeholder: t("flow.remoteDir"), listFn: function (p) { return remoteListFn(profileId, p); }, onChoose: chooseRemote, disabled: creating })
900
890
  : h("div", { className: "rssh-pick-empty" }, t("common.selectProfile")))
901
- : h(DirPicker, { resetKey: "local", placeholder: t("flow.localDir"), listFn: function (p) { return localListFn(props.workspaces, p); }, pickNative: function () { return props.workspaces.pickDirectory(); }, onChoose: chooseLocal })
891
+ : h(DirPicker, { resetKey: "local", placeholder: t("flow.localDir"), listFn: function (p) { return localListFn(props.workspaces, p); }, onChoose: chooseLocal })
902
892
  )
903
893
  );
904
894
  }
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.3",
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",