Merge branch 'BirdNET-pi-main' into New-UI-API

This commit is contained in:
jaredb7
2023-05-17 20:04:19 +10:00
6 changed files with 16 additions and 8 deletions
+6 -3
View File
@@ -404,6 +404,7 @@ window.setInterval(function(){
</style>
<script>
function generateMiniGraph(elem, comname) {
// Make an AJAX call to fetch the number of detections for the bird species
var xhr = new XMLHttpRequest();
xhr.open('GET', '/todays_detections.php?comname=' + comname);
@@ -411,9 +412,10 @@ function generateMiniGraph(elem, comname) {
if (xhr.status === 200) {
var detections = JSON.parse(xhr.responseText);
console.log(detections)
// Create a div element for the chart window
if (typeof(window.chartWindow) != 'undefined') {
document.body.removeChild(window.chartWindow);
}
var chartWindow = document.createElement('div');
chartWindow.className = "chartdiv"
chartWindow.style.position = 'fixed';
@@ -524,6 +526,7 @@ function generateMiniGraph(elem, comname) {
document.body.removeChild(chartWindow);
});
chartWindow.appendChild(closeButton);
window.chartWindow = chartWindow;
}
};
xhr.send();
@@ -540,4 +543,4 @@ window.addEventListener('scroll', function() {
});
});
</script>
</script>