@zhangfengshun/dsh-remote-ssh 2.0.6 → 2.0.7

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.
Files changed (2) hide show
  1. package/lib/client.js +11 -34
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -2,8 +2,8 @@
2
2
  * @zhangfengshun/dsh-remote-ssh — Client 半边(静态 DSH Web 插件,浏览器 bundle)
3
3
  *
4
4
  * 远程文件与远程终端已合并到内置「文件」和「终端」页签:
5
- * - 远程文件:创建远程工作区时自动同步到本地镜像目录,内置「文件」页签直接显示远程文件。
6
- * 编辑后通过设置页的「同步/推送」按钮回传远程(或使用 remote_ssh_push 工具)。
5
+ * - 远程文件:内置「文件」页签通过 fs.* 拦截直接 SSH 读写远程文件,无需同步。
6
+ * 远程终端由内置「终端」页签提供(shell wrapper 自动 SSH)。
7
7
  * - 远程终端:shell wrapper 自动检测工作区 .remote-ssh.json,在远程工作区中打开 SSH 终端。
8
8
  * 需在 better-sidebar 设置中将 shell 指向 wrapper 脚本(见 README)。
9
9
  * 仍保留隐藏的 remssh:editor 页签用于远程文件编辑器。
@@ -403,7 +403,6 @@ window.__ModuleLoader__.load({
403
403
  var [err, setErr] = React.useState(null);
404
404
  var [loading, setLoading] = React.useState(false);
405
405
  var [defaultDir, setDefaultDir] = useSessionMemory(sessionId, "defaultDir", "");
406
- var [syncSt, setSyncSt] = React.useState(null); // { busy, msg, ok }
407
406
  var [opsDlg, setOpsDlg] = React.useState(null); // { type, p1, p2, result, busy }
408
407
 
409
408
  React.useEffect(function () {
@@ -450,18 +449,6 @@ window.__ModuleLoader__.load({
450
449
  });
451
450
  }
452
451
 
453
- function doSync(direction) {
454
- if (!wsId) return;
455
- var ws = workspaces.find(function (w) { return w.id === wsId; });
456
- if (!ws) return;
457
- setSyncSt({ busy: true, msg: direction === "down" ? t("sync.syncing") : t("sync.pushing"), ok: null });
458
- var method = direction === "down" ? "syncDown" : "syncUp";
459
- api(method, { workspaceId: wsId }).then(function (r) {
460
- if (r && r.ok) setSyncSt({ busy: false, msg: direction === "down" ? t("sync.done") : t("sync.done"), ok: true });
461
- else setSyncSt({ busy: false, msg: (r && r.error) || t("sync.fail"), ok: false });
462
- });
463
- }
464
-
465
452
  function activeProfileId() {
466
453
  if (wsId) {
467
454
  var ws = workspaces.find(function (w) { return w.id === wsId; });
@@ -581,12 +568,13 @@ window.__ModuleLoader__.load({
581
568
  h("button", { className: "rssh-btn", onClick: function () { load(profileId, path); } }, t("common.open")),
582
569
  h("button", { className: "rssh-btn", onClick: goUp }, t("common.up"))
583
570
  ),
584
- wsId ? h("div", { className: "rssh-pathbar" },
585
- h("button", { className: "rssh-btn", onClick: function () { doSync("down"); }, disabled: syncSt && syncSt.busy }, t("sync.down")),
586
- h("button", { className: "rssh-btn", onClick: function () { doSync("up"); }, disabled: syncSt && syncSt.busy }, t("sync.up")),
587
- syncSt ? h("span", { className: syncSt.ok === false ? "rssh-err" : (syncSt.ok ? "rssh-ok" : "rssh-muted"), style: { flex: 1, fontSize: 11 } }, syncSt.msg) : null
588
- ) : null,
589
- (wsId || profileId) ? h("div", { className: "rssh-pathbar", style: { flexWrap: "wrap" } },
571
+ wsId ? h("div", { className: "rssh-pathbar", style: { flexWrap: "wrap" } },
572
+ h("button", { className: "rssh-btn", onClick: function () { openOps("grep"); } }, t("ops.search")),
573
+ h("button", { className: "rssh-btn", onClick: function () { openOps("glob"); } }, t("ops.find")),
574
+ h("button", { className: "rssh-btn", onClick: function () { openOps("mkdir"); } }, t("ops.newDir")),
575
+ h("button", { className: "rssh-btn", onClick: function () { openOps("move"); } }, t("ops.rename")),
576
+ h("button", { className: "rssh-btn", onClick: function () { openOps("delete"); } }, t("ops.delete"))
577
+ ) : (wsId || profileId) ? h("div", { className: "rssh-pathbar", style: { flexWrap: "wrap" } },
590
578
  h("button", { className: "rssh-btn", onClick: function () { openOps("grep"); } }, t("ops.search")),
591
579
  h("button", { className: "rssh-btn", onClick: function () { openOps("glob"); } }, t("ops.find")),
592
580
  h("button", { className: "rssh-btn", onClick: function () { openOps("mkdir"); } }, t("ops.newDir")),
@@ -916,7 +904,6 @@ window.__ModuleLoader__.load({
916
904
  var [result, setResult] = React.useState(null);
917
905
  var [busy, setBusy] = React.useState(false);
918
906
  var [importDlg, setImportDlg] = React.useState(null);
919
- var [wsSync, setWsSync] = React.useState({});
920
907
  var set = function (k, v) { setForm(function (f) { var n = {}; for (var key in f) n[key] = f[key]; n[k] = v; return n; }); };
921
908
 
922
909
  function reload() {
@@ -929,12 +916,6 @@ window.__ModuleLoader__.load({
929
916
  var p = profiles.find(function (x) { return x.id === id; });
930
917
  return p ? p.name : id;
931
918
  }
932
- function doWsSync(wsId, dir) {
933
- setWsSync(function (s) { var n = {}; for (var k in s) n[k] = s[k]; n[wsId] = { busy: true, msg: dir === "down" ? t("sync.syncing") : t("sync.pushing"), ok: null }; return n; });
934
- api(dir === "down" ? "syncDown" : "syncUp", { workspaceId: wsId }).then(function (r) {
935
- setWsSync(function (s) { var n = {}; for (var k in s) n[k] = s[k]; n[wsId] = { busy: false, msg: r && r.ok ? t("sync.done") : ((r && r.error) || t("sync.fail")), ok: !!(r && r.ok) }; return n; });
936
- });
937
- }
938
919
  function delWs(wsId) {
939
920
  api("deleteWorkspace", { id: wsId }).then(function (r) { if (r && r.ok) setWorkspaces(r.workspaces || []); });
940
921
  }
@@ -1019,16 +1000,12 @@ window.__ModuleLoader__.load({
1019
1000
  workspaces.length > 0 ? h("div", { className: "rssh-card" },
1020
1001
  h("div", { className: "rssh-title" }, t("settings.workspaces")),
1021
1002
  workspaces.map(function (ws) {
1022
- var st = wsSync[ws.id];
1023
1003
  return h("div", { key: ws.id, className: "rssh-card", style: { marginBottom: 6 } },
1024
1004
  h("div", { className: "rssh-title" }, ws.title || ws.id),
1025
1005
  h("div", { className: "rssh-sub" }, profileName(ws.profileId) + " → " + (ws.remotePath || "")),
1026
1006
  h("div", { className: "rssh-actions" },
1027
- h("button", { className: "rssh-btn", onClick: function () { doWsSync(ws.id, "down"); }, disabled: st && st.busy }, t("sync.down")),
1028
- h("button", { className: "rssh-btn", onClick: function () { doWsSync(ws.id, "up"); }, disabled: st && st.busy }, t("sync.up")),
1029
1007
  h("button", { className: "rssh-btn", onClick: function () { delWs(ws.id); } }, t("common.delete"))
1030
- ),
1031
- st ? h("span", { className: st.ok === false ? "rssh-err" : (st.ok ? "rssh-ok" : "rssh-muted"), style: { fontSize: 11 } }, st.msg) : null
1008
+ )
1032
1009
  );
1033
1010
  })
1034
1011
  ) : null,
@@ -1103,7 +1080,7 @@ window.__ModuleLoader__.load({
1103
1080
 
1104
1081
  if (betterSidebar) {
1105
1082
  // 远程文件编辑器页签(隐藏页签,仅由代码打开,每个远程文件单开一栏)。
1106
- // remssh:files 和 remssh:term 已移除:远程文件由内置「文件」页签显示(自动同步到镜像目录),
1083
+ // remssh:files 和 remssh:term 已移除:远程文件由内置「文件」页签直接 SSH 读写,
1107
1084
  // 远程终端由内置「终端」页签提供(shell wrapper 自动 SSH)。
1108
1085
  ctx.effect(function () {
1109
1086
  return betterSidebar.registerTab({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhangfengshun/dsh-remote-ssh",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
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",