|
|
@ -690,8 +690,8 @@ function intializeWebsocketUrls() {
|
|
|
|
deviceId = state.device.id;
|
|
|
|
deviceId = state.device.id;
|
|
|
|
deviceType = state.device.type;
|
|
|
|
deviceType = state.device.type;
|
|
|
|
if (deviceId && deviceType) {
|
|
|
|
if (deviceId && deviceType) {
|
|
|
|
//TODO need to get the token
|
|
|
|
|
|
|
|
wso2.gadgets.identity.getUsername(function (username) {
|
|
|
|
wso2.gadgets.identity.getUsername(function (username) {
|
|
|
|
|
|
|
|
wso2.gadgets.identity.getAccessToken(function (accessToken) {
|
|
|
|
$.getJSON("/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/get_server_info.jag?username=" + username, function (data) {
|
|
|
|
$.getJSON("/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/get_server_info.jag?username=" + username, function (data) {
|
|
|
|
webSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
webSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
|
|
|
|
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
|
|
|
@ -705,12 +705,13 @@ function intializeWebsocketUrls() {
|
|
|
|
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
.CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
|
|
|
|
.CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
|
|
|
|
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
|
|
|
|
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
|
|
|
|
document.cookie = "websocket-token=619e6170-10e8-31f0-904b-b7770d53e545; path=/";
|
|
|
|
document.cookie = "websocket-token="+accessToken+"; path=/";
|
|
|
|
$("#proximity_alert").hide();
|
|
|
|
$("#proximity_alert").hide();
|
|
|
|
initializeWebSocket();
|
|
|
|
initializeWebSocket();
|
|
|
|
initializeOnAlertWebSocket();
|
|
|
|
initializeOnAlertWebSocket();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$.UIkit.notify({
|
|
|
|
$.UIkit.notify({
|
|
|
|
message: 'Invalid Access! No device information provided to track!',
|
|
|
|
message: 'Invalid Access! No device information provided to track!',
|
|
|
|