@zhangfengshun/dsh-remote-ssh 1.2.1 → 1.3.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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  本文件的版本号与 `package.json` 的 `version` 保持一致。每个版本对应一个 Cordis Package 快照(`pkg-N`)。
4
4
 
5
+ ## [1.3.1] — 修复远程文件树滚动
6
+ ### 修复
7
+ - 「远程文件」页签改为 flex 布局:文件树在文件很多时占据剩余高度并内部滚动(`flex:1; overflow-y:auto`),不再因父容器 `overflow:hidden` 而无法往下拉。
8
+
9
+ ## [1.3.0] — 外观跟随主题
10
+ ### 新增
11
+ - 远程连接相关界面(设置小节、远程文件 / 终端页签、添加工作区弹窗)的颜色全部改用 DSH 主题 token(`--dsw-alias-*`),自动跟随 DSH 明暗主题(`body[data-ds-dark-theme]`)切换,不再硬编码深色配色。
12
+
5
13
  ## [1.2.1] — 修复包名不一致
6
14
  ### 修复
7
15
  - Host 半边导出的 `name` 与 Client 半边 `__ModuleLoader__.load({ id })` 统一改为作用域包名 `@zhangfengshun/dsh-remote-ssh`,与 `package.json` / `cordis.patch.yml` 一致,修复在新机器上安装时报「名字与发布名不一致」的错误。
