mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #857 from rasika/geo-fence-issues
Avoid calling geo service when geoFencing disabled
This commit is contained in:
commit
8934dc2055
@ -73,11 +73,13 @@ deviceModule = function () {
|
||||
}
|
||||
var userName = carbonUser.username + "@" + carbonUser.domain;
|
||||
var locationHistory = [];
|
||||
var geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled;
|
||||
if (geoServicesEnabled) {
|
||||
try {
|
||||
var fromDate = new Date();
|
||||
fromDate.setHours(fromDate.getHours() - 2);
|
||||
var toDate = new Date();
|
||||
var serviceUrl = devicemgtProps["httpsURL"] + '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId;
|
||||
var serviceUrl = devicemgtProps["httpsURL"] + '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + fromDate + '&to=' + toDate;
|
||||
serviceInvokers.XMLHttp.get(serviceUrl,
|
||||
function (backendResponse) {
|
||||
if (backendResponse.status === 200 && backendResponse.responseText) {
|
||||
@ -87,6 +89,7 @@ deviceModule = function () {
|
||||
} catch (e) {
|
||||
log.error(e.message, e);
|
||||
}
|
||||
}
|
||||
|
||||
var locationInfo = {};
|
||||
try {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user