1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 12:25:13 +03:00

Firmware flasher, BLE, TCP, UDP -> Electron

This commit is contained in:
Andi Kanzler 2024-02-16 20:55:36 -03:00
parent 2f880e218d
commit 7df8253099
36 changed files with 733 additions and 656 deletions

View file

@ -0,0 +1,22 @@
document.addEventListener("DOMContentLoaded", () => {
window.electronAPI.bleScan(data => {
data.forEach(device => {
var dev = document.getElementById(device.deviceId)
if (dev) {
dev.parentElement.removeChild(dev);
}
var item = document.createElement('div');
item.className = 'item'
item.id = device.deviceId;
item.addEventListener('click', () => {
window.electronAPI.deviceSelected(item.id);
window.close();
});
item.appendChild(document.createTextNode(device.deviceName + ' (' + device.deviceId + ')'));
document.getElementById('list').prepend(item);
});
});
document.getElementById('cancel').addEventListener('click', () => {
window.close();
});
});