@zhangfengshun/dsh-remote-ssh 1.8.0 → 1.8.1
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 +4 -0
- package/README.md +1 -1
- package/lib/client.js +20 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
本文件的版本号与 `package.json` 的 `version` 保持一致。每个版本对应一个 Cordis Package 快照(`pkg-N`)。
|
|
4
4
|
|
|
5
|
+
## [1.8.1] — 浏览按钮调用原生目录选择框
|
|
6
|
+
### 修复
|
|
7
|
+
- **「浏览」按钮**:本地模式下点击调用 `ctx.workspaces.pickDirectory()` 弹出操作系统原生目录选择框(默认打开用户主目录),选中后自动加载该目录的文件树并填入路径栏。原先该按钮只是按输入框路径刷新树,没有实际选择作用。远程模式无系统对话框,仍按输入路径刷新远端文件树。
|
|
8
|
+
|
|
5
9
|
## [1.8.0] — 重做「添加工作区」弹窗
|
|
6
10
|
### 改进
|
|
7
11
|
- **统一弹窗布局**:原先本地/远程是两个独立弹窗(各自标题),现改为**单个弹窗**:顶部「📁 本地目录 / 🌐 远程目录」分段切换按钮(当前激活的高亮),下方依次为连接选择(远程时)、路径栏(浏览按钮紧挨输入框右侧)、当前路径下的文件树(仅目录、可滚动)。
|
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.1
|
|
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,27 @@ window.__ModuleLoader__.load({
|
|
|
807
809
|
if (up !== null) load(up);
|
|
808
810
|
}
|
|
809
811
|
|
|
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
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
810
828
|
// 路径栏:输入框 + 浏览按钮(紧挨在右侧)+ 上级
|
|
811
829
|
return h("div", null,
|
|
812
830
|
h("div", { className: "rssh-pathbar" },
|
|
813
831
|
h("input", { className: "rssh-input", value: path, onChange: function (e) { setPath(e.target.value); }, placeholder: props.placeholder || t("picker.dir") }),
|
|
814
|
-
h("button", { className: "rssh-btn", onClick:
|
|
832
|
+
h("button", { className: "rssh-btn", onClick: browse, disabled: loading }, t("flow.browse")),
|
|
815
833
|
h("button", { className: "rssh-btn", onClick: goUp }, t("common.up"))
|
|
816
834
|
),
|
|
817
835
|
loading ? h("div", { className: "rssh-muted" }, t("common.loading")) : null,
|
|
@@ -880,7 +898,7 @@ window.__ModuleLoader__.load({
|
|
|
880
898
|
isRemote
|
|
881
899
|
? (profileId ? h(DirPicker, { resetKey: profileId, placeholder: t("flow.remoteDir"), listFn: function (p) { return remoteListFn(profileId, p); }, onChoose: chooseRemote, disabled: creating })
|
|
882
900
|
: 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 })
|
|
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 })
|
|
884
902
|
)
|
|
885
903
|
);
|
|
886
904
|
}
|
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.1",
|
|
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",
|