tju-yxq opened a new pull request, #3646:
URL: https://github.com/apache/rocketmq-dashboard/pull/3646
## What changed
The alert rule header previously mixed scopes: `Total Rules` was the backend
total for the current filter, while the enabled and 24-hour triggered counters
were derived from only the rows loaded on the current page.
This change makes all three counters describe the same result set:
- add a `GET /{alert-rule-base}/summary` endpoint for both cluster and
business rule routes;
- return total, enabled, and recently-triggered counts in one backend query;
- apply the same search, enabled, and domain filters as the paged rule feed;
- keep the legacy business-domain fallback that includes rules stored before
`domain` existed;
- add a typed frontend API and service wrapper;
- load the summary alongside the rule page and use its values for the header
counters;
- keep a page-local fallback only if the summary request fails;
- update labels from `Enabled on page` and `Triggered in 24h on page` to
result-set-wide labels.
Closes #3556
## Validation
- `mvn -q
'-Dtest=AlertServiceTest,AlertRuleControllerTest,MybatisPlusAlertRepositoryTest'
test` — 117 tests passed
- `mvn -q checkstyle:check` — passed
- `npm test -- AlertsPage.test.tsx alerts.test.ts --run` — 39 tests passed
- `npm run lint -- --quiet` — 0 errors; 10 existing warnings remain
elsewhere in the tree
- `npm run build` — passed
- `git diff --check` — passed
The GitHub Actions status is not being described as green here; the checks
above are local validation on this branch.
--
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]