Skip to content

feat(mq): improve Kafka peek defaults and localize admin console#3375

Merged
t8y2 merged 12 commits into
t8y2:mainfrom
xddcode:feat/kafka-peek-defaults-mq-i18n
Jul 16, 2026
Merged

feat(mq): improve Kafka peek defaults and localize admin console#3375
t8y2 merged 12 commits into
t8y2:mainfrom
xddcode:feat/kafka-peek-defaults-mq-i18n

Conversation

@xddcode

@xddcode xddcode commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

变更说明

1. Kafka 消息查询默认更易用(对应 #3357

目的:很多 topic 用户并不清楚 partition / offset,原先必须手填,填错就报错或查空,门槛过高。

处理

  • Agent / Rust:未指定 partition 时按全部分区读取;未指定 offset 时从各分区 earliest 起读,结果排序后按条数上限截断
  • UI:Messages 高级筛选(分区 / Offset)默认收起;Monitoring 默认 SQL 改为 SELECT * FROM "topic" LIMIT 20,可不写 PARTITION / OFFSET
  • 仍支持显式指定分区与 offset,做精确范围查询

2. MQ 管理台多语言

目的:MQ Admin / 连接表单此前大量硬编码中英文,切换语言后界面混杂,且 JSON 示例文案会触发 vue-i18n 编译崩溃({"key":"value"} 被当成插值)。

处理

  • 管理台各面板与 MQ 连接配置改为 i18n key
  • 补齐 en / zh-CN / zh-TW / ja / es / it / pt-BR
  • JSON 占位符按 vue-i18n 规则转义({'{'} / {'}'}
  • 统一术语:界面普通名词本地化,Topic / Broker / Offset / ISR 等行业术语保留

变更类型

  • 新功能
  • Bug 修复
  • 性能优化
  • 代码重构
  • 文档更新
  • CI / 构建

涉及前端

image image image image

验证

  • make check 通过
  • make cargo-check-fast 通过
  • 相关测试通过(KafkaAgentTest、MQ 前端相关单测)

关联 Issue

close #3357

xddcode and others added 3 commits July 14, 2026 10:18
Make Kafka message peek read all partitions from earliest when partition/offset are omitted, and wire MQ admin UI strings through i18n for all supported locales.

Co-authored-by: Cursor <cursoragent@cursor.com>
Localize ordinary Italian UI nouns on the MQ admin surface while keeping Kafka/Pulsar domain loanwords such as Topic, Broker, Offset, and ISR.

Co-authored-by: Cursor <cursoragent@cursor.com>
Localize ordinary Producer/Consumer and related labels, and clean leftover topic/Permits English in Chinese locales.

Co-authored-by: Cursor <cursoragent@cursor.com>
@t8y2

t8y2 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

最好在此PR中提供一下相关页面截图

@xddcode

xddcode commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

最好在此PR中提供一下相关页面截图

描述已经完善,麻烦审查

xddcode and others added 5 commits July 14, 2026 10:37
Send success returns numbers while the peek filter inputs are string refs for empty optional values.

Co-authored-by: Cursor <cursoragent@cursor.com>
变更说明
在设置 → 关于我们中内嵌各版本更新日志,方便用户直接查看历史更新内容,无需跳转官网或 GitHub。

实现方式:复用现有 R2 changelog JSON(releases-cn/en.json),经后端 Tauri command / Web API(/api/changelog)拉取,避免浏览器直连 CDN 的 CORS 问题。列表默认收起,最新版本展示 NEW 角标,支持展开详情、分页加载,以及官网 / GitHub Release 外链兜底。

变更类型
- [x] 新功能
- [ ] Bug 修复
- [ ] 性能优化
- [ ] 代码重构
- [ ] 文档更新
- [ ] CI / 构建

涉及前端
- [x] 本 PR 涉及前端改动,已附截图/录屏(见下方)

验证
- [ ] make check 通过
- [ ] make cargo-check-fast 通过
- [x] 相关功能本地验证通过
补充覆盖:关于我们页加载中/英文 changelog、展开收起、NEW 角标、加载失败外链兜底、后端代理绕过 CORS。

关联 Issue
无

Co-authored-by: Cursor <cursoragent@cursor.com>
feat(settings): embed version changelog in About page
Resolve changelog both-added conflict by keeping createLatestRequestGuard.

Co-authored-by: Cursor <cursoragent@cursor.com>
@onceMisery

Copy link
Copy Markdown
Contributor

LGTM

@onceMisery

Copy link
Copy Markdown
Contributor

话说回来,监控页的样式能否优化一下,我不懂前端,这个是我随便找gpt给写的,能优化下样式吗 🐶

@t8y2 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request changes: Kafka 消息读取存在一个会导致误报空结果的回归,当前分支也存在 merge conflict。

agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:855 虽然设置了 5 秒 deadline,但第一次 poll(500ms) 返回空集合后,KafkaAgent.java:858 就直接退出。broker、网络或多分区首次 fetch 超过 500ms 时,界面会错误显示“暂无消息”。空 poll 应继续重试到 deadline;只有确认所有 partition position 已到 end offset,或 deadline 到期时才能停止。请补“首次 poll 为空、后续 poll 有数据”的测试。

另外,apps/desktop/src/components/mq/SendMessagePanel.vue:178 会把 1.9 这样的 partition/offset 静默截断为整数。建议使用 Number.isSafeInteger() 并明确拒绝小数和超出安全整数范围的输入。

xddcode and others added 3 commits July 16, 2026 08:30
…lts-mq-i18n

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	apps/desktop/src/i18n/locales/es.ts
#	apps/desktop/src/i18n/locales/it.ts
#	apps/desktop/src/i18n/locales/ja.ts
#	apps/desktop/src/i18n/locales/pt-BR.ts
#	apps/desktop/src/i18n/locales/zh-TW.ts
Empty first polls no longer abort early; stop only when partitions reach
end offsets or the 5s deadline expires. Reject non-safe-integer peek
partition/offset inputs instead of truncating decimals.

Co-authored-by: Cursor <cursoragent@cursor.com>
@xddcode

xddcode commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

已按 review 意见处理:

  1. Merge conflict:当前已合并 origin/main 最新分支,并解决了合并冲突。
  2. Kafka peek 空 poll 误报collectPeekedMessages 在空 poll 时继续重试,直到各 partition position 到达 end offset,或 5s deadline 到期;补了「首次 poll 为空、后续 poll 有数据」以及 caught-up 提前结束的单测。
  3. partition/offset 校验:改用 Number.isSafeInteger()parseNonNegativeSafeInteger),明确拒绝小数与超出安全整数范围的输入,不再 Math.floor 静默截断。

@t8y2 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the current head and targeted regression coverage. No blocking issues remain.

@t8y2
t8y2 merged commit 68b1777 into t8y2:main Jul 16, 2026
8 checks passed
@t8y2

t8y2 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution! Merged in 68b1777, will be released in the next version.

@xddcode
xddcode deleted the feat/kafka-peek-defaults-mq-i18n branch July 17, 2026 00:43
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] KAFKA 能不能直接默认查询全部,不要选择分区,offset 啥的,很多topic 根本不清楚这个,查询就报错

3 participants