Version information and extended header for admin panel.
This commit is contained in:
parent
db01edcb71
commit
124f330895
7 changed files with 88 additions and 5 deletions
admin/js
|
@ -38,6 +38,23 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest
|
|||
var admin = nga.application('Knotenverwaltung - Admin-Panel');
|
||||
|
||||
admin
|
||||
.header(
|
||||
'<div class="navbar-header">' +
|
||||
'<a class="navbar-brand" href="#" ng-click="appController.displayHome()">' +
|
||||
'Knotenverwaltung - Admin-Panel <small style="font-size: 0.7em;">(<fa-version></fa-version>)</small>' +
|
||||
'</a>' +
|
||||
'</div>' +
|
||||
'<p class="navbar-text navbar-right">' +
|
||||
'<a href="https://github.com/freifunkhamburg/ffffng" target="_blank">' +
|
||||
'<i class="fa fa-github" aria-hidden="true"></i> Source Code' +
|
||||
'</a>' +
|
||||
'</p>' +
|
||||
'<p class="navbar-text navbar-right">' +
|
||||
'<a href="/" target="_blank">' +
|
||||
'<i class="fa fa-external-link" aria-hidden="true"></i> Frontend' +
|
||||
'</a>' +
|
||||
'</p>'
|
||||
)
|
||||
.baseApiUrl('/internal/api/')
|
||||
.debug(true);
|
||||
|
||||
|
|
22
admin/js/views/version.js
Normal file
22
admin/js/views/version.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('ffffngAdmin')
|
||||
.directive('faVersion', function ($http, $state, notification) {
|
||||
var link = function (scope) {
|
||||
scope.version = '?';
|
||||
$http.get('/internal/api/version')
|
||||
.then(function (result) { scope.version = result.data.version; })
|
||||
.catch(function (e) {
|
||||
notification.log('Error: ' + e.data, { addnCls: 'humane-flatty-error' });
|
||||
console.error(e);
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
'link': link,
|
||||
'restrict': 'E',
|
||||
'scope': {},
|
||||
|
||||
'template': '{{version}}'
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue