Added Statistics
See: https://github.com/freifunkhamburg/ffffng/issues/24
This commit is contained in:
parent
2d5db51d24
commit
3c80be4d00
8 changed files with 203 additions and 0 deletions
admin/js
|
@ -337,6 +337,14 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest
|
|||
|
||||
admin.menu(
|
||||
nga.menu()
|
||||
.addChild(nga
|
||||
.menu()
|
||||
.template(
|
||||
'<a href="/internal/admin">' +
|
||||
'<span class="fa fa-dashboard"></span> Dashboard / Statistics' +
|
||||
'</a>'
|
||||
)
|
||||
)
|
||||
.addChild(nga
|
||||
.menu(nodes)
|
||||
.icon('<i class="fa fa-dot-circle-o"></i>')
|
||||
|
@ -363,5 +371,20 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest
|
|||
)
|
||||
);
|
||||
|
||||
admin.dashboard(nga.dashboard()
|
||||
.template(
|
||||
'<div class="row dashboard-starter"></div>' +
|
||||
'<fa-dashboard-stats></fa-dashboard-stats>' +
|
||||
|
||||
'<div class="row dashboard-content">' +
|
||||
'<div class="col-lg-6">' +
|
||||
'<div class="panel panel-default" ng-repeat="collection in dashboardController.collections | orderElement" ng-if="$even">' +
|
||||
'<ma-dashboard-panel collection="collection" entries="dashboardController.entries[collection.name()]"></ma-dashboard-panel>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
)
|
||||
);
|
||||
|
||||
nga.configure(admin);
|
||||
});
|
||||
|
|
22
admin/js/views/dashboardStats.js
Normal file
22
admin/js/views/dashboardStats.js
Normal 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'
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue