mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Fix NPE issue in showing relatime analytics on Sample device types
This commit is contained in:
parent
03391ae6c2
commit
484420c9a6
@ -46,14 +46,14 @@ function onRequest(context) {
|
||||
if (tokenPair) {
|
||||
token = tokenPair.accessToken;
|
||||
}
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.android.sense/1.0.0?" +
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/org.wso2.iot.android.sense/1.0.0?" +
|
||||
"deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
||||
} else {
|
||||
tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + tenantDomain,"default", {});
|
||||
if (tokenPair) {
|
||||
token = tokenPair.accessToken;
|
||||
}
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket/t/"+tenantDomain+"/org.wso2.iot.android.sense/1.0.0?" +
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/t/"+tenantDomain+"/org.wso2.iot.android.sense/1.0.0?" +
|
||||
"deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ function onRequest(context) {
|
||||
if (tokenPair) {
|
||||
token = tokenPair.accessToken;
|
||||
}
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?"
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/org.wso2.iot.devices.temperature/1.0.0?"
|
||||
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
||||
} else {
|
||||
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain
|
||||
@ -46,7 +46,7 @@ function onRequest(context) {
|
||||
if (tokenPair) {
|
||||
token = tokenPair.accessToken;
|
||||
}
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket/t/" + user.domain + "/org.wso2.iot.devices.temperature/1.0.0?"
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/t/" + user.domain + "/org.wso2.iot.devices.temperature/1.0.0?"
|
||||
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ function onRequest(context) {
|
||||
if (tokenPair) {
|
||||
token = tokenPair.accessToken;
|
||||
}
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket/iot.per.device.stream.raspberrypi.temperature/1.0.0?"
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/iot.per.device.stream.raspberrypi.temperature/1.0.0?"
|
||||
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
||||
} else {
|
||||
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain
|
||||
@ -50,7 +50,7 @@ function onRequest(context) {
|
||||
if (tokenPair) {
|
||||
token = tokenPair.accessToken;
|
||||
}
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket/t/" + user.domain + "/iot.per.device.stream.raspberrypi.temperature/1.0.0?"
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/t/" + user.domain + "/iot.per.device.stream.raspberrypi.temperature/1.0.0?"
|
||||
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ function onRequest(context) {
|
||||
if (tokenPair) {
|
||||
token = tokenPair.accessToken;
|
||||
}
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket/iot.per.device.stream.virtualfirealarm.temperature/1.0.0?"
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/iot.per.device.stream.virtualfirealarm.temperature/1.0.0?"
|
||||
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
||||
} else {
|
||||
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain
|
||||
@ -50,7 +50,7 @@ function onRequest(context) {
|
||||
if (tokenPair) {
|
||||
token = tokenPair.accessToken;
|
||||
}
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket/t/" + user.domain + "/iot.per.device.stream.virtualfirealarm.temperature/1.0.0?"
|
||||
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/t/" + user.domain + "/iot.per.device.stream.virtualfirealarm.temperature/1.0.0?"
|
||||
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user