Allow serving everything beneath a baseUrl with a path.

See: https://github.com/freifunkhamburg/ffffng/issues/44
This commit is contained in:
baldo 2017-05-06 18:40:59 +02:00
commit 8de06a0a8a
14 changed files with 85 additions and 55 deletions
admin/js/views

View file

@ -1,10 +1,12 @@
'use strict';
angular.module('ffffngAdmin')
.directive('faDashboardStats', function ($http, $state, notification) {
.directive('faDashboardStats', function ($http, $state, notification, config) {
var pathPrefix = config.rootPath === '/' ? '' : config.rootPath;
var link = function (scope) {
scope.stats = {};
$http.get('/internal/api/statistics')
$http.get(pathPrefix + '/internal/api/statistics')
.then(function (result) { scope.stats = result.data; })
.catch(function (e) {
notification.log('Error: ' + e.data, { addnCls: 'humane-flatty-error' });