package/lib/client.js CHANGED
@@ -24,27 +24,28 @@ window.__ModuleLoader__.load({
24
24
  }
25
25
 
26
26
  var CSS =
27
- ".rssh-row{margin:6px 0}.rssh-label{color:#9aa0a6;font-size:11px;display:block;margin-bottom:2px}" +
28
- ".rssh-input{width:100%;box-sizing:border-box;background:#121316;color:#eee;border:1px solid #444;border-radius:4px;padding:5px 7px;margin:3px 0;font-size:12px}" +
29
- ".rssh-select{width:100%;box-sizing:border-box;background:#121316;color:#eee;border:1px solid #444;border-radius:4px;padding:5px 7px;margin:3px 0;font-size:12px}" +
30
- ".rssh-btn{background:#3a3d41;color:#eee;border:1px solid #555;border-radius:4px;padding:4px 9px;cursor:pointer;font-size:12px}" +
31
- ".rssh-btn:hover{background:#45494e}.rssh-btn:disabled{opacity:.5;cursor:default}" +
32
- ".rssh-card{padding:8px 10px;border:1px solid #333;border-radius:6px;margin:8px 0;background:#26282c}" +
33
- ".rssh-title{font-weight:600;font-size:13px}.rssh-sub{color:#9aa0a6;font-size:11px}" +
27
+ // 颜色全部使用 DSH 主题 token(--dsw-alias-*),跟随 body[data-ds-dark-theme] 自动切换明暗主题。
28
+ ".rssh-row{margin:6px 0}.rssh-label{color:var(--dsw-alias-label-caption);font-size:11px;display:block;margin-bottom:2px}" +
29
+ ".rssh-input{width:100%;box-sizing:border-box;background:var(--dsw-specific-input-major);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:5px 7px;margin:3px 0;font-size:12px}" +
30
+ ".rssh-select{width:100%;box-sizing:border-box;background:var(--dsw-specific-input-major);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:5px 7px;margin:3px 0;font-size:12px}" +
31
+ ".rssh-btn{background:var(--dsw-alias-button-ghost-active-fill);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:4px 9px;cursor:pointer;font-size:12px}" +
32
+ ".rssh-btn:hover{background:var(--dsw-alias-button-ghost-active-hover)}.rssh-btn:disabled{opacity:.5;cursor:default}" +
33
+ ".rssh-card{padding:8px 10px;border:1px solid var(--dsw-alias-border-l1);border-radius:6px;margin:8px 0;background:var(--dsw-alias-bg-layer-2)}" +
34
+ ".rssh-title{font-weight:600;font-size:13px}.rssh-sub{color:var(--dsw-alias-label-tertiary);font-size:11px}" +
34
35
  ".rssh-actions{margin-top:6px;display:flex;gap:5px;flex-wrap:wrap}" +
35
36
  ".rssh-tree-item{display:flex;align-items:center;gap:5px;padding:3px 5px;cursor:pointer;border-radius:3px}" +
36
- ".rssh-tree-item:hover{background:#2f3237}" +
37
- ".rssh-tree-dir{color:#7ab0ff}.rssh-tree-file{color:#d7d7d7}" +
38
- ".rssh-tree-size{color:#6a7076;font-size:11px;margin-left:auto}" +
37
+ ".rssh-tree-item:hover{background:var(--dsw-alias-interactive-bg-hover)}" +
38
+ ".rssh-tree-dir{color:var(--dsw-alias-state-business-primary)}.rssh-tree-file{color:var(--dsw-alias-label-primary)}" +
39
+ ".rssh-tree-size{color:var(--dsw-alias-label-caption);font-size:11px;margin-left:auto}" +
39
40
  ".rssh-pathbar{display:flex;gap:4px;align-items:center;margin:4px 0}" +
40
41
  ".rssh-pathbar .rssh-input{flex:1;margin:0}" +
41
- ".rssh-content{white-space:pre-wrap;font-family:Consolas,monospace;font-size:12px;background:#121316;padding:8px;border-radius:4px;margin-top:6px;max-height:400px;overflow:auto}" +
42
- ".rssh-terminal{background:#0d0e10;border-radius:4px;padding:6px;margin-top:8px;font-family:Consolas,monospace;font-size:12px}" +
42
+ ".rssh-content{white-space:pre-wrap;font-family:Consolas,monospace;font-size:12px;background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);padding:8px;border-radius:4px;margin-top:6px;max-height:400px;overflow:auto}" +
43
+ ".rssh-terminal{background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);border-radius:4px;padding:6px;margin-top:8px;font-family:Consolas,monospace;font-size:12px}" +
43
44
  ".rssh-terminal-out{white-space:pre-wrap;max-height:320px;overflow:auto;min-height:120px;line-height:1.4}" +
44
45
  ".rssh-terminal-bar{display:flex;gap:5px;align-items:center;margin-bottom:4px}" +
45
46
  ".rssh-terminal-input-row{display:flex;gap:4px;margin-top:5px}.rssh-terminal-input-row .rssh-input{flex:1}" +
46
- ".rssh-ok{color:#4ade80}.rssh-err{color:#f87171}.rssh-muted{color:#9aa0a6;font-size:12px;padding:6px 0}" +
47
- ".rssh-empty{padding:12px;text-align:center;color:#9aa0a6;font-size:12px}" +
47
+ ".rssh-ok{color:var(--dsw-alias-state-success-primary)}.rssh-err{color:var(--dsw-alias-state-error-primary)}.rssh-muted{color:var(--dsw-alias-label-tertiary);font-size:12px;padding:6px 0}" +
48
+ ".rssh-empty{padding:12px;text-align:center;color:var(--dsw-alias-label-tertiary);font-size:12px}" +
48
49
  ".rssh-flow-dialog{width:690px!important;max-width:94vw!important;min-width:460px;resize:horizontal;overflow:auto!important}" +
49
50
  // 设置面板导航:隐藏「远程连接」栏目左侧壳层硬编码的齿轮图标(本栏目 order=200 位于末尾)。
50
51
  ".VOzbGW_navList .VOzbGW_navCell:last-child .VOzbGW_navIcon{display:none}";
@@ -340,36 +341,38 @@ window.__ModuleLoader__.load({
340
341
  });
341
342
  }
342
343
 
