mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Merge branch 'main' into ls-mesh
This commit is contained in:
commit
8ddf3d259b
4 changed files with 100 additions and 57 deletions
39
gui/main.js
39
gui/main.js
|
@ -1,5 +1,5 @@
|
||||||
const { app, BrowserWindow, ipcMain, dialog, shell } = require("electron");
|
const { app, BrowserWindow, ipcMain, dialog, shell } = require("electron");
|
||||||
const https = require('https');
|
const https = require("https");
|
||||||
const { autoUpdater } = require("electron-updater");
|
const { autoUpdater } = require("electron-updater");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
@ -1050,31 +1050,30 @@ ipcMain.on("request-check-rigctld", (event, data) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function downloadJsonUrlToFile(url, callsignPath) {
|
function downloadJsonUrlToFile(url, callsignPath) {
|
||||||
// https://nodejs.org/api/https.html#httpsgetoptions-callback
|
// https://nodejs.org/api/https.html#httpsgetoptions-callback
|
||||||
|
|
||||||
https.get(url, (res) => {
|
https
|
||||||
console.log('statusCode:', res.statusCode);
|
.get(url, (res) => {
|
||||||
console.log('headers:', res.headers);
|
console.log("statusCode:", res.statusCode);
|
||||||
|
console.log("headers:", res.headers);
|
||||||
|
|
||||||
res.on('data', (d) => {
|
res.on("data", (d) => {
|
||||||
console.log(d);
|
console.log(d);
|
||||||
let json = JSON.parse(d);
|
let json = JSON.parse(d);
|
||||||
fs.writeFileSync(callsignPath, JSON.stringify(json, null, 2));
|
fs.writeFileSync(callsignPath, JSON.stringify(json, null, 2));
|
||||||
});
|
});
|
||||||
|
})
|
||||||
}).on('error', (e) => {
|
.on("error", (e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
function downloadCallsignReverseLookupData(){
|
function downloadCallsignReverseLookupData() {
|
||||||
var callsignPath = path.join(configFolder, "callsigns.json");
|
var callsignPath = path.join(configFolder, "callsigns.json");
|
||||||
downloadJsonUrlToFile('https://api.freedata.app/callsign_lookup.php', callsignPath)
|
downloadJsonUrlToFile(
|
||||||
|
"https://api.freedata.app/callsign_lookup.php",
|
||||||
|
callsignPath,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadCallsignReverseLookupData();
|
downloadCallsignReverseLookupData();
|
||||||
|
|
||||||
|
|
|
@ -3865,6 +3865,3 @@ function showOsPopUp(title, message) {
|
||||||
const NOTIFICATION_BODY = message;
|
const NOTIFICATION_BODY = message;
|
||||||
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY });
|
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ const config = require(configPath);
|
||||||
var callsignPath = path.join(configFolder, "callsigns.json");
|
var callsignPath = path.join(configFolder, "callsigns.json");
|
||||||
const callsigns = require(callsignPath);
|
const callsigns = require(callsignPath);
|
||||||
|
|
||||||
|
|
||||||
// WINDOW LISTENER
|
// WINDOW LISTENER
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
// startPing button clicked
|
// startPing button clicked
|
||||||
|
@ -71,23 +70,24 @@ ipcRenderer.on("action-update-mesh-table", (event, arg) => {
|
||||||
|
|
||||||
// check for callsign in callsign list, else use checksum
|
// check for callsign in callsign list, else use checksum
|
||||||
for (let call in callsigns) {
|
for (let call in callsigns) {
|
||||||
if(callsigns[call] == routes[i]["dxcall"]){
|
if (callsigns[call] == routes[i]["dxcall"]) {
|
||||||
dxcallText.innerText +=' (' + call + ')';
|
dxcallText.innerText += " (" + call + ")";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dxcall.appendChild(dxcallText);
|
dxcall.appendChild(dxcallText);
|
||||||
|
|
||||||
var router = document.createElement("td");
|
var router = document.createElement("td");
|
||||||
var routerText = document.createElement("span");
|
var routerText = document.createElement("span");
|
||||||
routerText.innerText = routes[i]["router"];
|
routerText.innerText = routes[i]["router"];
|
||||||
|
|
||||||
// check for callsign in callsign list, else use checksum
|
// check for callsign in callsign list, else use checksum
|
||||||
for (let call in callsigns) {
|
for (let call in callsigns) {
|
||||||
if(callsigns[call] == routes[i]["router"]){
|
if(callsigns[call] == routes[i]["router"]){
|
||||||
routerText.innerHTML += `<span class="badge ms-2 bg-secondary">${call}</span>`;
|
routerText.innerHTML += `<span class="badge ms-2 bg-secondary">${call}</span>`;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
router.appendChild(routerText);
|
router.appendChild(routerText);
|
||||||
|
|
||||||
|
@ -156,6 +156,7 @@ ipcRenderer.on("action-update-mesh-table", (event, arg) => {
|
||||||
destinationText.innerHTML += `<span class="badge ms-2 bg-secondary">${call}</span>`;
|
destinationText.innerHTML += `<span class="badge ms-2 bg-secondary">${call}</span>`;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
destination.appendChild(destinationText);
|
destination.appendChild(destinationText);
|
||||||
|
|
||||||
|
|
|
@ -25,34 +25,78 @@
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<div class="nav nav-tabs" id="nav-tab" role="tablist">
|
<div class="nav nav-tabs" id="nav-tab" role="tablist">
|
||||||
<button class="nav-link active" id="nav-route-tab" data-bs-toggle="tab" data-bs-target="#nav-route" type="button" role="tab" aria-controls="nav-route" aria-selected="true">Routes</button>
|
<button
|
||||||
<button class="nav-link" id="nav-signaling-tab" data-bs-toggle="tab" data-bs-target="#nav-signaling" type="button" role="tab" aria-controls="nav-signaling" aria-selected="false">Signaling</button>
|
class="nav-link active"
|
||||||
<button class="nav-link" id="nav-actions-tab" data-bs-toggle="tab" data-bs-target="#nav-actions" type="button" role="tab" aria-controls="nav-actions" aria-selected="false">Actions</button>
|
id="nav-route-tab"
|
||||||
|
data-bs-toggle="tab"
|
||||||
|
data-bs-target="#nav-route"
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-controls="nav-route"
|
||||||
|
aria-selected="true"
|
||||||
|
>
|
||||||
|
Routes
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="nav-link"
|
||||||
|
id="nav-signaling-tab"
|
||||||
|
data-bs-toggle="tab"
|
||||||
|
data-bs-target="#nav-signaling"
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-controls="nav-signaling"
|
||||||
|
aria-selected="false"
|
||||||
|
>
|
||||||
|
Signaling
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="nav-link"
|
||||||
|
id="nav-actions-tab"
|
||||||
|
data-bs-toggle="tab"
|
||||||
|
data-bs-target="#nav-actions"
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-controls="nav-actions"
|
||||||
|
aria-selected="false"
|
||||||
|
>
|
||||||
|
Actions
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="tab-content" id="nav-tabContent">
|
<div class="tab-content" id="nav-tabContent">
|
||||||
|
<div
|
||||||
<div class="tab-pane fade show active vw-100 vh-90 overflow-auto" id="nav-route" role="tabpanel" aria-labelledby="nav-route-tab">
|
class="tab-pane fade show active vw-100 vh-90 overflow-auto"
|
||||||
|
id="nav-route"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="nav-route-tab"
|
||||||
|
>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="table-responsive overflow-auto" style="max-width: 99vw;max-height: 99vh;">
|
<div
|
||||||
<table class="table table-hover table-sm">
|
class="table-responsive overflow-auto"
|
||||||
<thead>
|
style="max-width: 99vw; max-height: 99vh"
|
||||||
<tr>
|
>
|
||||||
<th scope="col">Timestamp</th>
|
<table class="table table-hover table-sm">
|
||||||
<th scope="col">DXCall</th>
|
<thead>
|
||||||
<th scope="col">Router</th>
|
<tr>
|
||||||
<th scope="col">Hops</th>
|
<th scope="col">Timestamp</th>
|
||||||
<th scope="col">Score</th>
|
<th scope="col">DXCall</th>
|
||||||
<th scope="col">SNR</th>
|
<th scope="col">Router</th>
|
||||||
</tr>
|
<th scope="col">Hops</th>
|
||||||
</thead>
|
<th scope="col">Score</th>
|
||||||
<tbody id="mesh-table">
|
<th scope="col">SNR</th>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
</thead>
|
||||||
</div>
|
<tbody id="mesh-table"></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div
|
||||||
<div class="tab-pane fade" id="nav-signaling" role="tabpanel" aria-labelledby="nav-signaling-tab">
|
class="tab-pane fade"
|
||||||
|
id="nav-signaling"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="nav-signaling-tab"
|
||||||
|
>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="table-responsive overflow-auto" style="max-width: 99vw;max-height: 99vh;">
|
<div class="table-responsive overflow-auto" style="max-width: 99vw;max-height: 99vh;">
|
||||||
<table class="table table-hover table-sm">
|
<table class="table table-hover table-sm">
|
||||||
|
@ -71,8 +115,14 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="nav-actions" role="tabpanel" aria-labelledby="nav-actions-tab">
|
<div
|
||||||
|
class="tab-pane fade"
|
||||||
|
id="nav-actions"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="nav-actions-tab"
|
||||||
|
>
|
||||||
<div class="input-group mt-1">
|
<div class="input-group mt-1">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -91,9 +141,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue