Attachment size, changed calculation to npm filesize (Admin Reports)

This commit is contained in:
Martin Filser 2022-04-29 11:56:16 +02:00
parent 110a83a736
commit 3aba91885f
2 changed files with 4 additions and 2 deletions

View file

@ -88,7 +88,7 @@ template(name="filesReport")
each att in results
tr
td {{ att.name }}
td.right {{fileSize att.size }}
td.right {{ fileSize att.size }}
td {{ att.type }}
td {{ att._id }}
td {{ att.meta.boardId }}

View file

@ -4,6 +4,7 @@ import { CardSearchPagedComponent } from '/client/lib/cardSearch';
import SessionData from '/models/usersessiondata';
import { QueryParams } from '/config/query-classes';
import { OPERATOR_LIMIT } from '/config/search-const';
const filesize = require('filesize');
BlazeComponent.extendComponent({
subscription: null,
@ -114,7 +115,8 @@ class AdminReport extends BlazeComponent {
}
fileSize(size) {
return Math.round(size / 1024);
const ret = filesize(size);
return ret;
}
abbreviate(text) {