Add support for showing usage graphs on the console page
This commit is contained in:
parent
c66d2cd123
commit
29834a33f8
7 changed files with 292 additions and 52 deletions
|
@ -4,7 +4,8 @@ export function bytesToHuman (bytes: number): string {
|
|||
}
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(1000));
|
||||
|
||||
// @ts-ignore
|
||||
return `${(bytes / Math.pow(1000, i)).toFixed(2) * 1} ${['Bytes', 'kB', 'MB', 'GB', 'TB'][i]}`;
|
||||
}
|
||||
|
||||
export const bytesToMegabytes = (bytes: number) => Math.floor(bytes / 1000 / 1000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue