(value)
| 1447 | } |
| 1448 | |
| 1449 | function formatBytes(value) { |
| 1450 | if (value === null || value === undefined) { |
| 1451 | return "n/a"; |
| 1452 | } |
| 1453 | const units = ["B", "KB", "MB", "GB", "TB"]; |
| 1454 | let current = value; |
| 1455 | let index = 0; |
| 1456 | while (current >= 1024 && index < units.length - 1) { |
| 1457 | current /= 1024; |
| 1458 | index += 1; |
| 1459 | } |
| 1460 | return `${current.toFixed(1)} ${units[index]}`; |
| 1461 | } |
| 1462 | |
| 1463 | function formatThresholdStatus(value) { |
| 1464 | return value ? "Pass" : "Fail"; |