diff --git a/bundles/org.openhab.ui.habpanel/web/app/services/icon.service.js b/bundles/org.openhab.ui.habpanel/web/app/services/icon.service.js index bf0b884c77..6294ac93ac 100755 --- a/bundles/org.openhab.ui.habpanel/web/app/services/icon.service.js +++ b/bundles/org.openhab.ui.habpanel/web/app/services/icon.service.js @@ -25,7 +25,7 @@ function getIconUrl(iconset, icon, state) { if (iconset === 'custom-icon') { - return '/icon/' + icon + '?format=svg' + ((state) ? '&state=' + state : ''); + return '../icon/' + icon + '?format=svg' + ((state) ? '&state=' + state : ''); } else if (iconset === 'custom-url') { return icon; } @@ -34,7 +34,7 @@ if (set.type === 'builtin') { return 'assets/icons/' + set.id + '/' + icon + '.svg'; } else { - return '/icon/' + icon + '?format=svg' + ((state) ? '&state=' + state : ''); + return '../icon/' + icon + '?format=svg' + ((state) ? '&state=' + state : ''); } } diff --git a/bundles/org.openhab.ui.habpanel/web/app/services/oh2storage.service.js b/bundles/org.openhab.ui.habpanel/web/app/services/oh2storage.service.js index a609692cbf..0ec1196620 100644 --- a/bundles/org.openhab.ui.habpanel/web/app/services/oh2storage.service.js +++ b/bundles/org.openhab.ui.habpanel/web/app/services/oh2storage.service.js @@ -31,7 +31,7 @@ $http({ method: 'GET', - url: '/rest/services/' + SERVICE_NAME + '/config', + url: '../rest/services/' + SERVICE_NAME + '/config', headers: headers }).then(function (resp) { console.log('openHAB 2 service configuration loaded'); @@ -77,7 +77,7 @@ OH3StorageService.getAccessToken().then(function (accessToken) { $http({ method: 'PUT', - url: '/rest/services/' + SERVICE_NAME + '/config', + url: '../rest/services/' + SERVICE_NAME + '/config', data: OH2ServiceConfiguration, headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + accessToken } }).then (function (resp) { diff --git a/bundles/org.openhab.ui.habpanel/web/app/services/oh3storage.service.js b/bundles/org.openhab.ui.habpanel/web/app/services/oh3storage.service.js index 26902a1272..d580837c78 100644 --- a/bundles/org.openhab.ui.habpanel/web/app/services/oh3storage.service.js +++ b/bundles/org.openhab.ui.habpanel/web/app/services/oh3storage.service.js @@ -26,7 +26,7 @@ } else { $http({ method: 'POST', - url: '/rest/auth/token', + url: '../rest/auth/token', data: 'grant_type=refresh_token&client_id=' + window.location.origin + '&redirect_uri=' + window.location.origin + '&refresh_token=' + refreshToken, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } @@ -49,7 +49,7 @@ if (!refreshToken) { $rootScope.lockEditing = true; } - $http.get('/rest/ui/components/habpanel:panelconfig').then(function (data) { + $http.get('../rest/ui/components/habpanel:panelconfig').then(function (data) { console.log('Panel configurations loaded'); $rootScope.panelsRegistry = transformUIComponentsToPanelRegistry(data.data); deferred.resolve($rootScope.panelsRegistry); @@ -77,11 +77,11 @@ headers['Authorization'] = 'Bearer ' + accessToken } - $http.get('/rest/ui/components/habpanel:panelconfig/' + getCurrentPanelConfig()).then(function (data) { + $http.get('../rest/ui/components/habpanel:panelconfig/' + getCurrentPanelConfig()).then(function (data) { // update $http({ method: 'PUT', - url: '/rest/ui/components/habpanel:panelconfig/' + getCurrentPanelConfig(), + url: '../rest/ui/components/habpanel:panelconfig/' + getCurrentPanelConfig(), data: transformPanelConfigurationToUIComponent(getCurrentPanelConfig(), panelConfiguration), headers: headers }).then (function (resp) { @@ -95,7 +95,7 @@ // assume the error is 404? $http({ method: 'POST', - url: '/rest/ui/components/habpanel:panelconfig', + url: '../rest/ui/components/habpanel:panelconfig', data: transformPanelConfigurationToUIComponent(getCurrentPanelConfig(), panelConfiguration), headers: headers }).then (function (resp) { @@ -127,7 +127,7 @@ $http({ method: 'DELETE', - url: '/rest/ui/components/habpanel:panelconfig/' + id, + url: '../rest/ui/components/habpanel:panelconfig/' + id, headers: headers }).then (function (resp) { console.log('Panel configuration deleted'); diff --git a/bundles/org.openhab.ui.habpanel/web/app/services/openhab.service.js b/bundles/org.openhab.ui.habpanel/web/app/services/openhab.service.js index 56981fcc8d..9d98828c19 100755 --- a/bundles/org.openhab.ui.habpanel/web/app/services/openhab.service.js +++ b/bundles/org.openhab.ui.habpanel/web/app/services/openhab.service.js @@ -32,7 +32,7 @@ $timeout($rootScope.$emit('openhab-update')); } - $http.get('/rest/items') + $http.get('../rest/items') .then(function (data) { if (angular.isArray(data.data)) { console.log("Loaded " + data.data.length + " openHAB items"); @@ -71,7 +71,7 @@ function sendCmd(item, cmd) { $http({ method : 'POST', - url : '/rest/items/' + item, + url : '../rest/items/' + item, data : cmd, headers: { 'Content-Type': 'text/plain' } }).then(function (data) { @@ -92,7 +92,7 @@ if (locale) { deferred.resolve(locale); } else { - $http.get('/rest/') + $http.get('../rest/') .then(function (response) { if (!response.data.locale) { if (navigator && navigator.languages) { @@ -145,7 +145,7 @@ function sendVoice(text) { $http({ method : 'POST', - url : '/rest/voice/interpreters', + url : '../rest/voice/interpreters', data : text, headers: { 'Content-Type': 'text/plain' } }).then(function (data) { @@ -161,7 +161,7 @@ function registerEventSource() { if (typeof(EventSource) !== "undefined") { - var source = new EventSource('/rest/events?topics=openhab/items/*/statechanged,openhab/items/*/*/statechanged,openhab/webaudio/playurl'); + var source = new EventSource('../rest/events?topics=openhab/items/*/statechanged,openhab/items/*/*/statechanged,openhab/webaudio/playurl'); liveUpdatesEnabled = true; source.onmessage = function (event) { @@ -192,7 +192,7 @@ } } else { // fetch the new transformed state - $http.get('/rest/items/' + item.name).then(function (response) { + $http.get('../rest/items/' + item.name).then(function (response) { if (response.data && response.data.transformedState) { item.transformedState = response.data.transformedState; $rootScope.$emit('openhab-update', item); diff --git a/bundles/org.openhab.ui.habpanel/web/app/settings/settings.widgets.gallery.controller.js b/bundles/org.openhab.ui.habpanel/web/app/settings/settings.widgets.gallery.controller.js index a7e4533120..3d7d80c35c 100755 --- a/bundles/org.openhab.ui.habpanel/web/app/settings/settings.widgets.gallery.controller.js +++ b/bundles/org.openhab.ui.habpanel/web/app/settings/settings.widgets.gallery.controller.js @@ -20,7 +20,7 @@ vm.progressMax = 1; vm.progressCurrent = 1; - $http.get('/rest/habpanel/gallery/community/widgets') + $http.get('../rest/habpanel/gallery/community/widgets') .then(function (resp) { vm.busy = false; if (resp.data) { @@ -52,7 +52,7 @@ vm.progressMax = 1; vm.progressCurrent = 1; - $http.get('/rest/habpanel/gallery/community/widgets/' + id) + $http.get('../rest/habpanel/gallery/community/widgets/' + id) .then(function (resp) { vm.galleryItemDetails = resp.data; if (vm.galleryItemDetails.authorAvatarUrl) diff --git a/bundles/org.openhab.ui.habpanel/web/app/widgets/chart/chart.widget.js b/bundles/org.openhab.ui.habpanel/web/app/widgets/chart/chart.widget.js index 30e15d9cd5..78aa7d24f9 100755 --- a/bundles/org.openhab.ui.habpanel/web/app/widgets/chart/chart.widget.js +++ b/bundles/org.openhab.ui.habpanel/web/app/widgets/chart/chart.widget.js @@ -117,7 +117,7 @@ vm.rawdata = []; for (var i = 0; i < vm.widget.series.length; i++) { - vm.rawdata[i] = $http.get('/rest/persistence/items/' + vm.widget.series[i].item + "?starttime=" + startDate.toISOString() + (vm.widget.service ? '&serviceId=' + vm.widget.service : '')); + vm.rawdata[i] = $http.get('../rest/persistence/items/' + vm.widget.series[i].item + "?starttime=" + startDate.toISOString() + (vm.widget.service ? '&serviceId=' + vm.widget.service : '')); } $q.all(vm.rawdata).then(function (values) { diff --git a/bundles/org.openhab.ui.habpanel/web/app/widgets/timeline/timeline.widget.js b/bundles/org.openhab.ui.habpanel/web/app/widgets/timeline/timeline.widget.js index be5713be0a..a257bc834f 100755 --- a/bundles/org.openhab.ui.habpanel/web/app/widgets/timeline/timeline.widget.js +++ b/bundles/org.openhab.ui.habpanel/web/app/widgets/timeline/timeline.widget.js @@ -218,7 +218,7 @@ vm.rawdata = []; for (var i = 0; i < vm.widget.series.length; i++) { - vm.rawdata[i] = $http.get('/rest/persistence/items/' + vm.widget.series[i].item + "?boundary=true&starttime=" + startDate.toISOString() + (vm.widget.service ? '&serviceId=' + vm.widget.service : '')); + vm.rawdata[i] = $http.get('../rest/persistence/items/' + vm.widget.series[i].item + "?boundary=true&starttime=" + startDate.toISOString() + (vm.widget.service ? '&serviceId=' + vm.widget.service : '')); }