tju-yxq opened a new issue, #5535:
URL: https://github.com/apache/rocketmq-dashboard/issues/5535
## Problem
Three page-level counters are computed from the **currently loaded page**
while the UI presents them as result-set-wide numbers. On every table with more
than one page, the numbers shown disagree with the server totals the tables
themselves display.
1. **ACL page header** (`instance/acl.tsx`): the subtitle says `共 {rules}
条规则、{users} 个用户` ("…{rules} rules, {users} users") but the values come from
`rules.length` / `users.length` — the arrays of the **current page** of two
server-paginated tables. The very tables below the header show the true server
totals (`total: ruleTotal` / `total: userTotal`), so the header and the table
footers disagree whenever the result set spans pages.
2. **System alerts header** (`ops/systemAlerts.tsx`): the subtitle says `当前
{n} 条未确认` ("{n} unacknowledged") with `n = alerts.filter((a) =>
!a.acknowledged).length` — again only the loaded page. The number silently
changes as the operator pages through alerts, reading as if the global
unacknowledged count were fluctuating.
3. **System alerts level-filter badges** (`ops/systemAlerts.tsx`): the
error/warning/info filter buttons carry a `Badge` counting matching rows **on
the current page**, but clicking a level filter performs a **server-side**
query across all pages — the badge says 3 while the filtered view reports 15.
The page-result API (`/system-alerts/page`) returns only `{items, total}` for
the active filter, so no page-local computation can make these badges truthful.
## Expected behavior
- The ACL header reports the server totals (`ruleTotal` / `userTotal`) that
the tables already use.
- The system-alerts subtitle states its scope, following the idiom the
alert-rules page already established (`alerts.enabledOnPage` = `本页启用` /
`Enabled on page`): `本页 {n} 条未确认` / `{n} unacknowledged on this page`.
- The level-filter badges are removed (a truthful per-level total would need
a new server-side statistics API; the count is derivable by clicking the
filter).
## Notes
- The alert-rules page (`ops/alerts.tsx`) already labels its page-local
statistics with `本页` / `on this page` — that is the established pattern being
applied here.
- A backend per-level/unacknowledged statistics endpoint would allow true
global counters, but that is a separate feature.
--
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]