Add support for retrieving individual sonde data

pull/481/head
Luke Prior 2021-05-09 16:17:32 +10:00 zatwierdzone przez GitHub
rodzic 909c38139d
commit 80a8dbe330
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 40 dodań i 0 usunięć

Wyświetl plik

@ -70,6 +70,7 @@
var table = new Tabulator("#sonde-list-table", {
data:table_data, //load row data from array
layout:"fitColumns", //fit columns to width of table
selectable:true,
columns:[ //define the table columns
{title:"Type", field:"type", width:190, resizable:false},
{title:"Serial", field:"serial", width:105, resizable:false},
@ -88,6 +89,38 @@
}
]
});
//select row on "select all" button click
$("#select-all").click(function(){
table.selectRow();
});
//deselect row on "deselect all" button click
$("#deselect-all").click(function(){
table.deselectRow();
});
$("#showsonde-map").click(function(){
selectedrows = table.getSelectedData();
if (selectedrows.length > 0) {
var i;
for (i = 0; i < selectedrows.length; i++) {
console.log(selectedrows[i]['serial']);
$.ajax({
url: "/get_log_by_serial/" + selectedrows[i]['serial'],
dataType: 'json',
async: false,
success: function(data) {
console.log(data);
}
});
}
}
});
$("#showsonde-skew").click(function(){
//console.log(table.getSelectedData());
});
// List of available map layers.
var Mapnik = L.tileLayer.provider("OpenStreetMap.Mapnik", {edgeBufferTiles: 2});
@ -336,6 +369,13 @@
<a href="javascript:void(0)" class="closebtn" id="closebtn" onclick="changeNav()">&#10006;</a>
<img src="{{ url_for('static', filename='img/autorx_logo.png') }}" alt="Radiosonde Auto-RX Button">
<h2>Sonde List</h2>
<div style="width:100%;text-align:center;">
<button id="select-all" style="margin:0 auto">Select All</button>
<button id="deselect-all" style="margin:0 auto">Deselect All</button>
<button id="showsonde-map" style="margin:0 auto">Map</button>
<button id="showsonde-skew" style="margin:0 auto">Skew-T</button>
</div>
<br>
</div>
<div id="sonde-list-table"></div>
</div>