mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixing geo fencing issues
This commit is contained in:
parent
fd2c6b3341
commit
54eafe8ac9
@ -79,7 +79,7 @@ deviceModule = function () {
|
|||||||
var fromDate = new Date();
|
var fromDate = new Date();
|
||||||
fromDate.setHours(fromDate.getHours() - 2);
|
fromDate.setHours(fromDate.getHours() - 2);
|
||||||
var toDate = new Date();
|
var toDate = new Date();
|
||||||
var serviceUrl = devicemgtProps["httpsURL"] + '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + fromDate + '&to=' + toDate;
|
var serviceUrl = devicemgtProps["httpsURL"] + '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + fromDate.getTime() + '&to=' + toDate.getTime();
|
||||||
serviceInvokers.XMLHttp.get(serviceUrl,
|
serviceInvokers.XMLHttp.get(serviceUrl,
|
||||||
function (backendResponse) {
|
function (backendResponse) {
|
||||||
if (backendResponse.status === 200 && backendResponse.responseText) {
|
if (backendResponse.status === 200 && backendResponse.responseText) {
|
||||||
|
|||||||
@ -531,9 +531,9 @@
|
|||||||
|
|
||||||
<div id="dateRangePopup">
|
<div id="dateRangePopup">
|
||||||
<div>
|
<div>
|
||||||
<label> From: <input id="timeFrom" type="text"> </label>
|
<label> From: <input id="timeFromCal" type="text"> </label>
|
||||||
<label> To: <input id="timeTo" type="text"> </label>
|
<label> To: <input id="timeToCal" type="text"> </label>
|
||||||
<button type="button" class="btn btn-info btn-xs" onClick="focusOnHistorySpatialObject(document.getElementById('objectId').innerHTML, document.getElementById('timeFrom').value, document.getElementById('timeTo').value);return false;">Full History</button>
|
<button type="button" class="btn btn-info btn-xs" onClick="focusOnHistorySpatialObject(document.getElementById('objectId').innerHTML, document.getElementById('timeFromCal').value, document.getElementById('timeToCal').value);return false;">Full History</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -707,7 +707,7 @@
|
|||||||
{{js "js/leaflet/Leaflet.fullscreen.min.js" }}
|
{{js "js/leaflet/Leaflet.fullscreen.min.js" }}
|
||||||
{{js "js/leaflet/Marker.Rotate.js" }}
|
{{js "js/leaflet/Marker.Rotate.js" }}
|
||||||
{{js "js/leaflet/leaflet.draw.js" }}
|
{{js "js/leaflet/leaflet.draw.js" }}
|
||||||
{{js "js/jquery/jquery-ui.min.js" }}
|
{{!js "js/jquery/jquery-ui.min.js" }}
|
||||||
<!-- Leaflet plugins libries -->
|
<!-- Leaflet plugins libries -->
|
||||||
|
|
||||||
{{js "js/firstTemp.js" }}
|
{{js "js/firstTemp.js" }}
|
||||||
@ -749,6 +749,10 @@
|
|||||||
'Add Geofence Exit Alert', 'glyphicon glyphicon-log-out', geoToolsMenu);
|
'Add Geofence Exit Alert', 'glyphicon glyphicon-log-out', geoToolsMenu);
|
||||||
{{/if}}
|
{{/if}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
||||||
|
$('#dateRangePopup').dialog('close');
|
||||||
|
})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|||||||
@ -254,7 +254,7 @@ function focusOnSpatialObject(objectId) {
|
|||||||
// TODO: check the map._layersMaxZoom and set the zoom level accordingly
|
// TODO: check the map._layersMaxZoom and set the zoom level accordingly
|
||||||
|
|
||||||
spatialObject.marker.openPopup();
|
spatialObject.marker.openPopup();
|
||||||
getAlertsHistory(deviceType, deviceId, new Date($('#timeFrom').val()).getTime(), new Date($('#timeTo').val()).getTime());
|
getAlertsHistory(deviceType, deviceId, new Date($('#timeFromCal').val()).getTime(), new Date($('#timeToCal').val()).getTime());
|
||||||
spatialObject.drawPath();
|
spatialObject.drawPath();
|
||||||
if (speedGraphControl) {
|
if (speedGraphControl) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
@ -504,7 +504,7 @@ function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
|
|||||||
// TODO: check the map._layersMaxZoom and set the zoom level accordingly
|
// TODO: check the map._layersMaxZoom and set the zoom level accordingly
|
||||||
|
|
||||||
spatialObject.marker.openPopup();
|
spatialObject.marker.openPopup();
|
||||||
getAlertsHistory(deviceType, deviceId, new Date($('#timeFrom').val()).getTime(), new Date($('#timeTo').val()).getTime());
|
getAlertsHistory(deviceType, deviceId, new Date($('#timeFromCal').val()).getTime(), new Date($('#timeToCal').val()).getTime());
|
||||||
spatialObject.drawPath();
|
spatialObject.drawPath();
|
||||||
if (speedGraphControl) {
|
if (speedGraphControl) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
$("#timeFrom").datepicker({
|
$("#timeFromCal").datepicker({
|
||||||
orientation: 'top'
|
orientation: 'top'
|
||||||
});
|
});
|
||||||
$("#timeTo").datepicker({
|
$("#timeToCal").datepicker({
|
||||||
orientation: 'top'
|
orientation: 'top'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -185,6 +185,9 @@ function setSpeedAlert() {
|
|||||||
if (speedAlertValue == null || speedAlertValue === undefined || speedAlertValue == "") {
|
if (speedAlertValue == null || speedAlertValue === undefined || speedAlertValue == "") {
|
||||||
var message = "Speed cannot be empty.";
|
var message = "Speed cannot be empty.";
|
||||||
noty({text: message, type : 'error' });
|
noty({text: message, type : 'error' });
|
||||||
|
} else if (areaName.indexOf(" ") > -1) {
|
||||||
|
var message = "Area Name cannot contain spaces.";
|
||||||
|
noty({text: message, type : 'error' });
|
||||||
} else {
|
} else {
|
||||||
data = {
|
data = {
|
||||||
'parseData': JSON.stringify({'speedAlertValue': speedAlertValue, 'deviceId': deviceId}), // parseKey : parseValue pair , this key pair is replace with the key in the template file
|
'parseData': JSON.stringify({'speedAlertValue': speedAlertValue, 'deviceId': deviceId}), // parseKey : parseValue pair , this key pair is replace with the key in the template file
|
||||||
@ -235,6 +238,9 @@ function setWithinAlert(leafletId) {
|
|||||||
if (areaName == null || areaName === undefined || areaName == "") {
|
if (areaName == null || areaName === undefined || areaName == "") {
|
||||||
var message = "Area Name cannot be empty.";
|
var message = "Area Name cannot be empty.";
|
||||||
noty({text: message, type : 'error' });
|
noty({text: message, type : 'error' });
|
||||||
|
} else if (areaName.indexOf(" ") > -1) {
|
||||||
|
var message = "Area Name cannot contain spaces.";
|
||||||
|
noty({text: message, type : 'error' });
|
||||||
} else {
|
} else {
|
||||||
var data = {
|
var data = {
|
||||||
'parseData': JSON.stringify({
|
'parseData': JSON.stringify({
|
||||||
@ -288,6 +294,9 @@ function setExitAlert(leafletId) {
|
|||||||
if (areaName == null || areaName === undefined || areaName == "") {
|
if (areaName == null || areaName === undefined || areaName == "") {
|
||||||
var message = "Area Name cannot be empty.";
|
var message = "Area Name cannot be empty.";
|
||||||
noty({text: message, type : 'error' });
|
noty({text: message, type : 'error' });
|
||||||
|
} else if (areaName.indexOf(" ") > -1) {
|
||||||
|
var message = "Area Name cannot contain spaces.";
|
||||||
|
noty({text: message, type : 'error' });
|
||||||
} else {
|
} else {
|
||||||
var data = {
|
var data = {
|
||||||
'parseData': JSON.stringify({
|
'parseData': JSON.stringify({
|
||||||
@ -348,6 +357,9 @@ function setStationeryAlert(leafletId) {
|
|||||||
if (stationeryName == null || stationeryName === undefined || stationeryName == "") {
|
if (stationeryName == null || stationeryName === undefined || stationeryName == "") {
|
||||||
var message = "Stationery Name cannot be empty.";
|
var message = "Stationery Name cannot be empty.";
|
||||||
noty({text: message, type : 'error' });
|
noty({text: message, type : 'error' });
|
||||||
|
} else if (stationeryName.indexOf(" ") > -1) {
|
||||||
|
var message = "Stationery Name cannot contain spaces.";
|
||||||
|
noty({text: message, type : 'error' });
|
||||||
} else if (fluctuationRadius == null || fluctuationRadius === undefined || fluctuationRadius == "") {
|
} else if (fluctuationRadius == null || fluctuationRadius === undefined || fluctuationRadius == "") {
|
||||||
var message = "Fluctuation Radius cannot be empty.";
|
var message = "Fluctuation Radius cannot be empty.";
|
||||||
noty({text: message, type : 'error' });
|
noty({text: message, type : 'error' });
|
||||||
@ -462,6 +474,9 @@ function setTrafficAlert(leafletId) {
|
|||||||
if (areaName == null || areaName === undefined || areaName == "") {
|
if (areaName == null || areaName === undefined || areaName == "") {
|
||||||
var message = "Area Name cannot be empty.";
|
var message = "Area Name cannot be empty.";
|
||||||
noty({text: message, type : 'error' });
|
noty({text: message, type : 'error' });
|
||||||
|
} else if (areaName.indexOf(" ") > -1) {
|
||||||
|
var message = "Area Name cannot contain spaces.";
|
||||||
|
noty({text: message, type : 'error' });
|
||||||
} else {
|
} else {
|
||||||
var data = {
|
var data = {
|
||||||
'parseData': JSON.stringify({
|
'parseData': JSON.stringify({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user