zjncs opened a new pull request, #6657:
URL: https://github.com/apache/rocketmq-dashboard/pull/6657
### Which Issue(s) This PR Fixes
Fixes #6656
### Brief Description
After #950 resolved #769 by replacing the fabricated `Math.random()` values
with `null`, the proxy page kept the UI those fields fed — six runtime columns,
two aggregate stat cards, and a healthy count hardcoded to `null`:
- **The dead columns and cards are dropped.** No endpoint fills
version/connections/tps/memory/cpu/uptime (`ProxyHomePageData` carries only the
address list and current address; `ProxyTopologyVO` carries status, ports and
latency), so they rendered a permanent "unavailable" placeholder that reads as
*temporarily missing* rather than *never coming*. This follows #769's own "hide
unsupported runtime columns" option, the same direction as the merged #6145 for
UI the API never fills.
- **The healthy node count is now computed** from the overlaid topology
status, so the 健康节点 card answers "2 / 3" instead of `N/A` forever.
- The node filter no longer matches the always-null version/uptime fields;
`ProxyNode` slims down to the fields that exist.
Non-goals: no new columns from the topology (ports/latency) and no backend
changes — richer columns can follow when a real metrics source lands.
### How Did You Test This Change?
- Red-green: the three new tests below failed on the unmodified tree (the
touched files are byte-identical between my checkout at `5e4c39b0` and
`rocketmq-studio` @ `e2f815fb`) and pass after the fix:
- `shows the healthy node count from the topology overlay` — the card
rendered `N/A` before;
- `drops the runtime columns no endpoint fills`;
- `drops the aggregate stat cards no endpoint fills`.
- `npx vitest run src/pages/studio/__tests__/Proxy.test.tsx` — **20/20
pass** (16 pre-existing + 3 new + 1 evolved: the old "marks runtime metrics
unavailable" test now asserts no `N/A` remains once the topology has answered).
- Regression: `npx vitest run
src/pages/studio/__tests__/BrokerCluster.test.tsx` — **16/16 pass** (that page
reads proxy version/connections from the cluster API and is unaffected).
- `npx eslint src/pages/studio/Proxy.tsx
src/pages/studio/__tests__/Proxy.test.tsx src/api/proxy.ts` — clean. `npx tsc
--noEmit` — clean.
AI assistance was used; the failures were reproduced before changing
production code.
--
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]