Format the source of geofence

revert-70aa11f8
lasantha 7 years ago
parent af430cba61
commit c86c976fe6

@ -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;

@ -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.");
}
}

Loading…
Cancel
Save