|
|
@ -689,26 +689,29 @@ function intializeWebsocketUrls() {
|
|
|
|
wso2.gadgets.state.getGlobalState(function (state) {
|
|
|
|
wso2.gadgets.state.getGlobalState(function (state) {
|
|
|
|
deviceId = state.device.id;
|
|
|
|
deviceId = state.device.id;
|
|
|
|
deviceType = state.device.type;
|
|
|
|
deviceType = state.device.type;
|
|
|
|
|
|
|
|
var hostname = window.parent.location.hostname;
|
|
|
|
|
|
|
|
var port = window.parent.location.port;
|
|
|
|
if (deviceId && deviceType) {
|
|
|
|
if (deviceId && deviceType) {
|
|
|
|
//TODO need to get the token
|
|
|
|
|
|
|
|
wso2.gadgets.identity.getUsername(function (username) {
|
|
|
|
wso2.gadgets.identity.getUsername(function (username) {
|
|
|
|
$.getJSON("/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/get_server_info.jag?username=" + username, function (data) {
|
|
|
|
wso2.gadgets.identity.getAccessToken(function (accessToken) {
|
|
|
|
webSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
$.getJSON("/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/get_server_info.jag?username=" + username, function (data) {
|
|
|
|
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
|
|
|
|
webSocketURL = 'wss://' + hostname + ':' + port + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
|
|
|
|
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
|
|
|
|
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
|
|
|
|
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
|
|
|
|
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
|
|
|
|
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
|
|
|
|
alertWebSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
|
|
|
|
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
|
|
|
|
alertWebSocketURL = 'wss://' + hostname + ':' + port + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
|
|
|
|
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
|
|
|
|
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
|
|
|
|
.CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
|
|
|
|
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
|
|
|
|
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
|
|
|
|
.CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
|
|
|
|
document.cookie = "websocket-token=619e6170-10e8-31f0-904b-b7770d53e545; path=/";
|
|
|
|
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
|
|
|
|
$("#proximity_alert").hide();
|
|
|
|
document.cookie = "websocket-token=" + accessToken + "; path=/";
|
|
|
|
initializeWebSocket();
|
|
|
|
$("#proximity_alert").hide();
|
|
|
|
initializeOnAlertWebSocket();
|
|
|
|
initializeWebSocket();
|
|
|
|
|
|
|
|
initializeOnAlertWebSocket();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|