From c86c976fe6ca2d0e8b534b7efc441713c7e529b7 Mon Sep 17 00:00:00 2001 From: lasantha Date: Sun, 4 Mar 2018 23:53:47 +0530 Subject: [PATCH] Format the source of geofence --- .../app/units/cdmf.unit.geo-dashboard/geo-dashboard.js | 9 ++++----- .../units/cdmf.unit.geo-dashboard/public/js/websocket.js | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js index 1fcfd20d1c..de15fc40e4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js @@ -17,7 +17,6 @@ */ function onRequest(context) { - var log = new Log("geo-dashboard.js"); var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var viewModel = {}; @@ -41,14 +40,14 @@ function onRequest(context) { wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/"; } } else { - tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + context.user.domain,"default", {}); + tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + + context.user.domain, "default", {}); if (tokenPair) { token = tokenPair.accessToken; - wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/t/"+context.user.domain+"/"; + wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/t/" + + context.user.domain + "/"; } - } - } viewModel.device = device; viewModel.wsToken = token; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js index 027de4459f..dcc0b7d5cb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js @@ -561,7 +561,7 @@ var webSocketOnAlertMessage = function processMessage(message) { var json = $.parseJSON(message.data); if (json.messageType == "Alert") { processAlertMessage(json); - }else { + } else { console.log("Message type not supported."); } }