P-Peaceful opened a new pull request, #3933: URL: https://github.com/apache/hertzbeat/pull/3933
## Description / 描述 This PR fixes two UI issues with alert labels reported in #3901: 1. Auto-added labels from severity selection are now properly displayed in the UI 2. Users can now add custom labels via free text input 本 PR 修复了 #3901 中报告的两个告警标签 UI 问题: 1. 从严重级别选择自动添加的标签现在可以正确显示在 UI 中 2. 用户现在可以通过自由文本输入添加自定义标签 ## Changes / 变更内容 ### Backend / 后端 - **Refactor**: Moved `LabelDao` and `LabelService` from `hertzbeat-manager` to `hertzbeat-base` module to enable cross-module usage - **Feature**: Added `saveNewCustomLabel()` method in `AlertDefineServiceImpl` to automatically persist custom labels when creating/updating alert definitions - **Integration**: Injected `LabelService` and `LabelDao` into `AlertDefineServiceImpl` for label management - **重构**:将 `LabelDao` 和 `LabelService` 从 `hertzbeat-manager` 模块移至 `hertzbeat-base` 模块,以支持跨模块使用 - **功能**:在 `AlertDefineServiceImpl` 中添加 `saveNewCustomLabel()` 方法,在创建/更新告警定义时自动持久化自定义标签 - **集成**:在 `AlertDefineServiceImpl` 中注入 `LabelService` 和 `LabelDao` 以进行标签管理 ### Frontend / 前端 - **Feature**: Enabled custom label input by setting `labelIsCustom: true` in alert-setting component - **UI**: Users can now type custom key-value pairs in addition to selecting from existing labels - **功能**:在告警设置组件中设置 `labelIsCustom: true` 以启用自定义标签输入 - **UI**:用户现在可以输入自定义键值对,而不仅限于从现有标签中选择 ## Related Issue / 相关 Issue Fixes #3901 ## Type of Change / 变更类型 - [x] Bug fix / 问题修复 - [x] Refactoring / 代码重构 ## Testing / 测试 - [x] Updated import statements in affected test files - [x] Verified label display when selecting severity levels - [x] Verified custom label input functionality - [x] 更新了受影响测试文件中的导入语句 - [x] 验证了选择严重级别时的标签显示 - [x] 验证了自定义标签输入功能 ## Reference / 参考 This implementation follows the pattern established in PR #3762 for custom label support. 本实现遵循 PR #3762 中建立的自定义标签支持模式。 ## Checklist / 检查清单 - [x] Code follows project style guidelines / 代码遵循项目风格指南 - [x] Self-review completed / 已完成自我审查 - [x] Comments added for complex logic / 已为复杂逻辑添加注释 - [x] No new warnings generated / 未产生新的警告 - [x] Related tests updated / 已更新相关测试 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
