@zhangfengshun/dsh-remote-ssh 1.8.0 → 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 +10 -0
- package/README.md +1 -1
- package/lib/client.js +30 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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
|
+
|
|
11
|
+
## [1.8.1] — 浏览按钮调用原生目录选择框
|
|
12
|
+
### 修复
|
|
13
|
+
- **「浏览」按钮**:本地模式下点击调用 `ctx.workspaces.pickDirectory()` 弹出操作系统原生目录选择框(默认打开用户主目录),选中后自动加载该目录的文件树并填入路径栏。原先该按钮只是按输入框路径刷新树,没有实际选择作用。远程模式无系统对话框,仍按输入路径刷新远端文件树。
|
|
14
|
+
|
|
5
15
|
## [1.8.0] — 重做「添加工作区」弹窗
|
|
6
16
|
### 改进
|
|
7
17
|
- **统一弹窗布局**:原先本地/远程是两个独立弹窗(各自标题),现改为**单个弹窗**:顶部「📁 本地目录 / 🌐 远程目录」分段切换按钮(当前激活的高亮),下方依次为连接选择(远程时)、路径栏(浏览按钮紧挨输入框右侧)、当前路径下的文件树(仅目录、可滚动)。
|
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.
|
|
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
|
@@ -790,6 +790,8 @@ 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;
|
|
793
795
|
|
|
794
796
|
function load(p) {
|
|
795
797
|
setLoading(true); setErr(null);
|
|
@@ -807,11 +809,35 @@ window.__ModuleLoader__.load({
|
|
|
807
809
|
if (up !== null) load(up);
|
|
808
810
|
}
|
|
809
811
|
|
|
810
|
-
//
|
|
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
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// 路径栏:输入框(回车导航)+ 浏览按钮(紧挨在右侧)+ 上级
|
|
811
834
|
return h("div", null,
|
|
812
835
|
h("div", { className: "rssh-pathbar" },
|
|
813
|
-
h("input", { className: "rssh-input", value: path,
|
|
814
|
-
|
|
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") }),
|
|
840
|
+
h("button", { className: "rssh-btn", onClick: browse, disabled: loading }, t("flow.browse")),
|
|
815
841
|
h("button", { className: "rssh-btn", onClick: goUp }, t("common.up"))
|
|
816
842
|
),
|
|
817
843
|
loading ? h("div", { className: "rssh-muted" }, t("common.loading")) : null,
|
|
@@ -880,7 +906,7 @@ window.__ModuleLoader__.load({
|
|
|
880
906
|
isRemote
|
|
881
907
|
? (profileId ? h(DirPicker, { resetKey: profileId, placeholder: t("flow.remoteDir"), listFn: function (p) { return remoteListFn(profileId, p); }, onChoose: chooseRemote, disabled: creating })
|
|
882
908
|
: h("div", { className: "rssh-pick-empty" }, t("common.selectProfile")))
|
|
883
|
-
: h(DirPicker, { resetKey: "local", placeholder: t("flow.localDir"), listFn: function (p) { return localListFn(props.workspaces, p); }, onChoose: chooseLocal })
|
|
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 })
|
|
884
910
|
)
|
|
885
911
|
);
|
|
886
912
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhangfengshun/dsh-remote-ssh",
|
|
3
|
-
"version": "1.8.
|
|
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",
|