100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Added managerUrl to or-app
Rich Turnerfeca207cf6f3
diff --git a/client/src/main/webapp/src/or-app/or-app.html b/client/src/main/webapp/src/or-app/or-app.htmlindex ffff09ad8..573ab7db0 100644--- a/client/src/main/webapp/src/or-app/or-app.html+++ b/client/src/main/webapp/src/or-app/or-app.html@@ -277,6 +277,8 @@function _load(tag, rel) {return function (url) {return new Promise(function (resolve, reject) {++ url = openremote.INSTANCE.managerHost + url;var element = window.document.createElement(tag);// Append loading tags to the bodyvar parent = 'body';@@ -313,7 +315,9 @@img: _load("img")}}- }+ },++ managerHost: String};}@@ -343,6 +347,15 @@// The app should flex and its children should be in a flexbox vertical layoutthis.shadowRoot.host.classList.add("flex", "layout", "vertical");+ // Extract manager host URI based on where this component is hosted; it is assumed that the component+ // is being hosted in a manager instance and that is the instance you want to connect to.+ var managerHost = '';+ var hostURI = this.importPath;+ if ( hostURI ) {+ managerHost = '//' + new URL(hostURI).host;+ }+ this.managerHost = managerHost;+if (this.login) {this.getSecurity().set("shellNative", this.$.shellNative);this.getSecurity().startAuthentication();