diff --git a/app/controllers/dataController.js b/app/controllers/dataController.js index a906346..c09c3b7 100644 --- a/app/controllers/dataController.js +++ b/app/controllers/dataController.js @@ -76,10 +76,17 @@ exports.getUsers = (userId) => { }); }; -exports.getTopIPs = (userId) => { +exports.getTopIPs = ( userId, + filter={}, + period_start = (new Date().getFullYear())+'-01-01 00:00:00', + period_end = (new Date().getFullYear() + 1)+'-01-01 00:00:00', + measure='units', + level='month', + min_exist = 0 + ) => { logger.trace(); return new promise((resolve, reject) => { - db.ip.getTop() + db.ip.getTop(filter,period_start,period_end,measure,level,min_exist) .then(data => { db.user.logAction(userId, 'listIPs'); resolve(data); diff --git a/app/db/ip.js b/app/db/ip.js index db60fe2..f23d475 100644 --- a/app/db/ip.js +++ b/app/db/ip.js @@ -117,12 +117,12 @@ function createFilter(filter){ -exports.getTop = (filter={}, - period_start = (new Date().getFullYear())+'-01-01 00:00:00', - period_end = (new Date().getFullYear() + 1)+'-01-01 00:00:00', - measure='units', - level='month', - min_exist = 0 +exports.getTop = (filter, + period_start, + period_end, + measure, + level, + min_exist ) => { logger.trace(); logger.warn('db.ip.getTop() uses only default settings !!!');