Skip to content

feat(remote-access): 远程访问设置页可选机构账号或自己的中继,并可测试连接和重试(#228) - #232

Merged
freedomkk-qfeng merged 4 commits into
ECNU:mainfrom
JunieXD:feat/228-remote-access-settings
Oct 26, 2026
Merged

freedomkk-qfeng merged 4 commits into
ECNU:mainfrom
JunieXD:feat/228-remote-access-settings

Conversation

@JunieXD

@JunieXD JunieXD commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

改动

按 #228 调整远控插件的“远程访问”设置页。本机确认配对、逐台移除设备的机制不变。

  • 连接方式:发行版预置了机构配置(插件设置 organization: { relay, oidcProfileId })时,可在“使用‘机构’账号”和“使用自己的中继服务器”之间切换,默认使用机构账号。没有机构配置时,与现在一样填写中继和接入密钥。
    • 机构账号:显示已登录、尚未登录或登录已过期;未登录时可直接点“登录”,由 dsh-oidc 的 begin 打开机构登录页。身份凭证仍由 dsh-oidc 获取和续期,用户不用复制 Token 或改 YAML。
    • 机构中继只来自发行版配置,设置页不显示也不能修改,所以 ID Token 只会发往这个地址。用户自己填写的中继只能配合接入密钥使用。
    • 选择保存在插件设置 useOrganization 中(默认 true)。
    • 与 issue 的差异:机构模式不提供在多个 OIDC 账号间选择,只使用发行版配置中与中继一起给出的账号。如果允许任选账号、再配合用户填写的中继,ID Token 就可能发往非预期的地址。
  • 测试连接:先访问中继的 healthz,再用所选身份向中继登记一次(只连接一次,10 秒超时,有结果就断开),分别显示“中继服务器能否访问”和“身份验证是否通过”。只有 healthz 成功不算通过。身份未通过时,按接入密钥或机构账号模式给出排错提示;机构拒绝暂不细分具体原因,不假定电脑数量上限。未开启远程访问时也能测试;已开启时直接显示当前连接的状态,不再另外登记,以免把正在使用的连接挤掉。使用机构账号但未登录时,提示先登录。
  • 重试:启动失败、离线、被拒绝或被别处顶替时显示“重试”,不用再关掉、重新打开“允许远程访问”;相应提示里的这句说明已删除。
  • 添加设备:入口始终显示。条件不满足时按钮不可用,并说明原因:未开启、未填写中继和密钥、未登录机构账号、尚未连上中继或启动失败。
  • 新增的 remoteDevices/test、retry、signIn 只供本机设置页使用,远端门禁会拒绝。
  • 中英文 README 同步更新。

验证

  • npm run check(packages/dsh-remote-access):76 个测试通过。新增测试覆盖:
    • 机构账号的登录状态;
    • 查询 OIDC 状态失败时,自己的中继照常工作;
    • 测试连接的各种情况:未配置、无法访问、密钥错误、未开启时通过、首次使用、测试与开启同时进行、开启后被拒绝再重试成功、停用插件时不等待无响应的中继;
    • 单次登记:在线、被拒绝、服务器出错时只连接一次。
  • 官方 DSH 0.2.1-rc.3,配合本机中继(npm 0.1.1),在浏览器中操作设置页:
    • 接入密钥:
      • 未填写时测试,提示未配置;
      • 密钥错误时显示“身份验证未通过”,保存新密钥后旧结果清除;
      • 未开启远程访问时测试通过;
      • 开启后显示已连接,测试显示当前连接的状态;
      • 手机扫码配对、本机确认和移除设备正常。
    • 机构账号(用替身 oidcAccounts 服务模拟登录):
      • 未登录时显示“登录”按钮,测试提示先登录,添加设备说明需要先登录;
      • 登录后中继拒绝时显示原因;
      • 切换到自己的中继后连接成功,再切回机构账号也正常。
    • 页面无报错。
  • EduWork 本机 QA 桌面包(0.4.6,DSH 0.2.1-rc.2,换入本分支插件),连接学校中继,使用真实学校登录:
    • 已登录并开启远程访问时,测试连接两项都通过;关闭远程访问后再测,也能单独登记并通过;
    • 经学校中继配对:设备打开邀请链接、本机确认、进入 DSH 页面、移除设备,均正常;
    • 切换到自己的中继(接入密钥)后测试通过,切回学校账号后恢复连接;
    • 退出学校登录后,显示“尚未登录”和“登录”按钮,测试连接提示先登录,添加设备说明需要先登录;
    • 点“登录”打开系统浏览器,完成学校登录后页面变为已登录,远程访问自动恢复连接,测试通过。
  • 未测:完整打包的 EduWork 桌面成品,以及 Windows。

桌面配置中的 remoteAccess 要经 #231 才能传到插件。

Closes #228

维护者补充

已整合 #230 的热安装事务上下文修复和 #231 的机构配置下发修复,并修正中英文机构鉴权失败提示。远控插件版本更新为 0.1.2,合入后发布 npm。组合后的插件类型检查、构建及 76 项测试通过;宿主配置相关 43 项测试通过(使用 0.4.9 / DSH rc.3 Runtime)。本轮维护者验证不等同于完整桌面成品和真实学校账号端到端验收。

JunieXD and others added 4 commits October 26, 2026 16:37
…undle

Since remote access ships as its own npm bundle, its entry comes from the
bundle's patch, not composition.json, so remoteAccess from the desktop
configuration was dropped without a word. The relay is now a row of its own
in the product patch, which reaches the bundle whether it came with the
product or was installed by the user. Saved preferences are now also rebased
when a product row appears or goes, so a configuration update that adds,
withdraws or replaces the relay reaches a computer whose user has already
saved the plugin's settings, and withdrawn defaults do not linger as personal
ones.
…it, and see what to do next (ECNU#228)

The settings page now lets the user choose between the organization's account
and their own relay with an access key, shows whether they are signed in to
the organization and signs them in, and tests the relay: whether its address
answers and whether it admits this computer, also before remote access is on.
A failed connection can be retried, and Add a device stays visible with what
it still needs. The organization's relay still comes only from the
distribution, so the ID Token goes nowhere else.
@freedomkk-qfeng
freedomkk-qfeng merged commit 66ff930 into ECNU:main Oct 26, 2026
6 checks passed
@JunieXD
JunieXD deleted the feat/228-remote-access-settings branch October 28, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 完善远程访问配置页:中继连接测试、机构身份切换与配对引导

2 participants