mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
feat: design revamp of ACP events page (#7664)
* feat: design revamp of ACP events page - minor UX changes - new filter controls, filters moved to sidebar - form usable without js - start/end filters NOT programmed yet * feat: events ACP limit by date and perPage * feat: pre-fill applied filters on template render * fix: missing translation for ACP events perPage filter * fix: added some comments to explain setHours behaviour * fix: stop - start + 1 * fix: socket tests * fix: +inf, not just inf * fix: tests, because I am an idiot
This commit is contained in:
@@ -48,6 +48,7 @@ events.types = [
|
||||
'export:uploads',
|
||||
'account-locked',
|
||||
'getUsersCSV',
|
||||
// To add new types from plugins, just Array.push() to this array
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -82,10 +83,17 @@ events.log = function (data, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
events.getEvents = function (filter, start, stop, callback) {
|
||||
events.getEvents = function (filter, start, stop, from, to, callback) {
|
||||
// from/to optional
|
||||
if (typeof from === 'function' && !to && !callback) {
|
||||
callback = from;
|
||||
from = 0;
|
||||
to = Date.now();
|
||||
}
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
db.getSortedSetRevRange('events:time' + (filter ? ':' + filter : ''), start, stop, next);
|
||||
db.getSortedSetRevRangeByScore('events:time' + (filter ? ':' + filter : ''), start, stop - start + 1, to, from, next);
|
||||
},
|
||||
function (eids, next) {
|
||||
db.getObjects(eids.map(eid => 'event:' + eid), next);
|
||||
|
||||
Reference in New Issue
Block a user