Multi-File Storage.

Thanks to mfilser !

Related https://github.com/wekan/wekan/pull/4484

Merge branch 'master' into upgrade-meteor
This commit is contained in:
Lauri Ojansivu 2022-04-22 00:55:42 +03:00
commit 68e8155805
29 changed files with 921 additions and 276 deletions

View file

@ -26,7 +26,6 @@ BlazeComponent.extendComponent({
{
'click a.js-report-broken': this.switchMenu,
'click a.js-report-files': this.switchMenu,
'click a.js-report-orphaned-files': this.switchMenu,
'click a.js-report-rules': this.switchMenu,
'click a.js-report-cards': this.switchMenu,
'click a.js-report-boards': this.switchMenu,
@ -66,11 +65,6 @@ BlazeComponent.extendComponent({
this.subscription = Meteor.subscribe('attachmentsList', () => {
this.loading.set(false);
});
} else if ('report-orphaned-files' === targetID) {
this.showOrphanedFilesReport.set(true);
this.subscription = Meteor.subscribe('orphanedAttachments', () => {
this.loading.set(false);
});
} else if ('report-rules' === targetID) {
this.subscription = Meteor.subscribe('rulesReport', () => {
this.showRulesReport.set(true);
@ -104,8 +98,6 @@ class AdminReport extends BlazeComponent {
results() {
// eslint-disable-next-line no-console
// console.log('attachments:', AttachmentStorage.find());
// console.log('attachments.count:', AttachmentStorage.find().count());
return this.collection.find();
}
@ -125,10 +117,6 @@ class AdminReport extends BlazeComponent {
return Math.round(size / 1024);
}
usageCount(key) {
return Attachments.find({ 'copies.attachments.key': key }).count();
}
abbreviate(text) {
if (text.length > 30) {
return `${text.substr(0, 29)}...`;
@ -138,13 +126,9 @@ class AdminReport extends BlazeComponent {
}
(class extends AdminReport {
collection = AttachmentStorage;
collection = Attachments;
}.register('filesReport'));
(class extends AdminReport {
collection = AttachmentStorage;
}.register('orphanedFilesReport'));
(class extends AdminReport {
collection = Rules;