zqr10159 opened a new pull request, #3985: URL: https://github.com/apache/hertzbeat/pull/3985
<img width="2800" height="1148" alt="7e379cbc3eb9caf3ffa50720065cbb24" src="https://github.com/user-attachments/assets/6d2ff7c8-4ac6-457e-ac4a-d72db1efdb58" /> <img width="1754" height="984" alt="b9ab63ccdb22175093e6674b939350e9" src="https://github.com/user-attachments/assets/fe7f6cec-e18d-4648-b446-aae1665f9c57" /> <img width="1768" height="986" alt="c624115b4064deb77f6a00c219d31d6e" src="https://github.com/user-attachments/assets/fd7efd60-5829-4cee-aafb-1a9cb3a260a8" /> This pull request adds support for dynamically detecting and displaying the availability of query executors (PromQL, SQL) for periodic alerts in the alert settings UI. It improves the user experience by disabling or enabling periodic alert options and query language choices based on backend executor configuration, and provides contextual descriptions and tooltips for query languages. Several UI improvements and backend API additions support these changes. **Backend: Executor Status API and Service Enhancements** - Added a new method `getAvailableExecutors()` to `DataSourceService` and its implementation, which checks and returns the availability of PromQL and SQL executors. This enables the frontend to determine which query languages are supported for periodic alerts. [[1]](diffhunk://#diff-3c0a9169d37c8cc355bb302e7797f85bb11e27556566680f5a75a410357c7806R43-R48) [[2]](diffhunk://#diff-7b75f536f27912487136975ce60ff23f58fc5ac78231bb564e1bae6cd8891e5cR171-R200) - Added a new API endpoint `/datasource/status` to `AlertDefineController` to expose executor status to the frontend. [[1]](diffhunk://#diff-48379d1e495764b6b3662e1f9d8d5e69ac1abacb869ab411d0284a7eae0072e8R25) [[2]](diffhunk://#diff-48379d1e495764b6b3662e1f9d8d5e69ac1abacb869ab411d0284a7eae0072e8R61-R63) [[3]](diffhunk://#diff-48379d1e495764b6b3662e1f9d8d5e69ac1abacb869ab411d0284a7eae0072e8R119-R126) **Frontend: Alert Setting UI and Logic Improvements** - The alert setting UI now dynamically enables or disables periodic alert options and query language choices (PromQL, SQL) based on the backend executor status. Disabled options show tooltips explaining why they are unavailable. [[1]](diffhunk://#diff-487e889c45988f01d4e5dde5d52027752b86dda5ced1508a66a7d08da60b423fR136-R143) [[2]](diffhunk://#diff-487e889c45988f01d4e5dde5d52027752b86dda5ced1508a66a7d08da60b423fR219) [[3]](diffhunk://#diff-487e889c45988f01d4e5dde5d52027752b86dda5ced1508a66a7d08da60b423fR333-R366) [[4]](diffhunk://#diff-13b4dc8ca6857ce730b312b44c77120b2ccbde1818993672e777ff2264893819L659-R687) [[5]](diffhunk://#diff-13b4dc8ca6857ce730b312b44c77120b2ccbde1818993672e777ff2264893819L720-R767) [[6]](diffhunk://#diff-13b4dc8ca6857ce730b312b44c77120b2ccbde1818993672e777ff2264893819L1112-R1167) - Added contextual descriptions and sample queries for PromQL and SQL, displayed when the user selects a query language. [[1]](diffhunk://#diff-13b4dc8ca6857ce730b312b44c77120b2ccbde1818993672e777ff2264893819L659-R687) [[2]](diffhunk://#diff-13b4dc8ca6857ce730b312b44c77120b2ccbde1818993672e777ff2264893819L720-R767) - Improved UI/UX for disabled periodic alert cards and query language buttons, including visual cues and tooltips. [[1]](diffhunk://#diff-29cfd4ad20f08f47e5aa6ea87459cc2a14e25f9185f192526a8b8b7c7104d734R152-R156) [[2]](diffhunk://#diff-29cfd4ad20f08f47e5aa6ea87459cc2a14e25f9185f192526a8b8b7c7104d734R376-R412) **Internationalization and Usability** - Added new i18n strings (English and Chinese) for query language labels, tooltips, descriptions, and periodic alert availability messages. [[1]](diffhunk://#diff-65a1f0919e53073abb13883f5b1248f1a8b724bb9b0bd263a2e4204fcfa03dbaR365-R378) [[2]](diffhunk://#diff-afdf81392ea221ba973fcaaf4981e70f84134356ffa139eae3b9d6ed492ebd0dR368-R381) - Improved placeholder and icon usage for log expression input fields and variable insertion logic. [[1]](diffhunk://#diff-13b4dc8ca6857ce730b312b44c77120b2ccbde1818993672e777ff2264893819L475-R475) [[2]](diffhunk://#diff-13b4dc8ca6857ce730b312b44c77120b2ccbde1818993672e777ff2264893819L510-R510) [[3]](diffhunk://#diff-487e889c45988f01d4e5dde5d52027752b86dda5ced1508a66a7d08da60b423fL1445-R1490) [[4]](diffhunk://#diff-487e889c45988f01d4e5dde5d52027752b86dda5ced1508a66a7d08da60b423fR1508-R1513) **API Integration** - Added a method to `AlertDefineService` for fetching executor status from the new backend API. -- 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]
