mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 07:50:12 +01:00
Removed "Orphaned Files" from Admin-Reports
- not necessary with Meteor-Files
This commit is contained in:
parent
dace63d4dc
commit
e75f423edd
4 changed files with 0 additions and 71 deletions
|
|
@ -11,11 +11,6 @@ template(name="adminReports")
|
||||||
i.fa.fa-chain-broken
|
i.fa.fa-chain-broken
|
||||||
| {{_ 'broken-cards'}}
|
| {{_ 'broken-cards'}}
|
||||||
|
|
||||||
li
|
|
||||||
a.js-report-files(data-id="report-orphaned-files")
|
|
||||||
i.fa.fa-paperclip
|
|
||||||
| {{_ 'orphanedFilesReportTitle'}}
|
|
||||||
|
|
||||||
li
|
li
|
||||||
a.js-report-files(data-id="report-files")
|
a.js-report-files(data-id="report-files")
|
||||||
i.fa.fa-paperclip
|
i.fa.fa-paperclip
|
||||||
|
|
@ -43,8 +38,6 @@ template(name="adminReports")
|
||||||
+brokenCardsReport
|
+brokenCardsReport
|
||||||
else if showFilesReport.get
|
else if showFilesReport.get
|
||||||
+filesReport
|
+filesReport
|
||||||
else if showOrphanedFilesReport.get
|
|
||||||
+orphanedFilesReport
|
|
||||||
else if showRulesReport.get
|
else if showRulesReport.get
|
||||||
+rulesReport
|
+rulesReport
|
||||||
else if showBoardsReport.get
|
else if showBoardsReport.get
|
||||||
|
|
@ -99,27 +92,6 @@ template(name="filesReport")
|
||||||
else
|
else
|
||||||
div {{_ 'no-results' }}
|
div {{_ 'no-results' }}
|
||||||
|
|
||||||
template(name="orphanedFilesReport")
|
|
||||||
h1 {{_ 'orphanedFilesReportTitle'}}
|
|
||||||
if resultsCount
|
|
||||||
table.table
|
|
||||||
tr
|
|
||||||
th Filename
|
|
||||||
th.right Size (kB)
|
|
||||||
th MIME Type
|
|
||||||
th MD5 Sum
|
|
||||||
th ID
|
|
||||||
|
|
||||||
each att in results
|
|
||||||
tr
|
|
||||||
td {{ att.filename }}
|
|
||||||
td.right {{fileSize att.length }}
|
|
||||||
td {{ att.contentType }}
|
|
||||||
td {{ att.md5 }}
|
|
||||||
td {{ att._id.toHexString }}
|
|
||||||
else
|
|
||||||
div {{_ 'no-results' }}
|
|
||||||
|
|
||||||
template(name="cardsReport")
|
template(name="cardsReport")
|
||||||
h1 {{_ 'cardsReportTitle'}}
|
h1 {{_ 'cardsReportTitle'}}
|
||||||
if resultsCount
|
if resultsCount
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ BlazeComponent.extendComponent({
|
||||||
{
|
{
|
||||||
'click a.js-report-broken': this.switchMenu,
|
'click a.js-report-broken': this.switchMenu,
|
||||||
'click a.js-report-files': 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-rules': this.switchMenu,
|
||||||
'click a.js-report-cards': this.switchMenu,
|
'click a.js-report-cards': this.switchMenu,
|
||||||
'click a.js-report-boards': this.switchMenu,
|
'click a.js-report-boards': this.switchMenu,
|
||||||
|
|
@ -65,11 +64,6 @@ BlazeComponent.extendComponent({
|
||||||
this.subscription = Meteor.subscribe('attachmentsList', () => {
|
this.subscription = Meteor.subscribe('attachmentsList', () => {
|
||||||
this.loading.set(false);
|
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) {
|
} else if ('report-rules' === targetID) {
|
||||||
this.subscription = Meteor.subscribe('rulesReport', () => {
|
this.subscription = Meteor.subscribe('rulesReport', () => {
|
||||||
this.showRulesReport.set(true);
|
this.showRulesReport.set(true);
|
||||||
|
|
@ -134,10 +128,6 @@ class AdminReport extends BlazeComponent {
|
||||||
collection = Attachments;
|
collection = Attachments;
|
||||||
}.register('filesReport'));
|
}.register('filesReport'));
|
||||||
|
|
||||||
(class extends AdminReport {
|
|
||||||
collection = AttachmentStorage;
|
|
||||||
}.register('orphanedFilesReport'));
|
|
||||||
|
|
||||||
(class extends AdminReport {
|
(class extends AdminReport {
|
||||||
collection = Rules;
|
collection = Rules;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1086,7 +1086,6 @@
|
||||||
"custom-field-stringtemplate-item-placeholder": "Press enter to add more items",
|
"custom-field-stringtemplate-item-placeholder": "Press enter to add more items",
|
||||||
"creator": "Creator",
|
"creator": "Creator",
|
||||||
"filesReportTitle": "Files Report",
|
"filesReportTitle": "Files Report",
|
||||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
|
||||||
"reports": "Reports",
|
"reports": "Reports",
|
||||||
"rulesReportTitle": "Rules Report",
|
"rulesReportTitle": "Rules Report",
|
||||||
"boardsReportTitle": "Boards Report",
|
"boardsReportTitle": "Boards Report",
|
||||||
|
|
|
||||||
|
|
@ -20,35 +20,3 @@ Meteor.publish('attachmentsList', function() {
|
||||||
).cursor;
|
).cursor;
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
|
|
||||||
Meteor.publish('orphanedAttachments', function() {
|
|
||||||
let keys = [];
|
|
||||||
|
|
||||||
if (Attachments.find({}, { fields: { copies: 1 } }) !== undefined) {
|
|
||||||
Attachments.find({}, { fields: { copies: 1 } }).forEach(att => {
|
|
||||||
keys.push(new ObjectID(att.copies.attachments.key));
|
|
||||||
});
|
|
||||||
keys.sort();
|
|
||||||
keys = _.uniq(keys, true);
|
|
||||||
|
|
||||||
return AttachmentStorage.find(
|
|
||||||
{ _id: { $nin: keys } },
|
|
||||||
{
|
|
||||||
fields: {
|
|
||||||
_id: 1,
|
|
||||||
filename: 1,
|
|
||||||
md5: 1,
|
|
||||||
length: 1,
|
|
||||||
contentType: 1,
|
|
||||||
metadata: 1,
|
|
||||||
},
|
|
||||||
sort: {
|
|
||||||
filename: 1,
|
|
||||||
},
|
|
||||||
limit: 250,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue