Added Statistics

See: https://github.com/freifunkhamburg/ffffng/issues/24
This commit is contained in:
baldo 2016-07-19 13:24:43 +02:00
parent 2d5db51d24
commit 3c80be4d00
8 changed files with 203 additions and 0 deletions
server/resources

View file

@ -0,0 +1,26 @@
'use strict';
angular.module('ffffng').factory('StatisticsResource', function (
Logger,
NodeService,
Resources,
ErrorTypes
) {
return {
get: function (req, res) {
NodeService.getNodeStatistics(function (err, nodeStatistics) {
if (err) {
Logger.tag('statistics').error('Error getting statistics:', err);
return Resources.error(res, {data: 'Internal error.', type: ErrorTypes.internalError});
}
return Resources.success(
res,
{
nodes: nodeStatistics
}
);
});
}
};
});