mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Prettified Code!
This commit is contained in:
parent
1377e93e69
commit
36f6e21679
|
@ -83,11 +83,10 @@ 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]["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);
|
||||||
|
|
||||||
|
@ -152,11 +151,10 @@ ipcRenderer.on("action-update-mesh-table", (event, arg) => {
|
||||||
destinationText.innerText = routes[i]["destination"];
|
destinationText.innerText = routes[i]["destination"];
|
||||||
// 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]["destination"]){
|
if (callsigns[call] == routes[i]["destination"]) {
|
||||||
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);
|
||||||
|
|
||||||
|
@ -165,10 +163,10 @@ ipcRenderer.on("action-update-mesh-table", (event, arg) => {
|
||||||
originText.innerText = routes[i]["origin"];
|
originText.innerText = routes[i]["origin"];
|
||||||
// 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]["origin"]){
|
if (callsigns[call] == routes[i]["origin"]) {
|
||||||
originText.innerHTML += `<span class="badge ms-2 bg-secondary">${call}</span>`;
|
originText.innerHTML += `<span class="badge ms-2 bg-secondary">${call}</span>`;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
origin.appendChild(originText);
|
origin.appendChild(originText);
|
||||||
|
@ -193,37 +191,33 @@ ipcRenderer.on("action-update-mesh-table", (event, arg) => {
|
||||||
//statusText.innerText = routes[i]["status"];
|
//statusText.innerText = routes[i]["status"];
|
||||||
switch (routes[i]["status"]) {
|
switch (routes[i]["status"]) {
|
||||||
case "acknowledged":
|
case "acknowledged":
|
||||||
var status_icon = '<i class="bi bi-check-circle-fill"></i>'
|
var status_icon = '<i class="bi bi-check-circle-fill"></i>';
|
||||||
var status_color = 'bg-success'
|
var status_color = "bg-success";
|
||||||
break;
|
break;
|
||||||
case "acknowledging":
|
case "acknowledging":
|
||||||
var status_icon = '<i class="bi bi-check-circle"></i>'
|
var status_icon = '<i class="bi bi-check-circle"></i>';
|
||||||
var status_color = 'bg-warning'
|
var status_color = "bg-warning";
|
||||||
break;
|
break;
|
||||||
case "forwarding":
|
case "forwarding":
|
||||||
var status_icon = '<i class="bi bi-arrow-left-right"></i>'
|
var status_icon = '<i class="bi bi-arrow-left-right"></i>';
|
||||||
var status_color = 'bg-secondary'
|
var status_color = "bg-secondary";
|
||||||
break;
|
break;
|
||||||
case "awaiting_ack":
|
case "awaiting_ack":
|
||||||
var status_icon = '<i class="bi bi-clock-history"></i>'
|
var status_icon = '<i class="bi bi-clock-history"></i>';
|
||||||
var status_color = 'bg-info'
|
var status_color = "bg-info";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
var status_icon = '<i class="bi bi-question-circle-fill"></i>'
|
var status_icon = '<i class="bi bi-question-circle-fill"></i>';
|
||||||
var status_color = 'bg-primary'
|
var status_color = "bg-primary";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
statusText.innerHTML = `
|
statusText.innerHTML = `
|
||||||
<span class="badge ${status_color}">${status_icon}</span>
|
<span class="badge ${status_color}">${status_icon}</span>
|
||||||
<span class="badge ${status_color}">${routes[i]["status"]}</span>
|
<span class="badge ${status_color}">${routes[i]["status"]}</span>
|
||||||
`
|
`;
|
||||||
status.appendChild(statusText);
|
status.appendChild(statusText);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
row.appendChild(timestamp);
|
row.appendChild(timestamp);
|
||||||
row.appendChild(destination);
|
row.appendChild(destination);
|
||||||
row.appendChild(origin);
|
row.appendChild(origin);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="../node_modules/bootstrap/dist/css/bootstrap.min.css"
|
href="../node_modules/bootstrap/dist/css/bootstrap.min.css"
|
||||||
/>
|
/>
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="../node_modules/bootstrap-icons/font/bootstrap-icons.css"
|
href="../node_modules/bootstrap-icons/font/bootstrap-icons.css"
|
||||||
/>
|
/>
|
||||||
|
@ -98,24 +98,26 @@
|
||||||
aria-labelledby="nav-signaling-tab"
|
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
|
||||||
<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">Destination</th>
|
<thead>
|
||||||
<th scope="col">Origin</th>
|
<tr>
|
||||||
<th scope="col">Frametype</th>
|
<th scope="col">Timestamp</th>
|
||||||
<th scope="col">Payload</th>
|
<th scope="col">Destination</th>
|
||||||
<th scope="col">Attempt</th>
|
<th scope="col">Origin</th>
|
||||||
<th scope="col">Status</th>
|
<th scope="col">Frametype</th>
|
||||||
</tr>
|
<th scope="col">Payload</th>
|
||||||
</thead>
|
<th scope="col">Attempt</th>
|
||||||
<tbody id="mesh-signalling-table"></tbody>
|
<th scope="col">Status</th>
|
||||||
</table>
|
</tr>
|
||||||
</div>
|
</thead>
|
||||||
</div>
|
<tbody id="mesh-signalling-table"></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="tab-pane fade"
|
class="tab-pane fade"
|
||||||
|
|
Loading…
Reference in a new issue