fix: add disable_metrics option to WebUI system config - #8169
lingyun14beta wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a new disable_metrics configuration field to the system's default settings, allowing users to opt out of anonymous usage statistics. The reviewer noted that this change requires updates to the internationalization (i18n) resource files for both English and Chinese to ensure the new field is correctly displayed in the WebUI.
| "disable_metrics": { | ||
| "description": "禁用匿名使用统计", | ||
| "type": "bool", | ||
| "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。", | ||
| }, |
There was a problem hiding this comment.
The addition of this new configuration field requires corresponding updates to the internationalization resource files, as specified in the instructions at lines 2995-3001. Please ensure that dashboard/src/i18n/locales/en-US/features/config-metadata.json and dashboard/src/i18n/locales/zh-CN/features/config-metadata.json are updated to include the disable_metrics key. This ensures the WebUI displays correctly in all supported languages.
a4c4a7d to
9bd38ca
Compare
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Now that
disable_metricsis exposed viaCONFIG_METADATA_3_SYSTEM, consider removing it from the oldermisc_config_groupto avoid having the same option defined in multiple metadata groups and drifting out of sync. - The new
telemetrygroup is included ingeneralSystemConfigGroups; double-check that this placement and naming aligns with how other system groups are organized in the UI for consistency and discoverability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that `disable_metrics` is exposed via `CONFIG_METADATA_3_SYSTEM`, consider removing it from the older `misc_config_group` to avoid having the same option defined in multiple metadata groups and drifting out of sync.
- The new `telemetry` group is included in `generalSystemConfigGroups`; double-check that this placement and naming aligns with how other system groups are organized in the UI for consistency and discoverability.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ja-JP: add the telemetry group plus the disable_metrics label and hint. wording: name the feature 'User Experience Improvement Program' (用户体验改进计划) consistently in settings.json, config-metadata.json and both CONFIG_METADATA_2 / CONFIG_METADATA_3_SYSTEM descriptions. settings: render systemConfig.groups.*.subtitle. Those keys were authored in AstrBotDevs#8777 but never wired up, because the only block that could display them (.config-section) is hidden by CSS.
|
CI 的 macOS 红叉与本 PR 无关: |
disable_metricshas existed since #7946 (e8d3e183), and the v4.24.4 changelog announced it as a WebUI option for turning metrics collection off. In practice it could not be reached from the Settings page: the option is missing fromCONFIG_METADATA_3_SYSTEM— the schema behindSettings → General(astrbot/dashboard/services/config_service.py:630) — andSettings.vueonly renders config items that are registered in one of itscreateGroup(...)calls. The only documented way to opt out was theASTRBOT_DISABLE_METRICS=1environment variable mentioned inEULA.md§8.This PR adds the missing metadata entry, gives the option its own group under
Settings → General, and names the feature consistently across all four Dashboard locales.Modifications / 改动点
astrbot/core/config/default.py: adddisable_metricstoCONFIG_METADATA_3_SYSTEMso the item can be rendered at all, and align itsdescription/hintwith the wording used by the new group.dashboard/src/views/Settings.vue: register atelemetrygroup (createGroup('telemetry', ['disable_metrics'])) in the General section.zh-CN,en-US,ru-RU,ja-JP): add the grouptitle/subtitleand thedisable_metricslabel/hint.ja-JPstrings are added here because that locale landed upstream after this branch was opened.systemConfig.groups.*.subtitleis now actually rendered. Those keys were authored in feat: reorganize settings system configuration #8777 but never wired up —createGrouponly readtitleand pinnedhint: '', while the only block that renders a group hint (.config-section) is hidden by CSS on the Settings page. As a result all seven groups now show a subtitle, and the heading markup is identical across the four sections; previously only the General section wrapped its title in.system-config-group__heading, so the other three had no gap between the group title and its card.Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Expose and localize the telemetry opt-out setting in the WebUI system configuration.
New Features:
Bug Fixes:
Enhancements: