From 1172e759caa8058c5466305501a4ab9ac37944c0 Mon Sep 17 00:00:00 2001 From: dilanua Date: Wed, 27 Jul 2016 06:50:06 +0530 Subject: [PATCH] Deprecating serverAdress.js --- .../devicemgt/app/modules/serverAddress.js | 108 +++++++++--------- 1 file changed, 56 insertions(+), 52 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/serverAddress.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/serverAddress.js index f7969dc2f76..7f8ec0aa76c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/serverAddress.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/serverAddress.js @@ -16,55 +16,59 @@ * under the License. */ -var serverAddress = function () { - var log = new Log("serverAddress.js"); - var process = require("process"), - host = process.getProperty('server.host'), - ip = process.getProperty('carbon.local.ip'); - var publicMethods = {}; - publicMethods.getHTTPSAddress = function () { - var port = process.getProperty('mgt.transport.https.proxyPort'); - if (!port) { - port = process.getProperty('mgt.transport.https.port'); - } - if (host === "localhost") { - return "https://" + ip + ":" + port; - } else { - return "https://" + host + ":" + port; - } - }; - publicMethods.getHPPTAddress = function () { - var port = process.getProperty('mgt.transport.http.proxyPort'); - if (!port) { - port = process.getProperty('mgt.transport.http.port'); - } - if (host === "localhost") { - return "http://" + ip + ":" + port; - } else { - return "http://" + host + ":" + port; - } - }; - publicMethods.getWSSAddress = function () { - var port = process.getProperty('mgt.transport.https.proxyPort'); - if (!port) { - port = process.getProperty('mgt.transport.https.port'); - } - if (host === "localhost") { - return "wss://" + ip + ":" + port; - } else { - return "wss://" + host + ":" + port; - } - }; - publicMethods.getWSAddress = function () { - var port = process.getProperty('mgt.transport.http.proxyPort'); - if (!port) { - port = process.getProperty('mgt.transport.http.port'); - } - if (host === "localhost") { - return "ws://" + ip + ":" + port; - } else { - return "ws://" + host + ":" + port; - } - }; - return publicMethods; -}(); \ No newline at end of file +/* + @Deprecated - new + */ + +//var serverAddress = function () { +// var log = new Log("serverAddress.js"); +// var process = require("process"), +// host = process.getProperty('server.host'), +// ip = process.getProperty('carbon.local.ip'); +// var publicMethods = {}; +// publicMethods.getHTTPSAddress = function () { +// var port = process.getProperty('mgt.transport.https.proxyPort'); +// if (!port) { +// port = process.getProperty('mgt.transport.https.port'); +// } +// if (host === "localhost") { +// return "https://" + ip + ":" + port; +// } else { +// return "https://" + host + ":" + port; +// } +// }; +// publicMethods.getHPPTAddress = function () { +// var port = process.getProperty('mgt.transport.http.proxyPort'); +// if (!port) { +// port = process.getProperty('mgt.transport.http.port'); +// } +// if (host === "localhost") { +// return "http://" + ip + ":" + port; +// } else { +// return "http://" + host + ":" + port; +// } +// }; +// publicMethods.getWSSAddress = function () { +// var port = process.getProperty('mgt.transport.https.proxyPort'); +// if (!port) { +// port = process.getProperty('mgt.transport.https.port'); +// } +// if (host === "localhost") { +// return "wss://" + ip + ":" + port; +// } else { +// return "wss://" + host + ":" + port; +// } +// }; +// publicMethods.getWSAddress = function () { +// var port = process.getProperty('mgt.transport.http.proxyPort'); +// if (!port) { +// port = process.getProperty('mgt.transport.http.port'); +// } +// if (host === "localhost") { +// return "ws://" + ip + ":" + port; +// } else { +// return "ws://" + host + ":" + port; +// } +// }; +// return publicMethods; +//}(); \ No newline at end of file