Merge pull request #476 from Megala21/embed

Fixing UI issues and updating apk file to switch between enabling and disabling events
merge-requests/1/head
Charitha Goonetilleke 8 years ago committed by GitHub
commit b85a7b493a

@ -240,7 +240,7 @@
<ul class="uk-nav-sub">
<li><a style="margin-left: 20%;" data-toggle="modal" href="/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/modals/speed_alert.jag"
data-target="#commonModal"><i class="fa fa-tachometer"></i> Speed alert</a></li>
<li><a style="margin-left: 20%;" data-toggle="modal" href="/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/modals/proximity_alert.jag"
<li id = "proximity_alert"><a style="margin-left: 20%;" data-toggle="modal" href="/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/modals/proximity_alert.jag"
data-target="#commonModal"><i class="fa fa-link"></i> Proximity alert</a></li>
<li><a style="margin-left: 20%;" data-toggle="modal" href="/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/modals/stationery_alert.jag"
data-target="#commonModal"><i class="fa fa-chain-broken"></i> Stationary alert</a></li>
@ -254,10 +254,6 @@
<ul class="uk-nav-sub">
<li><a style="margin-left: 20%;" data-toggle="modal" href="/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/modals/within_alert.jag"
data-target="#commonModal"><i class="fa fa-square-o"></i> Within</a></li>
<li><a style="margin-left: 20%;color: grey;cursor: not-allowed;"><i
class="fa fa-external-link-square"></i> Approaching</a></li>
<li><a style="margin-left: 20%;color: grey;cursor: not-allowed;"><i class="fa fa-minus"></i>
Cross</a></li>
</ul>
</li>

@ -269,7 +269,6 @@ function processTrafficMessage(json) {
}
function processAlertMessage(json) {
//console.log(json);
if (json.state != "NORMAL" && json.state != "MINIMAL") {
console.log(json);
notifyAlert("Object ID: <span style='color: blue;cursor: pointer' onclick='focusOnSpatialObject(" + json.id + ")'>" + json.id + "</span> change state to: <span style='color: red'>" + json.state + "</span> Info : " + json.information);
@ -689,6 +688,7 @@ function intializeWebsocketUrls() {
.CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
document.cookie = "websocket-token=f98d6142-e988-3c7f-a8c9-7e6d74da7113; path=/";
$("#proximity_alert").hide();
initializeWebSocket();
initializeOnAlertWebSocket();
});

@ -9,7 +9,7 @@
"type": "Feature",
"id": {{id}},
"deviceId": {{id}},
"deviceType" : "{{type}}",
"deviceType" : {{type}},
"state": {{state}},
"information": {{information}},
"longitude" : {{longitude}},

@ -76,6 +76,7 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
.target(ApiApplicationRegistrationService.class,
deviceMgtServerUrl + API_APPLICATION_REGISTRATION_CONTEXT);
}
@Override
public void apply(RequestTemplate template) {
if (tokenInfo == null) {
@ -95,9 +96,11 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
tokenInfo = tokenIssuerService.getToken(PASSWORD_GRANT_TYPE, username, password);
tokenInfo.setExpires_in(System.currentTimeMillis() + tokenInfo.getExpires_in());
}
if (System.currentTimeMillis() + refreshTimeOffset > tokenInfo.getExpires_in()) {
tokenInfo = tokenIssuerService.getToken(REFRESH_GRANT_TYPE, tokenInfo.getRefresh_token());
tokenInfo.setExpires_in(System.currentTimeMillis() + tokenInfo.getExpires_in());
synchronized(tokenInfo) {
if (System.currentTimeMillis() + refreshTimeOffset > tokenInfo.getExpires_in()) {
tokenInfo = tokenIssuerService.getToken(REFRESH_GRANT_TYPE, tokenInfo.getRefresh_token());
tokenInfo.setExpires_in(System.currentTimeMillis() + tokenInfo.getExpires_in());
}
}
String headerValue = "Bearer " + tokenInfo.getAccess_token();
template.header("Authorization", headerValue);

Loading…
Cancel
Save