mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Format the source of geofence
This commit is contained in:
parent
af430cba61
commit
c86c976fe6
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function onRequest(context) {
|
function onRequest(context) {
|
||||||
|
|
||||||
var log = new Log("geo-dashboard.js");
|
var log = new Log("geo-dashboard.js");
|
||||||
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
||||||
var viewModel = {};
|
var viewModel = {};
|
||||||
@ -41,14 +40,14 @@ function onRequest(context) {
|
|||||||
wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/";
|
wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/";
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
if (tokenPair) {
|
||||||
token = tokenPair.accessToken;
|
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.device = device;
|
||||||
viewModel.wsToken = token;
|
viewModel.wsToken = token;
|
||||||
|
|||||||
@ -561,7 +561,7 @@ var webSocketOnAlertMessage = function processMessage(message) {
|
|||||||
var json = $.parseJSON(message.data);
|
var json = $.parseJSON(message.data);
|
||||||
if (json.messageType == "Alert") {
|
if (json.messageType == "Alert") {
|
||||||
processAlertMessage(json);
|
processAlertMessage(json);
|
||||||
}else {
|
} else {
|
||||||
console.log("Message type not supported.");
|
console.log("Message type not supported.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user