From c45cb24b2085226f59d46b61b73f1588ab801521 Mon Sep 17 00:00:00 2001 From: Olivier B Date: Thu, 23 Feb 2017 21:22:47 +0100 Subject: [PATCH] Use relative path in URLs This change allows to use HA-Bridge web app from a sub-folder of the web server, eg. http://example.com/habridge. --- src/main/resources/public/scripts/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/public/scripts/app.js b/src/main/resources/public/scripts/app.js index e5ebc6c..4b305ed 100644 --- a/src/main/resources/public/scripts/app.js +++ b/src/main/resources/public/scripts/app.js @@ -71,7 +71,7 @@ String.prototype.replaceAll = function (search, replace) app.service ('bridgeService', function ($http, $window, ngToast) { var self = this; - this.state = {base: window.location.origin + "/api/devices", bridgelocation: window.location.origin, systemsbase: window.location.origin + "/system", huebase: window.location.origin + "/api", configs: [], backups: [], devices: [], device: {}, mapandid: [], type: "", settings: [], myToastMsg: [], logMsgs: [], loggerInfo: [], mapTypes: [], olddevicename: "", logShowAll: false, isInControl: false, showVera: false, showHarmony: false, showNest: false, showHue: false, showHal: false, showMqtt: false, showHass: false, showDomoticz: false, habridgeversion: ""}; + this.state = {base: "./api/devices", bridgelocation: ".", systemsbase: "./system", huebase: "./api", configs: [], backups: [], devices: [], device: {}, mapandid: [], type: "", settings: [], myToastMsg: [], logMsgs: [], loggerInfo: [], mapTypes: [], olddevicename: "", logShowAll: false, isInControl: false, showVera: false, showHarmony: false, showNest: false, showHue: false, showHal: false, showMqtt: false, showHass: false, showDomoticz: false, habridgeversion: ""}; this.displayWarn = function(errorTitle, error) { var toastContent = errorTitle; @@ -2568,4 +2568,4 @@ app.filter('configuredDomoticzItems', function (bridgeService) { app.controller('VersionController', function ($scope, bridgeService) { $scope.bridge = bridgeService.state; -}); \ No newline at end of file +});