mirror of
https://github.com/Ravinou/borgwarehouse
synced 2026-03-14 22:35:46 +01:00
fix: 🐛 improves storage calculation accuracy
This commit is contained in:
parent
b0fae4f59d
commit
fc3f57e24c
2 changed files with 8 additions and 6 deletions
|
|
@ -71,9 +71,9 @@ export default function StorageUsedChartBar() {
|
|||
datasets: [
|
||||
{
|
||||
label: 'Storage used (%)',
|
||||
//storageUsed is in octet, storageSize is in GB. Round to 1 decimal for %.
|
||||
//storageUsed is in kB, storageSize is in GB. Round to 1 decimal for %.
|
||||
data: data.map((repo) =>
|
||||
(((repo.storageUsed / 1000000) * 100) / repo.storageSize).toFixed(1)
|
||||
(((repo.storageUsed / 1024 ** 2) * 100) / repo.storageSize).toFixed(1)
|
||||
),
|
||||
backgroundColor: '#704dff',
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue