|
|
@ -273,6 +273,7 @@ var getProviderData = function (timeFrom, timeTo) {
|
|
|
|
deviceId = deviceDetails.data("deviceid");
|
|
|
|
deviceId = deviceDetails.data("deviceid");
|
|
|
|
deviceType = deviceDetails.data("type");
|
|
|
|
deviceType = deviceDetails.data("type");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (geoFencingEnabled) {
|
|
|
|
var serviceUrl = '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + timeFrom + '&to=' + timeTo;
|
|
|
|
var serviceUrl = '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + timeFrom + '&to=' + timeTo;
|
|
|
|
invokerUtil.get(serviceUrl,
|
|
|
|
invokerUtil.get(serviceUrl,
|
|
|
|
function (data) {
|
|
|
|
function (data) {
|
|
|
@ -283,6 +284,9 @@ var getProviderData = function (timeFrom, timeTo) {
|
|
|
|
}, function (message) {
|
|
|
|
}, function (message) {
|
|
|
|
showCurrentLocation(tableData);
|
|
|
|
showCurrentLocation(tableData);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
showCurrentLocation(tableData);
|
|
|
|
|
|
|
|
}
|
|
|
|
return tableData;
|
|
|
|
return tableData;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -368,7 +372,9 @@ function enableRealTime() {
|
|
|
|
isBatchModeOn = false;
|
|
|
|
isBatchModeOn = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function InitSpatialObject() {
|
|
|
|
var geoFencingEnabled = true;
|
|
|
|
|
|
|
|
function InitSpatialObject(geoFencingIsEnabled) {
|
|
|
|
|
|
|
|
geoFencingEnabled = geoFencingIsEnabled;
|
|
|
|
var spatialObject = drawSpatialObject();
|
|
|
|
var spatialObject = drawSpatialObject();
|
|
|
|
map.addControl(L.control.focus({position: 'bottomright', marker: spatialObject.marker, zoomLevel: zoomLevel}));
|
|
|
|
map.addControl(L.control.focus({position: 'bottomright', marker: spatialObject.marker, zoomLevel: zoomLevel}));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -420,9 +426,11 @@ function drawSpatialObject() {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (geoFencingEnabled) {
|
|
|
|
var alertsFromDate = new Date();
|
|
|
|
var alertsFromDate = new Date();
|
|
|
|
alertsFromDate.setHours(alertsFromDate.getHours() - 24); //last 24 hours
|
|
|
|
alertsFromDate.setHours(alertsFromDate.getHours() - 24); //last 24 hours
|
|
|
|
getAlertsHistory(deviceType, deviceId, alertsFromDate.valueOf(), toDate.valueOf());
|
|
|
|
getAlertsHistory(deviceType, deviceId, alertsFromDate.valueOf(), toDate.valueOf());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
setTimeout(function () {
|
|
|
|
map.invalidateSize();
|
|
|
|
map.invalidateSize();
|
|
|
|