alexandermarston / vnstat-dashboard

A responsive web UI to view network traffic statistics provided by vnStat (with support for version 2.x)
https://alexandermarston.github.io/vnstat-dashboard/
142 stars 60 forks source link

Bugfix of wrong "prefix" #32

Closed extremeCrazyCoder closed 5 years ago

extremeCrazyCoder commented 5 years ago

The function getLargestPrefix has not been updated at 6c9299dc69912863ff9a94ed3d4b9550b4d21b66 thus the prefixes at the graph are wrong. (change in vnstat.php line 75)

I have also changed the variable names to bytes to show that this are byte values and not kilobytes

When talking about Prefixes they should be named KiB / MiB / GiB / TiB as the output values are Kibibytes / ....

extremeCrazyCoder commented 5 years ago

it looks like the hourly array can contain more than 24 Elements in some cases. Thus the generated JS Array is invalid. Simply removing the if for last element fixes this. Another way would be to use count($....).

extremeCrazyCoder commented 5 years ago

useless now since #34 provides a better fix for the errors