Merge pull request #476 from Megala21/embed

Fixing UI issues and updating apk file to switch between enabling and disabling events
revert-dabc3590
Charitha Goonetilleke 8 years ago committed by GitHub
commit b85a7b493a

@ -240,7 +240,7 @@
<ul class="uk-nav-sub"> <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" <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> 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> 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" <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> data-target="#commonModal"><i class="fa fa-chain-broken"></i> Stationary alert</a></li>
@ -254,10 +254,6 @@
<ul class="uk-nav-sub"> <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" <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> 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> </ul>
</li> </li>

@ -269,7 +269,6 @@ function processTrafficMessage(json) {
} }
function processAlertMessage(json) { function processAlertMessage(json) {
//console.log(json);
if (json.state != "NORMAL" && json.state != "MINIMAL") { if (json.state != "NORMAL" && json.state != "MINIMAL") {
console.log(json); 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); 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 .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=f98d6142-e988-3c7f-a8c9-7e6d74da7113; path=/"; document.cookie = "websocket-token=f98d6142-e988-3c7f-a8c9-7e6d74da7113; path=/";
$("#proximity_alert").hide();
initializeWebSocket(); initializeWebSocket();
initializeOnAlertWebSocket(); initializeOnAlertWebSocket();
}); });

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

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

Loading…
Cancel
Save