From b8bf855378bd748201f578bb3ca1357f70168196 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 2 Aug 2016 15:43:40 +0530 Subject: [PATCH] Calculating enrollment url when generalConfig.host config exists --- .../jaggeryapps/devicemgt/app/modules/conf-reader/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js index f81849fe3bd..6731dbd23a8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js @@ -37,6 +37,12 @@ var conf = function () { return value; } ); + if (conf.generalConfig.host) { + //TODO: Move enrollment URL into app-conf.json + var enrollmentHost = conf.generalConfig.host.replace(/https:\/\/localhost(:\d+)?/, conf.httpsURL).replace( + /http:\/\/localhost(:\d+)?/, conf.httpURL); + conf.enrollmentUrl = enrollmentHost + conf.enrollmentDir; + } application.put("CONF", conf); } return conf;