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
admin/js/views

View file

@ -0,0 +1,22 @@
'use strict';
angular.module('ffffngAdmin')
.directive('faDashboardStats', function ($http, $state, notification) {
var link = function (scope) {
scope.stats = {};
$http.get('/internal/api/statistics')
.then(function (result) { scope.stats = result.data; })
.catch(function (e) {
notification.log('Error: ' + e.data, { addnCls: 'humane-flatty-error' });
console.error(e);
});
};
return {
'link': link,
'restrict': 'E',
'scope': {},
'templateUrl': 'views/dashboardStats.html'
};
});