@zhangfengshun/dsh-remote-ssh 2.0.4 → 2.0.5
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/lib/client.js +11 -3
- package/lib/index.js +2 -7
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -747,11 +747,19 @@ window.__ModuleLoader__.load({
|
|
|
747
747
|
// ======================================================================
|
|
748
748
|
// 本地目录列举:走 DSH browse 能力(无原生对话框时替代 pickDirectory)。
|
|
749
749
|
function localListFn(workspaces, p) {
|
|
750
|
-
|
|
750
|
+
// 走 better-sidebar 的 fs.tree 端点(已被本插件拦截,本地工作区走本地 fs)
|
|
751
|
+
// 不依赖 workspaces.listDirectory(需要 browse capability,可能被禁用)
|
|
752
|
+
return fetch("/sidebar/api/fs.tree", {
|
|
753
|
+
method: "POST",
|
|
754
|
+
headers: { "content-type": "application/json" },
|
|
755
|
+
body: JSON.stringify({ sessionId: "", path: p || "" })
|
|
756
|
+
}).then(function (r) { return r.json(); }).then(function (j) {
|
|
757
|
+
if (!j || !j.ok) return { ok: false, error: (j && j.error && j.error.message) || "list failed" };
|
|
758
|
+
var v = j.value || {};
|
|
751
759
|
return {
|
|
752
760
|
ok: true,
|
|
753
|
-
path:
|
|
754
|
-
entries: (
|
|
761
|
+
path: v.path || p || "",
|
|
762
|
+
entries: (v.entries || []).filter(function (e) { return e.isDir; }).map(function (e) { return { name: e.name, type: "directory", path: e.path }; })
|
|
755
763
|
};
|
|
756
764
|
}).catch(function (e) {
|
|
757
765
|
return { ok: false, error: String(e && e.message ? e.message : e) };
|
package/lib/index.js
CHANGED
|
@@ -820,13 +820,8 @@ function apply(ctx, config) {
|
|
|
820
820
|
try {
|
|
821
821
|
await writeFile(join(mirrorDir, "README.md"), remoteWorkspaceReadme(p.name, a.remotePath), "utf8");
|
|
822
822
|
} catch (e) {}
|
|
823
|
-
//
|
|
824
|
-
//
|
|
825
|
-
try {
|
|
826
|
-
await remoteSyncDown(subprocess, p, a.remotePath, mirrorDir);
|
|
827
|
-
} catch (e) {}
|
|
828
|
-
// 写 .remote-ssh.json:供 shell wrapper 读取连接信息(仅密钥认证,不含密码)。
|
|
829
|
-
// 必须在 remoteSyncDown 之后写,否则会被同步过程清空。
|
|
823
|
+
// 不再需要 syncDown:内置「文件」页签已通过 fs.* 拦截直接 SSH 读写远程文件。
|
|
824
|
+
// 写 .remote-ssh.json:供 shell wrapper 和 fs.* 拦截器读取连接信息(仅密钥认证,不含密码)。
|
|
830
825
|
try {
|
|
831
826
|
const connInfo = {
|
|
832
827
|
profileId: p.id, host: p.host, port: p.port || 22, user: p.user,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhangfengshun/dsh-remote-ssh",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
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",
|