Skip to content

fix: add disable_metrics option to WebUI system config#8169

Open
lingyun14beta wants to merge 1 commit into
AstrBotDevs:masterfrom
lingyun14beta:fix/disable-metrics-webui
Open

fix: add disable_metrics option to WebUI system config#8169
lingyun14beta wants to merge 1 commit into
AstrBotDevs:masterfrom
lingyun14beta:fix/disable-metrics-webui

Conversation

@lingyun14beta
Copy link
Copy Markdown
Contributor

@lingyun14beta lingyun14beta commented May 13, 2026

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: Added disable_metrics to CONFIG_METADATA_3_SYSTEM's system.items.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

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.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

New Features:

  • Allow configuring the disable_metrics option directly from the WebUI system configuration.

@auto-assign auto-assign Bot requested review from Fridemn and advent259141 May 13, 2026 04:32
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. labels May 13, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +4266 to +4270
"disable_metrics": {
"description": "禁用匿名使用统计",
"type": "bool",
"hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。",
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i18n文件已在PR #7946 中更新。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant