RSNewWebUI/webui-src/app/statistics
jolavillette 4bb1a893cf webui v152: the statistics page polls, and collects, more than it needs
The Refresh button was guarded by a `loading` flag set once at oninit and never
raised again, so it only ever disabled itself before the first answer. After
that every click fired two more requests, on top of the five second interval,
with nothing preventing two runs from overlapping -- and on a phone they do
overlap, since each answer closes its connection and the core serves them one at
a time. `load()` now refuses to start while one is running and always clears the
flag, including on the paths that throw.

Friend names came from a second collection of the friend list -- getFriendList
plus one getPeerDetails per friend, all at once -- run exactly once, at oninit:
a friend added afterwards stayed `Peer 1a2b3c4d…` until the page was reloaded.
network_data already does that work and keeps it in NetworkData.gpgDetails for
the whole session, so the page reads that and asks for a refresh at most once a
minute rather than never.

`formatBytes` was a second implementation of `rs.formatBytes`, printing MiB
where the statusbar, the chat and the file lists print MB for the same number.

The pie segments are rotated back to twelve o'clock, where a pie chart is read
from; the totals in the middle stay upright.
2026-08-23 12:51:13 +02:00
..
statistics.js webui v152: the statistics page polls, and collects, more than it needs 2026-08-23 12:51:13 +02:00