@zhangfengshun/dsh-remote-ssh 1.8.2 → 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,10 @@
2
2
 
3
3
  本文件的版本号与 `package.json` 的 `version` 保持一致。每个版本对应一个 Cordis Package 快照(`pkg-N`)。
4
4
 
5
+ ## [1.8.3] — 浏览按钮改回「打开」
6
+ ### 变更
7
+ - 「浏览」按钮改回「打开」:按输入框路径加载该路径下的文件树,空路径时打开主目录。本地/远程行为一致,不再调用 `pickDirectory`(该原生对话框在仅有 `browse` capability 的环境下不可用)。回车导航保留。
8
+
5
9
  ## [1.8.2] — 修复浏览按钮:本地回退 + 远程打开主目录
6
10
  ### 修复
7
11
  - **本地浏览**:`pickDirectory()` 在仅有 `browse` capability(无 `native`)的 DSH 环境下会报错 `host.pickDirectory needs the native capability`。现改为:尝试原生选择框,失败时静默回退到加载用户主目录(`listDirectory` 默认列举 home)。用户取消也回到主目录。
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.2
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,35 +807,19 @@ window.__ModuleLoader__.load({
809
807
  if (up !== null) load(up);
810
808
  }
811
809
 
812
- // 浏览按钮:
813
- // 本地模式:尝试弹原生系统目录选择框(pickDirectory),若 native capability 不可用
814
- // 则回退到加载用户主目录(load(undefined) 列举 home)。
815
- // 远程模式:打开远程用户主目录(load(undefined) → remoteRoot/~)。
816
- function browse() {
817
- if (pickRef.current) {
818
- setLoading(true); setErr(null);
819
- pickRef.current().then(function (picked) {
820
- setLoading(false);
821
- if (picked) load(picked);
822
- else load(undefined); // 用户取消 → 回到主目录
823
- }).catch(function (e) {
824
- setLoading(false);
825
- // native capability 不可用("browse" only)→ 回退到加载主目录
826
- load(undefined);
827
- });
828
- } else {
829
- load(undefined); // 远程:打开用户主目录(~)
830
- }
810
+ // 打开按钮:按输入框路径加载该路径下的文件树。空路径时打开主目录。
811
+ function open() {
812
+ load(path || undefined);
831
813
  }
832
814
 
833
- // 路径栏:输入框(回车导航)+ 浏览按钮(紧挨在右侧)+ 上级
815
+ // 路径栏:输入框(回车导航)+ 打开按钮(紧挨在右侧)+ 上级
834
816
  return h("div", null,
835
817
  h("div", { className: "rssh-pathbar" },
836
818
  h("input", { className: "rssh-input", value: path,
837
819
  onChange: function (e) { setPath(e.target.value); },
838
- onKeyDown: function (e) { if (e.key === "Enter") { e.preventDefault(); load(path); } },
820
+ onKeyDown: function (e) { if (e.key === "Enter") { e.preventDefault(); open(); } },
839
821
  placeholder: props.placeholder || t("picker.dir") }),
840
- h("button", { className: "rssh-btn", onClick: browse, disabled: loading }, t("flow.browse")),
822
+ h("button", { className: "rssh-btn", onClick: open, disabled: loading }, t("common.open")),
841
823
  h("button", { className: "rssh-btn", onClick: goUp }, t("common.up"))
842
824
  ),
843
825
  loading ? h("div", { className: "rssh-muted" }, t("common.loading")) : null,
@@ -906,7 +888,7 @@ window.__ModuleLoader__.load({
906
888
  isRemote
907
889
  ? (profileId ? h(DirPicker, { resetKey: profileId, placeholder: t("flow.remoteDir"), listFn: function (p) { return remoteListFn(profileId, p); }, onChoose: chooseRemote, disabled: creating })
908
890
  : h("div", { className: "rssh-pick-empty" }, t("common.selectProfile")))
909
- : 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 })
910
892
  )
911
893
  );
912
894
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhangfengshun/dsh-remote-ssh",
3
- "version": "1.8.2",
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",