343
- return h("div", null,
344
- h("div", { className: "rssh-row" },
345
- h("span", { className: "rssh-label" }, t("files.workspace")),
346
- h("select", { className: "rssh-select", value: wsId || "", onChange: function (e) { setWsId(e.target.value); setProfileId(""); } },
347
- h("option", { value: "" }, t("files.selectWorkspace")),
348
- workspaces.map(function (w) { return h("option", { key: w.id, value: w.id }, w.title); })
349
- )
350
- ),
351
- h("div", { className: "rssh-row" },
352
- h("span", { className: "rssh-label" }, t("files.orProfile")),
353
- h("select", { className: "rssh-select", value: profileId, onChange: function (e) { setProfileId(e.target.value); setWsId(""); } },
354
- h("option", { value: "" }, t("common.selectProfile")),
355
- profiles.map(function (p) { return h("option", { key: p.id, value: p.id }, p.name); })
356
- )
357
- ),
358
- wsId ? h("div", { className: "rssh-row" },
359
- h("span", { className: "rssh-label" }, t("files.defaultDir")),
344
+ return h("div", { style: { display: "flex", flexDirection: "column", flex: 1, minHeight: 0, overflow: "hidden" } },
345
+ h("div", { style: { flex: "none" } },
346
+ h("div", { className: "rssh-row" },
347
+ h("span", { className: "rssh-label" }, t("files.workspace")),
348
+ h("select", { className: "rssh-select", value: wsId || "", onChange: function (e) { setWsId(e.target.value); setProfileId(""); } },
349
+ h("option", { value: "" }, t("files.selectWorkspace")),
350
+ workspaces.map(function (w) { return h("option", { key: w.id, value: w.id }, w.title); })
351
+ )
352
+ ),
353
+ h("div", { className: "rssh-row" },
354
+ h("span", { className: "rssh-label" }, t("files.orProfile")),
355
+ h("select", { className: "rssh-select", value: profileId, onChange: function (e) { setProfileId(e.target.value); setWsId(""); } },
356
+ h("option", { value: "" }, t("common.selectProfile")),
357
+ profiles.map(function (p) { return h("option", { key: p.id, value: p.id }, p.name); })
358
+ )
359
+ ),
360
+ wsId ? h("div", { className: "rssh-row" },
361
+ h("span", { className: "rssh-label" }, t("files.defaultDir")),
362
+ h("div", { className: "rssh-pathbar" },
363
+ h("input", { className: "rssh-input", value: defaultDir, onChange: function (e) { setDefaultDir(e.target.value); }, placeholder: "/home/user/project" }),
364
+ h("button", { className: "rssh-btn", onClick: saveDefaultDir }, t("common.save"))
365
+ )
366
+ ) : null,
360
367
  h("div", { className: "rssh-pathbar" },
361
- h("input", { className: "rssh-input", value: defaultDir, onChange: function (e) { setDefaultDir(e.target.value); }, placeholder: "/home/user/project" }),
362
- h("button", { className: "rssh-btn", onClick: saveDefaultDir }, t("common.save"))
363
- )
364
- ) : null,
365
- h("div", { className: "rssh-pathbar" },
366
- h("input", { className: "rssh-input", value: path, onChange: function (e) { setPath(e.target.value); }, placeholder: "/home/user" }),
367
- h("button", { className: "rssh-btn", onClick: function () { load(profileId, path); } }, t("common.open")),
368
- h("button", { className: "rssh-btn", onClick: goUp }, t("common.up"))
368
+ h("input", { className: "rssh-input", value: path, onChange: function (e) { setPath(e.target.value); }, placeholder: "/home/user" }),
369
+ h("button", { className: "rssh-btn", onClick: function () { load(profileId, path); } }, t("common.open")),
370
+ h("button", { className: "rssh-btn", onClick: goUp }, t("common.up"))
371
+ ),
372
+ loading ? h("div", { className: "rssh-muted" }, t("common.loading")) : null,
373
+ err ? h("div", { className: "rssh-err", style: { whiteSpace: "pre-wrap" } }, err) : null
369
374
  ),
370
- loading ? h("div", { className: "rssh-muted" }, t("common.loading")) : null,
371
- err ? h("div", { className: "rssh-err", style: { whiteSpace: "pre-wrap" } }, err) : null,
372
- h("div", { style: { marginTop: 6 } },
375
+ h("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", marginTop: 6 } },
373
376
  entries.map(function (e) {
374
377
  return h("div", { key: e.name, className: "rssh-tree-item", onClick: function () { openEntry(e); } },
375
378
  h("span", { className: e.type === "directory" ? "rssh-tree-dir" : "rssh-tree-file" }, e.type === "directory" ? "📁 " + e.name : "📄 " + e.name),
@@ -377,7 +380,7 @@ window.__ModuleLoader__.load({
377
380
  );
378
381
  })
379
382
  ),
380
- openFile ? h("div", null,
383
+ openFile ? h("div", { style: { flex: "none" } },
381
384
  h("div", { className: "rssh-pathbar", style: { marginTop: 8 } },
382
385
  h("span", { className: "rssh-title", style: { flex: 1, wordBreak: "break-all" } }, openFile.path),
383
386
  h("button", { className: "rssh-btn", onClick: saveFile }, t("common.save")),
@@ -385,7 +388,7 @@ window.__ModuleLoader__.load({
385
388
  ),
386
389
  openFile.loading ? h("div", { className: "rssh-muted" }, t("files.reading")) :
387
390
  openFile.error ? h("div", { className: "rssh-err" }, openFile.error) :
388
- h("textarea", { className: "rssh-content", style: { width: "100%", boxSizing: "border-box", minHeight: 200, background: "#121316", color: "#eee", border: "1px solid #444" },
391
+ h("textarea", { className: "rssh-content", style: { width: "100%", boxSizing: "border-box", minHeight: 200, background: "var(--dsw-alias-markdown-code-block)", color: "var(--dsw-alias-label-primary)", border: "1px solid var(--dsw-alias-border-l2)" },
389
392
  value: openFile.content, onChange: function (e) { setOpenFile(Object.assign({}, openFile, { content: e.target.value, dirty: true })); } })
390
393
  ) : null
391
394
  );
@@ -425,7 +428,7 @@ window.__ModuleLoader__.load({
425
428
 
426
429
  return h("div", { className: "rssh-terminal" },
427
430
  h("div", { className: "rssh-terminal-bar" },
428
- h("span", { style: { flex: 1, color: status === "running" ? "#4ade80" : "#f87171" } }, t("term.title", { id: props.id }) + (status === "exited" ? t("term.exited") : "")),
431
+ h("span", { style: { flex: 1, color: status === "running" ? "var(--dsw-alias-state-success-primary)" : "var(--dsw-alias-state-error-primary)" } }, t("term.title", { id: props.id }) + (status === "exited" ? t("term.exited") : "")),
429
432
  h("button", { className: "rssh-btn", onClick: function () { props.onClose(props.id); } }, t("common.close"))
430
433
  ),
431
434
  h("div", { className: "rssh-terminal-out", ref: endRef }, data || (status === "running" ? t("term.connecting") : t("term.noOutput"))),
@@ -545,7 +548,7 @@ window.__ModuleLoader__.load({
545
548
  if (up !== null) load(up);
546
549
  }
547
550
 
548
- return h("div", { style: { border: "1px solid #333", borderRadius: 6, padding: 8, marginTop: 6 } },
551
+ return h("div", { style: { border: "1px solid var(--dsw-alias-border-l1)", borderRadius: 6, padding: 8, marginTop: 6 } },
549
552
  h("div", { className: "rssh-pathbar" },
550
553
  h("input", { className: "rssh-input", value: path, onChange: function (e) { setPath(e.target.value); }, placeholder: props.placeholder || t("picker.dir") }),
551
554
  h("button", { className: "rssh-btn", onClick: function () { load(path); } }, t("common.open")),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhangfengshun/dsh-remote-ssh",
3
- "version": "1.2.1",
3
+ "version": "1.3.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",