diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js index 5cca9bd3077..960f777d548 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js @@ -79,7 +79,7 @@ deviceModule = function () { 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 + '?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, function (backendResponse) { if (backendResponse.status === 200 && backendResponse.responseText) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs index 5df6319bd3b..9ebb1c1f279 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs @@ -531,9 +531,9 @@
- - - + + +
@@ -707,7 +707,7 @@ {{js "js/leaflet/Leaflet.fullscreen.min.js" }} {{js "js/leaflet/Marker.Rotate.js" }} {{js "js/leaflet/leaflet.draw.js" }} - {{js "js/jquery/jquery-ui.min.js" }} + {{!js "js/jquery/jquery-ui.min.js" }} {{js "js/firstTemp.js" }} @@ -749,6 +749,10 @@ 'Add Geofence Exit Alert', 'glyphicon glyphicon-log-out', geoToolsMenu); {{/if}} } + + $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { + $('#dateRangePopup').dialog('close'); + }) }); {{/zone}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js index dcc9a8c95a6..a87c01a49d5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js @@ -254,7 +254,7 @@ function focusOnSpatialObject(objectId) { // TODO: check the map._layersMaxZoom and set the zoom level accordingly 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(); if (speedGraphControl) { setTimeout(function () { @@ -504,7 +504,7 @@ function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) { // TODO: check the map._layersMaxZoom and set the zoom level accordingly 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(); if (speedGraphControl) { setTimeout(function () { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/firstTemp.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/firstTemp.js index d2430e4f488..73f567fe0aa 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/firstTemp.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/firstTemp.js @@ -1,8 +1,8 @@ $(function() { - $("#timeFrom").datepicker({ + $("#timeFromCal").datepicker({ orientation: 'top' }); - $("#timeTo").datepicker({ + $("#timeToCal").datepicker({ orientation: 'top' }); }); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js index e7c9df3f167..05f78606c57 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js @@ -185,6 +185,9 @@ function setSpeedAlert() { if (speedAlertValue == null || speedAlertValue === undefined || speedAlertValue == "") { var message = "Speed cannot be empty."; noty({text: message, type : 'error' }); + } else if (areaName.indexOf(" ") > -1) { + var message = "Area Name cannot contain spaces."; + noty({text: message, type : 'error' }); } else { data = { '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 == "") { var message = "Area Name cannot be empty."; noty({text: message, type : 'error' }); + } else if (areaName.indexOf(" ") > -1) { + var message = "Area Name cannot contain spaces."; + noty({text: message, type : 'error' }); } else { var data = { 'parseData': JSON.stringify({ @@ -288,6 +294,9 @@ function setExitAlert(leafletId) { if (areaName == null || areaName === undefined || areaName == "") { var message = "Area Name cannot be empty."; noty({text: message, type : 'error' }); + } else if (areaName.indexOf(" ") > -1) { + var message = "Area Name cannot contain spaces."; + noty({text: message, type : 'error' }); } else { var data = { 'parseData': JSON.stringify({ @@ -348,6 +357,9 @@ function setStationeryAlert(leafletId) { if (stationeryName == null || stationeryName === undefined || stationeryName == "") { var message = "Stationery Name cannot be empty."; 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 == "") { var message = "Fluctuation Radius cannot be empty."; noty({text: message, type : 'error' }); @@ -462,6 +474,9 @@ function setTrafficAlert(leafletId) { if (areaName == null || areaName === undefined || areaName == "") { var message = "Area Name cannot be empty."; noty({text: message, type : 'error' }); + } else if (areaName.indexOf(" ") > -1) { + var message = "Area Name cannot contain spaces."; + noty({text: message, type : 'error' }); } else { var data = { 'parseData': JSON.stringify({