|
@@ -205,14 +205,22 @@
|
|
|
getSize (value) {
|
|
|
if (this.commonJS.isEmpty(value)) {
|
|
|
return '0 B'
|
|
|
+ } else {
|
|
|
+ let val = parseInt(value)
|
|
|
+ if (this.commonJS.isEmpty(val)) {
|
|
|
+ return '0 B'
|
|
|
+ }
|
|
|
+ if (isNaN(val)) {
|
|
|
+ return '0 B'
|
|
|
+ }
|
|
|
+ if (val === 0) {
|
|
|
+ return '0 B'
|
|
|
+ }
|
|
|
+ let k = 1024
|
|
|
+ let sizes = ['B', 'KB', 'MB', 'GB', 'PB', 'TB', 'EB', 'ZB', 'YB']
|
|
|
+ let i = Math.floor(Math.log(val) / Math.log(k))
|
|
|
+ return (val / Math.pow(k, i)).toPrecision(3) + '' + sizes[i]
|
|
|
}
|
|
|
- if (value === 0) {
|
|
|
- return '0 B'
|
|
|
- }
|
|
|
- let k = 1024
|
|
|
- let sizes = ['B', 'KB', 'MB', 'GB', 'PB', 'TB', 'EB', 'ZB', 'YB']
|
|
|
- let i = Math.floor(Math.log(value) / Math.log(k))
|
|
|
- return (value / Math.pow(k, i)).toPrecision(3) + '' + sizes[i]
|
|
|
},
|
|
|
async changes (file, fileList) {
|
|
|
// if (file.status !== 'ready') {
|