move about page to own vue component

This commit is contained in:
liamcottle 2024-08-02 18:56:35 +12:00
parent 1afc434d86
commit fcb07bcdae
3 changed files with 148 additions and 81 deletions

21
src/frontend/js/Utils.js Normal file
View file

@ -0,0 +1,21 @@
class Utils {
static formatBytes(bytes) {
if(bytes === 0){
return '0 Bytes';
}
const k = 1024;
const decimals = 0;
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)) + ' ' + sizes[i];
}
}
export default Utils;