feat files: Show File Size and Directory's sub items count
fix styles: make thin-small 15px instead of 14px (was too small)
This commit is contained in:
@ -29,3 +29,21 @@ export function reportError(err) {
|
||||
let action = show('errorDialog', {description: err.message});
|
||||
store.dispatch(action);
|
||||
}
|
||||
|
||||
const sizes = {
|
||||
'GB': Math.pow(2, 30),
|
||||
'MB': Math.pow(2, 20),
|
||||
'KB': Math.pow(2, 10),
|
||||
'B': -1
|
||||
}
|
||||
export function humanSize(size) {
|
||||
console.log(size);
|
||||
for (let key in sizes) {
|
||||
let value = sizes[key];
|
||||
|
||||
console.log(value);
|
||||
if (size > value) {
|
||||
return Math.round(size / value) + key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user