(bytes)
| 121 | } |
| 122 | |
| 123 | function bytesToSize(bytes) { |
| 124 | if (bytes === 0) return "0B"; |
| 125 | let k = 1024; |
| 126 | sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; |
| 127 | let i = Math.floor(Math.log(bytes) / Math.log(k)); |
| 128 | return (bytes / Math.pow(k, i)).toFixed(2) + " " + sizes[i]; |
| 129 | } |
| 130 | |
| 131 | function formatTime(time) { |
| 132 | let dateObj = new Date(time); |