fix: add disable_metrics option to WebUI system config#8169
fix: add disable_metrics option to WebUI system config#8169lingyun14beta wants to merge 1 commit 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.
PR #7946 added disable_metrics to misc_config_group in CONFIG_METADATA_2, but misc_config_group has no frontend rendering entry. The WebUI system config page exclusively renders CONFIG_METADATA_3_SYSTEM, so the option never appeared.
Modifications / 改动点
astrbot/core/config/default.py: Addeddisable_metricstoCONFIG_METADATA_3_SYSTEM'ssystem.items.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
New Features: