Commit 1e33f09
committed
fix(overview): all-clusters overview + cluster-detail now agree on CPU & guest counts
The all-clusters overview and the cluster-detail summary cards disagreed:
- CPU: overview used core-weighted cluster CPU (Σ cpu×cores / Σ cores, from
datacenter/status); detail used a plain per-node average -> e.g. 6% vs 7.6%.
- Guest counts: overview total = running+stopped from the polled guests summary,
which drops paused/suspended guests and could transiently render an impossible
'16 / 14' (total < running); the detail counted all qemu+lxc -> '16 / 30'.
Fixes:
- backend datacenter/status: add explicit per-type guest totals
(guests.vms.total / guests.containers.total = every guest of that type, any
status incl. templates) so the overview denominator equals the detail's
allVms.length and can never be < running. (proxmox + xcpng paths)
- overview (AllClustersOverview + the cluster-group variant): use the explicit
total when present, fall back to running+stopped for older backends.
- detail summary cards: read the core-weighted CPU from datacenter/status (same
source as the overview), falling back to the per-node average until it loads.
Verified live vs the Testi cluster: overview 16/30 == detail 16/30, and both CPU
values now derive from a single source. Rebuilt web/index.html.1 parent daa50fc commit 1e33f09
4 files changed
Lines changed: 39 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
| |||
241 | 246 | | |
242 | 247 | | |
243 | 248 | | |
244 | | - | |
245 | | - | |
| 249 | + | |
| 250 | + | |
246 | 251 | | |
247 | 252 | | |
248 | 253 | | |
| |||
0 commit comments