fix(forwards): 端口映射添加表单无会话时的静默死按钮 - #127
Merged
gggaiitx merged 1 commit intoSep 29, 2026
Merged
Conversation
- <form disabled> 是无效属性:sessionId 为空时输入框仍可编辑、仅按钮变灰, 用户填完内容点击无任何反馈;改用合法的 <fieldset :disabled> 真正禁用控件。 - submitForward 的 if (!sessionId) return 静默返回改为可见提示 (新增 i18n forwards.error.noSession,七语齐全)。 - 提交增加 submitting 忙碌锁:防重复提交、慢 RPC(远程转发等待服务端) 时按钮显示加载态,不再与「无响应」混淆。 - 提交失败时错误文案在弹窗内显示(原先清空后仅向父级冒泡,失败不可见)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
端口映射弹窗「添加」按钮在无 SSH 会话(
sessionId为 null)时表现为静默死按钮:输入框仍可编辑、按钮变灰,点击后既不报错也不添加。典型触发场景:会话在弹窗打开期间断开(:session-id响应式变为 null)。根因(三点叠加)
<form :disabled="!sessionId">是无效 HTML 属性(disabled非<form>合法属性)→ 控件未被禁用,仅提交按钮变灰,形成「填了内容却点不动」的错觉。submitForward()中if (!props.sessionId) return;静默返回,零反馈。后端
ssh/forward/start路径已核实正常(main.rs:413block_on 注册、ForwardEntry::payload()含id、spawn_local_listener无阻塞),问题纯属前端反馈缺失。修改
frontend/src/components/PortForwardDialog.vue<form disabled>→<fieldset :disabled>(合法禁用语义,内联重置边距避免视觉回归)submitting忙碌锁(防重复提交 + 加载态);失败错误文案在弹窗内显示并同时向父级冒泡frontend/src/lib/i18n.ts:新增forwards.error.noSession,七语齐全(zh-CN/zh-TW/en/es/it/ja/pt-BR)本地校验
python scripts/validate_repo.py→ PASS(io.dbx.ssh 0.7.1-beta.9)pnpm --dir frontend typecheck(vue-tsc)→ PASSpnpm --dir frontend test→ 128 files / 1284 tests 全部通过pnpm --dir frontend build→ PASS元信息
0da8be8(upstream/main HEAD)后续(另行处理)
docs/FEATURE_PARITY.zh-CN.md、docs/REVIEW_FORM_VS_TABBY.zh-CN.md仍写「端口转发 ❌ 不做」,与已实现代码矛盾(文档漂移)。