Extended node management in amdin panel.

This commit is contained in:
baldo 2016-06-07 10:50:15 +02:00
parent d5c69fa78f
commit 0f1a21c905
10 changed files with 152 additions and 32 deletions
server/services

View file

@ -369,11 +369,13 @@ angular.module('ffffng')
deleteNodeFile(token, callback);
},
getAllNodes: function (callback) {
var files = findNodeFiles({});
getAllNodes: function (page, perPage, callback) {
var files = _.sortBy(findNodeFiles({}));
var total = files.length;
var pageFiles = files.slice((page - 1) * perPage, page * perPage);
async.mapLimit(
files,
pageFiles,
MAX_PARALLEL_NODES_PARSING,
parseNodeFile,
function (err, nodes) {
@ -382,7 +384,7 @@ angular.module('ffffng')
return callback({data: 'Internal error.', type: ErrorTypes.internalError});
}
return callback(null, nodes);
return callback(null, nodes, total);
}
);
},