@linxin666/dsh-remote-web-ui 0.2.1 → 0.2.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/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # node scripts/verify-docs.mjs --write <dir>
5
- README.md: 30f19949c347321da330c22bee0f61ba42b70bcf
6
- README.zh.md: 5221d455f62613b62795a1340e64bbdd7ed63937
5
+ README.md: f93e37eae9e0b0293d9f78b590dff7a237b72ad6
6
+ README.zh.md: cfea9d0a66185db3af570255a349d01f82fd5efb
package/README.md CHANGED
@@ -45,7 +45,8 @@ actions, and the update panel that probes and runs the update.
45
45
  `@linxin666/dsh-*` family releases. Without the aggregate package, checks and
46
46
  updates cover every registry-managed direct `@linxin666/*` dependency in the
47
47
  profile; local link/file development dependencies are skipped. When a newer
48
- release exists, the panel runs the update automatically (`pnpm update --latest` inside the
48
+ release exists, the panel shows the version comparison and waits for
49
+ confirmation — clicking "Update now" runs the update (`pnpm update --latest` inside the
49
50
  owning dsh profile; when pnpm is missing it falls back to `corepack pnpm`
50
51
  and then `npx --yes pnpm`, and on Windows the command runs through
51
52
  `cmd.exe` so npm-installed `.cmd` shims resolve; the loopback-only
package/README.zh.md CHANGED
@@ -13,7 +13,7 @@
13
13
  - **手机侧**:扫码将手机与一次性、限时令牌绑定,并落地到 **`/m/` 独立移动端界面**——一款专为小屏设计的轻客户端(见[截图](#截图)),而不是把桌面 UI 塞进手机。该页面可安装为 PWA;每个已安装应用使用自己的已配对设备 cookie,存储隔离的移动端 Web App 需要在该上下文打开新的二维码链接,或粘贴桌面端新复制的链接完成配对。链接携带 `workspace` 参数,手机落地到桌面正在查看的同一工作区。
14
14
  - **安全**:一个有效的一次性令牌(刷新会使旧链接失效;已接受的令牌不可复用;令牌会过期)。停止会撤销每一台已配对设备与当前令牌——已配对设备在下一次请求时被切断。当插件 `requirePairingForLan` 门开启(默认)时,每个非 loopback 的 `/api` 请求必须携带有效的已配对设备 cookie,因此二维码是进入暴露在局域网上的 dsh web 的唯一途径。
15
15
  - **实时状态**:桌面面板经 SSE 流实时镜像配对状态(等待 → 已连接 → 已断开)。
16
- - **远程更新**:侧边栏加载后,底部的下载触发按钮(手机图标左侧)会静默探测 npm registry 上已安装的 `@linxin666/dsh-*` 全家桶版本;发现可自动更新的新版本时,按钮显示圆点并提供“发现新版本,检查更新”提示。点击按钮打开更新面板;未安装聚合包时,检查和更新覆盖 profile 中 registry 管理的全部 `@linxin666/*` 直接依赖,本地 link / file 开发依赖会被跳过。当存在较新版本时,面板自动执行更新(在所属 dsh profile 内 `pnpm update --latest`;pnpm 缺失时依次回退 `corepack pnpm`、`npx --yes pnpm`,Windows 上经 `cmd.exe` 执行以解析 npm 安装的 `.cmd` shim;由仅 loopback 的 `/api/update/status` + `/api/update/run` 端点驱动)并请求重启 dsh web 以生效。pnpm 绿色退出后还会对照 registry 复核已装版本:绿色退出但版本纹丝不动(例如 pnpm 的 `minimumReleaseAge` 门禁静默跳过同日发布的新版本)会报告为「未更新成功」并附配置指引,而不是误报成功。锚点自身是本地 link 安装(开发模式)时,只报告 npm 状态而不更新。
16
+ - **远程更新**:侧边栏加载后,底部的下载触发按钮(手机图标左侧)会静默探测 npm registry 上已安装的 `@linxin666/dsh-*` 全家桶版本;发现可自动更新的新版本时,按钮显示圆点并提供“发现新版本,检查更新”提示。点击按钮打开更新面板;未安装聚合包时,检查和更新覆盖 profile 中 registry 管理的全部 `@linxin666/*` 直接依赖,本地 link / file 开发依赖会被跳过。当存在较新版本时,面板展示版本对比并等待确认——点击「开始更新」后执行更新(在所属 dsh profile 内 `pnpm update --latest`;pnpm 缺失时依次回退 `corepack pnpm`、`npx --yes pnpm`,Windows 上经 `cmd.exe` 执行以解析 npm 安装的 `.cmd` shim;由仅 loopback 的 `/api/update/status` + `/api/update/run` 端点驱动)并请求重启 dsh web 以生效。pnpm 绿色退出后还会对照 registry 复核已装版本:绿色退出但版本纹丝不动(例如 pnpm 的 `minimumReleaseAge` 门禁静默跳过同日发布的新版本)会报告为「未更新成功」并附配置指引,而不是误报成功。锚点自身是本地 link 安装(开发模式)时,只报告 npm 状态而不更新。
17
17
 
18
18
  ## 截图
19
19
 
package/lib/client.js CHANGED
@@ -1312,6 +1312,7 @@ window.__ModuleLoader__.load({
1312
1312
  ...workspace !== null && workspace !== "" ? { workspace } : {}
1313
1313
  };
1314
1314
  }
1315
+ /** Human-readable expiry clock, e.g. "10:35". */
1315
1316
  function formatClock(epochMs) {
1316
1317
  const date = new Date(epochMs);
1317
1318
  return `${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
@@ -1703,7 +1704,7 @@ window.__ModuleLoader__.load({
1703
1704
  * @param props - copy, view state, and actions.
1704
1705
  * @returns the panel element tree.
1705
1706
  */
1706
- function UpdatePanel({ t, view, onClose, onRecheck }) {
1707
+ function UpdatePanel({ t, view, onClose, onRecheck, onStartUpdate }) {
1707
1708
  const status = view.kind === "result" || view.kind === "updating" ? view.status : void 0;
1708
1709
  const title = view.kind === "done" && view.result.ok ? t("update.done") : t("update.title");
1709
1710
  const subtitle = subtitleOf(t, view);
@@ -1740,6 +1741,15 @@ window.__ModuleLoader__.load({
1740
1741
  t,
1741
1742
  status
1742
1743
  }),
1744
+ view.kind === "result" && status !== void 0 && status.mode === "npm" && status.outdated && status.error === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1745
+ className: remote_module_css_default.updateActions,
1746
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1747
+ type: "button",
1748
+ className: remote_module_css_default.updateRetry,
1749
+ onClick: () => onStartUpdate(status),
1750
+ children: t("update.start")
1751
+ })
1752
+ }),
1743
1753
  view.kind === "updating" && status !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
1744
1754
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1745
1755
  className: remote_module_css_default.updateStatus,
@@ -1901,8 +1911,9 @@ window.__ModuleLoader__.load({
1901
1911
  /**
1902
1912
  * The sidebar update seat: the download trigger beside the remote-control
1903
1913
  * trigger plus the update panel modal. Owns the flow — probe the registry
1904
- * on open, auto-run the update when a newer release exists, report the
1905
- * outcome (restart hint on success, translated failure on error).
1914
+ * on open, show the result, and let the user start the update from the
1915
+ * result view (#507), then report the outcome (restart hint on success,
1916
+ * translated failure on error).
1906
1917
  * Component-local state per the client stack rules.
1907
1918
  */
1908
1919
  /**
@@ -1961,6 +1972,8 @@ window.__ModuleLoader__.load({
1961
1972
  kind: "result",
1962
1973
  status
1963
1974
  });
1975
+ }, [t]);
1976
+ const startUpdate = (0, react.useCallback)(async (status) => {
1964
1977
  if (status.mode !== "npm" || !status.outdated) return;
1965
1978
  setView({
1966
1979
  kind: "updating",
@@ -2024,6 +2037,9 @@ window.__ModuleLoader__.load({
2024
2037
  onClose: closePanel,
2025
2038
  onRecheck: () => {
2026
2039
  check();
2040
+ },
2041
+ onStartUpdate: (status) => {
2042
+ startUpdate(status);
2027
2043
  }
2028
2044
  })]
2029
2045
  }), document.body)] });
@@ -3310,10 +3326,11 @@ window.__ModuleLoader__.load({
3310
3326
  "update.upToDate": "当前已是最新版本",
3311
3327
  "update.upToDateDetail": "{name} 已是最新版本 v{version}。",
3312
3328
  "update.found": "发现新版本",
3313
- "update.foundDetail": "{name} 有新版本 v{version},正在自动更新…",
3329
+ "update.foundDetail": "{name} 有新版本 v{version}。确认后开始更新。",
3330
+ "update.start": "开始更新",
3314
3331
  "update.updating": "正在更新 {name} 至 v{version},可能需要 1-2 分钟…",
3315
3332
  "update.cooldownNotice": "本次更新由你主动触发,将跳过 pnpm 的 24 小时发布冷却期(供应链保护)直接安装所选版本。",
3316
- "update.updatingTitle": "正在自动更新…",
3333
+ "update.updatingTitle": "正在更新…",
3317
3334
  "update.done": "更新完成",
3318
3335
  "update.doneDetail": "所有组件已更新到最新版本。",
3319
3336
  "update.restartHint": "请重启 dsh web 使新版本生效:在终端按 Ctrl+C 停止后重新运行 dsh web。",
@@ -3416,10 +3433,11 @@ window.__ModuleLoader__.load({
3416
3433
  "update.upToDate": "Everything is up to date",
3417
3434
  "update.upToDateDetail": "{name} is at the latest version v{version}.",
3418
3435
  "update.found": "A new version is available",
3419
- "update.foundDetail": "{name} has a newer release v{version}; updating automatically…",
3436
+ "update.foundDetail": "{name} has a newer release v{version}. Confirm to start the update.",
3437
+ "update.start": "Update now",
3420
3438
  "update.updating": "Updating {name} to v{version}; this may take 1-2 minutes…",
3421
3439
  "update.cooldownNotice": "This user-initiated update bypasses pnpm's 24-hour release cooldown (supply-chain protection) and installs the selected version immediately.",
3422
- "update.updatingTitle": "Updating automatically…",
3440
+ "update.updatingTitle": "Updating…",
3423
3441
  "update.done": "Update complete",
3424
3442
  "update.doneDetail": "All components are up to date.",
3425
3443
  "update.restartHint": "Restart dsh web for the new version to take effect: stop it with Ctrl+C in the terminal, then run dsh web again.",