mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Adding date picker for the full history view.
This commit is contained in:
parent
0810928e0e
commit
8b7be8db38
File diff suppressed because one or more lines are too long
@ -69,6 +69,12 @@
|
|||||||
<!--TODO: use http://requirejs.org/ for better performance, now we have too many imports -->
|
<!--TODO: use http://requirejs.org/ for better performance, now we have too many imports -->
|
||||||
<!-- C3 chart library styles-->
|
<!-- C3 chart library styles-->
|
||||||
<link rel="stylesheet" href="css/d3/c3.css" type="text/css"/>
|
<link rel="stylesheet" href="css/d3/c3.css" type="text/css"/>
|
||||||
|
<link rel="stylesheet" href="css/bootstrap-datepicker.min.css" type="text/css"/>
|
||||||
|
<style>
|
||||||
|
.datepicker-inline {
|
||||||
|
margin:0 auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<!-- JAVASCRIPT -->
|
<!-- JAVASCRIPT -->
|
||||||
@ -85,7 +91,17 @@
|
|||||||
<script src="js/jquery/jquery-2.1.1.min.js"></script>
|
<script src="js/jquery/jquery-2.1.1.min.js"></script>
|
||||||
<script src="js/jquery/jquery-ui.min.js"></script>
|
<script src="js/jquery/jquery-ui.min.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||||
|
<script src="js/bootstrap-datepicker.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
$("#timeFrom").datepicker({
|
||||||
|
orientation: 'top'
|
||||||
|
});
|
||||||
|
$("#timeTo").datepicker({
|
||||||
|
orientation: 'top'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<!--bootstrap-application-wizard-->
|
<!--bootstrap-application-wizard-->
|
||||||
<script src="js/bootstrap-wizard-lib/bootstrap-wizard.js"></script>
|
<script src="js/bootstrap-wizard-lib/bootstrap-wizard.js"></script>
|
||||||
|
|
||||||
|
|||||||
@ -327,25 +327,31 @@ function notifyError(message) {
|
|||||||
function enableRealTime() {
|
function enableRealTime() {
|
||||||
document.getElementById('realTimeShow').style.display = 'none';
|
document.getElementById('realTimeShow').style.display = 'none';
|
||||||
spatialObject = currentSpatialObjects[selectedSpatialObject];
|
spatialObject = currentSpatialObjects[selectedSpatialObject];
|
||||||
spatialObject.removePath();
|
if (spatialObject) {
|
||||||
spatialObject.marker.closePopup();
|
spatialObject.removePath();
|
||||||
|
spatialObject.marker.closePopup();
|
||||||
|
}
|
||||||
selectedSpatialObject = null;
|
selectedSpatialObject = null;
|
||||||
clearFocus();
|
clearFocus();
|
||||||
clearMap();
|
clearMap();
|
||||||
document.getElementById('objectInfo').style.display = 'none';
|
document.getElementById('objectInfo').style.display = 'none';
|
||||||
isBatchModeOn = false;
|
isBatchModeOn = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
|
function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
|
||||||
if (!timeFrom) {
|
if (!timeFrom) {
|
||||||
notifyError('No start time provided to show history. Please provide a suitable value' + timeFrom);
|
notifyError('No start time provided to show history. Please provide a suitable value' + timeFrom);
|
||||||
} else if (!timeTo) {
|
} else if (!timeTo) {
|
||||||
notifyError('No end time provided to show history. Please provide a suitable value' + timeTo);
|
notifyError('No end time provided to show history. Please provide a suitable value' + timeTo);
|
||||||
} else {
|
} else {
|
||||||
|
$('#dateRangePopup').dialog('close');
|
||||||
document.getElementById('realTimeShow').style.display = 'block';
|
document.getElementById('realTimeShow').style.display = 'block';
|
||||||
isBatchModeOn = true;
|
isBatchModeOn = true;
|
||||||
clearFocus(); // Clear current focus if any
|
clearFocus(); // Clear current focus if any
|
||||||
clearMap();
|
clearMap();
|
||||||
var tableData = getProviderData(timeFrom, timeTo);
|
var fromDate = new Date(timeFrom);
|
||||||
|
var toDate = new Date(timeTo);
|
||||||
|
var tableData = getProviderData(fromDate.valueOf() / 1000, toDate.valueOf() / 1000);
|
||||||
for (var i = 0; i < tableData.length; i++) {
|
for (var i = 0; i < tableData.length; i++) {
|
||||||
var data = tableData[i];
|
var data = tableData[i];
|
||||||
var geoMessage = {
|
var geoMessage = {
|
||||||
@ -401,7 +407,6 @@ function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
|
|||||||
createChart();
|
createChart();
|
||||||
chart.load({columns: [spatialObject.speedHistory.getArray()]});
|
chart.load({columns: [spatialObject.speedHistory.getArray()]});
|
||||||
}, 100);
|
}, 100);
|
||||||
$('#dateRangePopup').dialog('close');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user