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:
Mahdi Dibaiee
2015-09-04 15:32:03 +04:30
parent 13564f5448
commit 1a2d6209f9
11 changed files with 173 additions and 37 deletions

View File

@ -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;
}
}
}