fix(dashboard): 编辑连接器换密钥后回显新令牌(只显示一次) - #783
Merged
Merged
Conversation
编辑 webhook 连接器时若修改密钥/令牌,前端编辑分支直接丢弃了后端 返回的新令牌,只弹「已更新」就关闭表单。token 模式下新令牌只会 返回一次,用户无从获取,连接器再也无法触发。 改为:本次改了密钥(用户手填 body.secret 或后端自动轮换返回 r.body.secret)时,复用新建连接器那套一次性面板展示新令牌 + 新 webhookUrl,并保持编辑态标题。新增 rotatedPrefix 文案(中/英)。 未改密钥的普通编辑仍按原逻辑保存并关闭。
Owner
Author
复核记录(head
|
成功态复用的凭证面板此时后端已提交,「取消」不会回滚密钥, 点下只会关掉仅显示一次的新令牌导致永久丢失,与「关闭」行为相同 却带误导语义。created 为真时只渲染「关闭」;该 footer 为新建/编辑 共用路径,一处修改同时覆盖新建成功与编辑换密钥成功两条路。
Owner
Author
|
新 HEAD
当前未发现代码层面的阻塞项。建议后续补一条成功态 footer 的自动化回归用例,固定「成功态不显示取消」这一约束;不影响本次结论。 |
|
🚀 Released in v3.11.0 |
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.
问题
Dashboard 编辑 webhook 连接器时,如果在「密钥」框里填新值想换 token:后端确实会替换密钥、并返回新 token + 新
webhookUrl,但前端编辑成功分支直接丢弃了返回值,只弹一句「已更新」就关掉表单。token 模式下新 token 只在这一刻返回一次,用户无从获取 → 连接器再也无法触发。表现上就像「配置密钥坏了」。
修复
1. 编辑换密钥后回显新令牌
编辑成功且本次改了密钥时,复用新建连接器那套一次性面板展示新令牌 + 新
webhookUrl:const rotatedSecret = r.body.secret ?? body.secretbody.secret:用户在编辑框手填的新密钥(当前 UI 的主路径,后端此路径只回webhookUrl不回secret)r.body.secret:后端自动轮换(rotateSecret:true)时返回editingConnector,弹面板期间标题仍是「编辑」,closeCreateModal关闭时清理connectors.rotatedPrefix文案(中/英),面板标题区分「已更新」vs「已创建」2. 一次性凭证面板隐藏「取消」按钮
成功态复用的凭证面板此时后端已提交,共用 footer 却同时显示「取消」和「关闭」,两者都只执行
closeCreateModal。「取消」并不会回滚密钥,点下后一次性 token 立即消失、列表退回<token>占位符且无法恢复——会换一个入口再次造成永久凭证丢失。created为真时只渲染「关闭」,不再渲染「取消」验证
pnpm build(tsc+dashboard:bundle)✅影响面
仅 Dashboard 前端 connectors 页 + i18n 文案,后端接口与鉴权逻辑未改动。