fix(files): Show correct quota size (file size base 2)

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2023-10-05 16:19:26 +02:00
parent 8a162eeeb1
commit 951ab7a999
5 changed files with 8 additions and 8 deletions

View file

@ -261,7 +261,7 @@ export default Vue.extend({
if (typeof size !== 'number' || size < 0) {
return this.t('files', 'Pending')
}
return formatFileSize(size, true)
return formatFileSize(size, true, true).replace('iB', 'B')
},
sizeOpacity() {
const size = parseInt(this.source.size, 10) || 0

View file

@ -127,11 +127,11 @@ export default Vue.extend({
totalSize() {
// If we have the size already, let's use it
if (this.currentFolder?.size) {
return formatFileSize(this.currentFolder.size, true)
return formatFileSize(this.currentFolder.size, true, true).replace('iB', 'B')
}
// Otherwise let's compute it
return formatFileSize(this.nodes.reduce((total, node) => total + node.size || 0, 0), true)
return formatFileSize(this.nodes.reduce((total, node) => total + node.size || 0, 0), true, true).replace('iB', 'B')
},
},

View file

@ -51,8 +51,8 @@ export default {
computed: {
storageStatsTitle() {
const usedQuotaByte = formatFileSize(this.storageStats?.used)
const quotaByte = formatFileSize(this.storageStats?.quota)
const usedQuotaByte = formatFileSize(this.storageStats?.used, false, true).replace('iB', 'B')
const quotaByte = formatFileSize(this.storageStats?.quota, false, true).replace('iB', 'B')
// If no quota set
if (this.storageStats?.quota < 0) {

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long