feat: #7743, events

This commit is contained in:
Barış Soner Uşaklı
2019-07-23 23:05:42 -04:00
parent 97d7a85060
commit 102d4b0247
2 changed files with 85 additions and 149 deletions

View File

@@ -98,10 +98,19 @@ function listPlugins() {
}
function listEvents(count) {
async.series([
async.waterfall([
db.init,
async.apply(events.output, count),
]);
async.apply(events.getEvents, '', 0, (count || 10) - 1),
function (eventData) {
console.log(('\nDisplaying last ' + count + ' administrative events...').bold);
eventData.forEach(function (event) {
console.log(' * ' + String(event.timestampISO).green + ' ' + String(event.type).yellow + (event.text ? ' ' + event.text : '') + ' (uid: '.reset + (event.uid ? event.uid : 0) + ')');
});
process.exit();
},
], function (err) {
throw err;
});
}
function info() {