Files

43 lines
1.3 KiB
JavaScript

// Reflector Dashboard — web front-end for SvxReflector
// Copyright (C) 2026 SA7AUX (Björn)
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version. See the LICENSE file for details.
'use strict';
function renderList(nodes){
const tbody = document.getElementById('rows');
if(!tbody) return;
tbody.innerHTML = "";
const calls = Object.keys(nodes || {}).sort();
for(const cs of calls){
const n = nodes[cs] || {};
const tr = document.createElement('tr');
const tdCS = document.createElement('td');
tdCS.textContent = cs;
const tdTG = document.createElement('td');
tdTG.textContent = (n.restrictedTG ? "*" : "") + (n.tg ?? "");
const tdLoc = document.createElement('td');
let loc = "";
if(Array.isArray(n.qth) && n.qth.length && n.qth[0].name) loc = n.qth[0].name;
tdLoc.textContent = loc;
tr.appendChild(tdCS);
tr.appendChild(tdTG);
tr.appendChild(tdLoc);
tbody.appendChild(tr);
}
document.getElementById('nodeCount').textContent = calls.length;
}