-
${esc(call)}
-
ID: ${c.id.toUpperCase()} | ${isOnline ? 'ONLINE' : 'OFFLINE'}
+
+
${esc(call)}
+
ID: ${c.id.toUpperCase()} | ${isOnline ? 'ONLINE' : 'OFFLINE'}
${warnsHtml}
-
๐ ${esc(info.loc)}
-
TX: ${esc(info.tx)}
-
RX: ${esc(info.rx)}
- ${health ? `
๐ก๏ธ Temp: ${health.temp}ยฐC | CPU: ${health.cpu}%
` : ''}
-
+
LOC: ${esc(info.loc)}
+
TX: ${esc(info.tx)}
+
RX: ${esc(info.rx)}
+ ${health ? `
TMP: ${health.temp}ยฐC | CPU: ${health.cpu}%
` : ''}
+
`;
@@ -442,7 +435,7 @@ async function refreshStates() {
if (diagDiv) {
if (warns.length > 0 && isOnline) {
diagDiv.style.display = 'block';
- diagDiv.innerHTML = warns.map(w => `
${esc(w)}
`).join('');
+ diagDiv.innerHTML = warns.map(w => `
[!] ${esc(w)}
`).join('');
} else {
diagDiv.style.display = 'none';
diagDiv.innerHTML = '';
@@ -455,19 +448,16 @@ async function refreshStates() {
const typeBadge = document.getElementById(`type-badge-${c.id}`);
if (genObj && isOnline) {
- nameSpan.innerText = genObj.callsign;
- idBadge.innerText = `ID: ${genObj.radio_id}`;
- idBadge.style.background = "var(--primary)"; idBadge.style.color = "#ffffff"; idBadge.style.borderColor = "var(--primary)";
-
+ nameSpan.innerHTML = `${esc(genObj.callsign)}`;
+ idBadge.innerText = `NET-ID: ${genObj.radio_id}`;
if (typeBadge && genObj.duplex !== undefined) {
typeBadge.style.display = 'inline-block';
- if (genObj.duplex === "1") { typeBadge.innerText = "REPEATER"; typeBadge.className = "type-badge type-repeater"; }
- else { typeBadge.innerText = "HOTSPOT"; typeBadge.className = "type-badge type-hotspot"; }
+ if (genObj.duplex === "1") { typeBadge.innerText = "RPT"; typeBadge.className = "type-badge type-repeater"; }
+ else { typeBadge.innerText = "HST"; typeBadge.className = "type-badge type-hotspot"; }
}
} else {
- nameSpan.innerText = c.name;
- idBadge.innerText = `ID: ${c.id.toUpperCase()}`;
- idBadge.style.background = "rgba(255,255,255,0.1)"; idBadge.style.color = "var(--text-muted)"; idBadge.style.borderColor = "var(--border-color)";
+ nameSpan.innerHTML = `${esc(c.name)}`;
+ idBadge.innerText = `NET-ID: ${c.id.toUpperCase()}`;
if (typeBadge) typeBadge.style.display = 'none';
}
@@ -475,18 +465,16 @@ async function refreshStates() {
if (typeof telemetryObj === 'string') telemetryObj = { ts1: telemetryObj, ts2: "...", alt: "", idle: true };
const tsContainer = document.getElementById(`ts-container-${c.id}`); const ts1Div = document.getElementById(`dmr-ts1-${c.id}`); const ts2Div = document.getElementById(`dmr-ts2-${c.id}`); const altDiv = document.getElementById(`dmr-alt-${c.id}`);
-
let isTx = false; let activeModeColor = "var(--success)"; let isIdle = telemetryObj.idle === true;
if (telemetryObj.alt && telemetryObj.alt !== "") {
if (tsContainer) tsContainer.style.display = "none";
if (altDiv) {
altDiv.style.display = "block"; altDiv.innerText = telemetryObj.alt; let altText = telemetryObj.alt.toUpperCase();
-
- if (altText.includes("NXDN")) activeModeColor = "#10b981"; else if (altText.includes("YSF")) activeModeColor = "#8b5cf6"; else if (altText.includes("D-STAR")) activeModeColor = "#06b6d4"; else if (altText.includes("P25")) activeModeColor = "#f59e0b";
+ if (altText.includes("NXDN")) activeModeColor = "var(--success)"; else if (altText.includes("YSF")) activeModeColor = "var(--primary)"; else if (altText.includes("D-STAR")) activeModeColor = "var(--primary)"; else if (altText.includes("P25")) activeModeColor = "var(--accent)";
isTx = altText.includes("๐ข") || altText.includes("๐ฃ") || altText.includes("๐ต") || altText.includes("๐ ");
- altDiv.style.setProperty('--pulse-color', activeModeColor);
- if (isTx) { altDiv.classList.add('tx-active-unified'); } else { altDiv.classList.remove('tx-active-unified'); altDiv.style.setProperty('color', 'var(--text-muted)', 'important'); altDiv.style.setProperty('border-left', `4px solid var(--border-color)`, 'important'); }
+ if (isTx) { altDiv.style.color = activeModeColor; altDiv.style.borderColor = activeModeColor; }
+ else { altDiv.style.color = "var(--text-muted)"; altDiv.style.borderColor = "var(--border-light)"; }
}
} else {
if (altDiv) altDiv.style.display = "none";
@@ -498,11 +486,9 @@ async function refreshStates() {
[ts1Div, ts2Div].forEach((div, idx) => {
if (isSimplex && idx === 0) return;
const val = String((idx === 0 ? telemetryObj.ts1 : telemetryObj.ts2) ?? '');
- const fullLabel = `TS${idx + 1}`;
- div.innerText = `${fullLabel}: ${val}`;
- div.style.setProperty('--pulse-color', activeModeColor);
- if (val.includes("๐๏ธ")) { isTx = true; div.classList.add('tx-active-unified'); }
- else { div.classList.remove('tx-active-unified'); div.style.setProperty('color', 'var(--text-muted)', 'important'); div.style.setProperty('border-left', '4px solid var(--border-color)', 'important'); }
+ div.innerText = `TS${idx + 1}: ${val}`;
+ if (val.includes("๐๏ธ") || val.includes("TX")) { isTx = true; div.style.color = activeModeColor; div.style.borderColor = activeModeColor; }
+ else { div.style.color = "var(--text-muted)"; div.style.borderColor = "var(--border-light)"; }
});
}
}
@@ -530,90 +516,39 @@ async function refreshStates() {
}
const healthContainer = document.getElementById(`health-${c.id}`); const cpuSpan = document.getElementById(`cpu-${c.id}`); const tempSpan = document.getElementById(`temp-${c.id}`); const ramSpan = document.getElementById(`ram-${c.id}`); const diskSpan = document.getElementById(`disk-${c.id}`);
-
const gwBar = document.getElementById(`gw-bar-${c.id}`);
if (gwBar && healthObj) {
- let gwHtml = "";
- let gwData = data.gateway_states && data.gateway_states[c.id.toLowerCase()] ? data.gateway_states[c.id.toLowerCase()] : {};
- let processes = healthObj.processes || {};
- let activeGatewaysStr = "";
-
- const gwMap = [
- { id: 'dmrgateway', label: 'DMR', color: '#3b82f6', tint: 'rgba(59, 130, 246, 0.15)', proto: 'DMR' },
- { id: 'ysfgateway', label: 'YSF', color: '#8b5cf6', tint: 'rgba(139, 92, 246, 0.15)', proto: 'YSF' },
- { id: 'dstargateway', label: 'D-STAR', color: '#06b6d4', tint: 'rgba(6, 182, 212, 0.15)', proto: 'D-STAR' },
- { id: 'nxdngateway', label: 'NXDN', color: '#10b981', tint: 'rgba(16, 185, 129, 0.15)', proto: 'NXDN' },
- { id: 'p25gateway', label: 'P25', color: '#f59e0b', tint: 'rgba(245, 158, 11, 0.15)', proto: 'P25' }
- ];
+ let gwHtml = ""; let gwData = data.gateway_states && data.gateway_states[c.id.toLowerCase()] ? data.gateway_states[c.id.toLowerCase()] : {}; let processes = healthObj.processes || {}; let activeGatewaysStr = "";
+ const gwMap = [{ id: 'dmrgateway', label: 'DMR', color: 'var(--primary)', proto: 'DMR' }, { id: 'ysfgateway', label: 'YSF', color: '#8b5cf6', proto: 'YSF' }, { id: 'dstargateway', label: 'D-STAR', color: 'var(--primary)', proto: 'D-STAR' }, { id: 'nxdngateway', label: 'NXDN', color: 'var(--success)', proto: 'NXDN' }, { id: 'p25gateway', label: 'P25', color: 'var(--accent)', proto: 'P25' }];
if (isOnline) {
gwMap.forEach(gw => {
let isActiveProc = processes[gw.id] && processes[gw.id].toLowerCase() === 'online';
if (isActiveProc) {
activeGatewaysStr += gw.proto.toLowerCase() + ",";
- let stateInfo = gwData[gw.proto] || { action: 'IDLE', dest: '---' };
- let action = (stateInfo.action || 'IDLE').toLowerCase();
- let dest = stateInfo.dest && stateInfo.dest !== '---' && stateInfo.dest.toUpperCase() !== 'IDLE' ? stateInfo.dest : '';
+ let stateInfo = gwData[gw.proto] || { action: 'IDLE', dest: '---' }; let action = (stateInfo.action || 'IDLE').toLowerCase(); let dest = stateInfo.dest && stateInfo.dest !== '---' && stateInfo.dest.toUpperCase() !== 'IDLE' ? stateInfo.dest : '';
+ let badgeColor, badgeBorder, suffix = '';
- let badgeBg, badgeColor, badgeBorder, suffix = '', extraClass = '';
-
- if (action === 'linking') {
- badgeBg = gw.color;
- badgeColor = 'white';
- badgeBorder = gw.color;
- suffix = dest ? `: ${dest} [LINKING]` : ` [LINKING]`;
- } else if (action === 'linked' || (dest !== '' && action !== 'unlinked' && action !== 'failed' && action !== 'status')) {
- badgeBg = gw.color;
- badgeColor = 'white';
- badgeBorder = gw.color;
- if (dest) suffix = `: ${dest}`;
- } else if (action === 'failed') {
- badgeBg = 'rgba(239, 68, 68, 0.25)';
- badgeColor = '#fca5a5';
- badgeBorder = 'var(--danger)';
- suffix = ' [FAILED]';
- extraClass = 'blink';
- } else if (action === 'unlinked') {
- badgeBg = 'transparent';
- badgeColor = 'var(--text-muted)';
- badgeBorder = 'var(--border-color)';
- suffix = ' [UNLINKED]';
- } else {
- badgeBg = gw.tint;
- badgeColor = gw.color;
- badgeBorder = gw.color;
- }
+ if (action === 'linking') { badgeColor = gw.color; badgeBorder = gw.color; suffix = dest ? `: ${dest} [LNK]` : ` [LNK]`; }
+ else if (action === 'linked' || (dest !== '' && action !== 'unlinked' && action !== 'failed' && action !== 'status')) { badgeColor = '#fff'; badgeBorder = gw.color; if (dest) suffix = `:${dest}`; }
+ else if (action === 'failed') { badgeColor = 'var(--danger)'; badgeBorder = 'var(--danger)'; suffix = ' [ERR]'; }
+ else if (action === 'unlinked') { badgeColor = 'var(--text-muted)'; badgeBorder = 'var(--border-light)'; suffix = ' [UNL]'; }
+ else { badgeColor = gw.color; badgeBorder = gw.color; }
if (gw.proto === 'DMR' && gwData['DMR_NETS'] && gwData['DMR_NETS'].length > 0) {
- gwData['DMR_NETS'].forEach(netName => {
- let netSuffix = (action === 'linking') ? ' [LINKING]' : (action === 'failed' ? ' [FAILED]' : (dest && action !== 'status' ? `: ${dest}` : ''));
- let netText = `DMR: ${esc(netName)}${esc(netSuffix)}`;
- gwHtml += ``;
- });
- } else {
- let text = `${gw.label}${esc(suffix)}`;
- gwHtml += ``;
- }
+ gwData['DMR_NETS'].forEach(netName => { let netSuffix = (action === 'linking') ? ' [LNK]' : (action === 'failed' ? ' [ERR]' : (dest && action !== 'status' ? `:${dest}` : '')); gwHtml += `
DMR:${esc(netName)}${esc(netSuffix)}`; });
+ } else { gwHtml += `
${gw.label}${esc(suffix)}`; }
}
});
}
- cardDiv.dataset.gateways = activeGatewaysStr;
- gwBar.innerHTML = gwHtml;
- } else if (gwBar) {
- gwBar.innerHTML = "";
- cardDiv.dataset.gateways = "";
- }
+ cardDiv.dataset.gateways = activeGatewaysStr; gwBar.innerHTML = gwHtml;
+ } else if (gwBar) { gwBar.innerHTML = ""; cardDiv.dataset.gateways = ""; }
if (healthObj && isOnline) {
- healthContainer.style.display = 'flex';
- let cpu = healthObj.cpu; cpuSpan.innerText = cpu; cpuSpan.style.color = cpu < 50 ? 'var(--success)' : (cpu < 80 ? '#f59e0b' : 'var(--danger)');
- let tempVal = healthObj.temp; tempSpan.innerText = tempVal; tempSpan.style.color = tempVal < 55 ? 'var(--success)' : (tempVal < 70 ? '#f59e0b' : 'var(--danger)');
- ramSpan.innerText = healthObj.ram; let d = healthObj.disk; diskSpan.innerText = d; diskSpan.style.color = d < 85 ? 'inherit' : (d < 95 ? '#f59e0b' : 'var(--danger)');
-
- let upSpan = document.getElementById(`up-${c.id}`);
- if (upSpan && healthObj.uptime) { upSpan.innerText = fmtAge(healthObj.uptime); }
- let agentBadge = document.getElementById(`agent-badge-${c.id}`);
- if (agentBadge && healthObj.agent_version) { agentBadge.innerText = `Agent v${healthObj.agent_version}`; agentBadge.style.display = 'inline-block'; }
+ healthContainer.style.display = 'grid';
+ cpuSpan.innerText = healthObj.cpu; tempSpan.innerText = healthObj.temp; ramSpan.innerText = healthObj.ram; diskSpan.innerText = healthObj.disk;
+ let upSpan = document.getElementById(`up-${c.id}`); if (upSpan && healthObj.uptime) { upSpan.innerText = fmtAge(healthObj.uptime); }
+ let agentBadge = document.getElementById(`agent-badge-${c.id}`); if (agentBadge && healthObj.agent_version) { agentBadge.innerText = `AGT:v${healthObj.agent_version}`; agentBadge.style.display = 'inline-block'; }
const profBtnsDiv = document.getElementById(`prof-btns-${c.id}`);
const profKeys = JSON.stringify(healthObj.profiles || {});
@@ -621,10 +556,10 @@ async function refreshStates() {
profBtnsDiv.dataset.keys = profKeys;
if (healthObj.profiles && Object.keys(healthObj.profiles).length > 0) {
profBtnsDiv.style.display = 'flex';
- let html = ''; const colors = ["var(--accent)", "#eab308", "var(--success)", "var(--primary)"]; let idx = 0;
+ let html = ''; const colors = ["var(--accent)", "var(--success)", "var(--primary)"]; let idx = 0;
for (const [pKey, pLabel] of Object.entries(healthObj.profiles)) {
let col = colors[idx % colors.length];
- html += `
`;
+ html += `
`;
idx++;
}
profBtnsDiv.innerHTML = html;
@@ -632,144 +567,71 @@ async function refreshStates() {
}
} else {
if (healthContainer) healthContainer.style.display = 'none';
- let agentBadge = document.getElementById(`agent-badge-${c.id}`);
- if (agentBadge) agentBadge.style.display = 'none';
+ let agentBadge = document.getElementById(`agent-badge-${c.id}`); if (agentBadge) agentBadge.style.display = 'none';
}
globalHealthData[c.id.toLowerCase()] = healthObj;
let hasOfflineService = false;
- if (healthObj && healthObj.processes) {
- for (const [svcName, svcStatus] of Object.entries(healthObj.processes)) { if (svcStatus.toLowerCase() !== 'online') { hasOfflineService = true; break; } }
- }
+ if (healthObj && healthObj.processes) { for (const [svcName, svcStatus] of Object.entries(healthObj.processes)) { if (svcStatus.toLowerCase() !== 'online') { hasOfflineService = true; break; } } }
const warnBadge = document.getElementById(`svc-warn-${c.id}`); const btnSvc = document.getElementById(`btn-svc-${c.id}`);
-
if (warnBadge) warnBadge.style.display = hasOfflineService ? 'block' : 'none';
- if (btnSvc) {
- if (hasOfflineService) { btnSvc.style.background = 'var(--danger)'; btnSvc.classList.add('blink'); btnSvc.innerHTML = t('btnSvcKo'); }
- else { btnSvc.style.background = '#334155'; btnSvc.classList.remove('blink'); btnSvc.innerHTML = t('btnSvc'); }
- }
+ if (btnSvc) { if (hasOfflineService) { btnSvc.style.borderColor = 'var(--danger)'; btnSvc.style.color = 'var(--danger)'; } else { btnSvc.style.borderColor = 'var(--text-main)'; btnSvc.style.color = 'var(--text-main)'; } }
- let btnOta = document.getElementById(`btn-ota-${c.id}`);
- let adminSummary = document.getElementById(`admin-summary-${c.id}`);
-
+ let btnOta = document.getElementById(`btn-ota-${c.id}`); let adminSummary = document.getElementById(`admin-summary-${c.id}`);
if (btnOta) {
if (healthObj && healthObj.agent_update_available) {
- btnOta.style.setProperty('background', 'var(--danger)', 'important');
- btnOta.style.setProperty('color', 'white', 'important');
- btnOta.style.setProperty('border', '1px solid var(--danger)', 'important');
- btnOta.style.animation = 'danger-glow 1.5s infinite';
-
- if (adminSummary) {
- adminSummary.innerHTML = "โ ๏ธ ADMIN (UPDATE OTA!)";
- adminSummary.style.setProperty('color', 'var(--danger)', 'important');
- adminSummary.style.setProperty('border-color', 'var(--danger)', 'important');
- adminSummary.style.animation = 'danger-glow 1.5s infinite';
- }
+ btnOta.style.setProperty('border-color', 'var(--danger)', 'important');
+ btnOta.style.setProperty('color', 'var(--danger)', 'important');
+ if (adminSummary) { adminSummary.innerHTML = "[ SYS_TOOLS (OTA!) ]"; adminSummary.style.color = "var(--danger)"; adminSummary.style.borderColor = "var(--danger)"; }
} else {
- btnOta.style.setProperty('background', '#2563eb', 'important');
- btnOta.style.setProperty('color', 'white', 'important');
- btnOta.style.setProperty('border', '1px solid transparent', 'important');
- btnOta.style.animation = 'none';
-
- if (adminSummary) {
- adminSummary.innerHTML = "โ๏ธ Admin Tools";
- adminSummary.style.setProperty('color', 'var(--text-muted)', 'important');
- adminSummary.style.setProperty('border-color', 'var(--border-color)', 'important');
- adminSummary.style.animation = 'none';
- }
+ btnOta.style.setProperty('border-color', 'var(--primary)', 'important');
+ btnOta.style.setProperty('color', 'var(--primary)', 'important');
+ if (adminSummary) { adminSummary.innerHTML = "[ SYS_TOOLS ]"; adminSummary.style.color = "var(--text-muted)"; adminSummary.style.borderColor = "var(--border-main)"; }
}
}
if (isOnline) {
- cardDiv.classList.add('online'); statusDiv.classList.remove('status-offline'); cardDiv.style.opacity = "1"; cardDiv.style.filter = "none";
+ cardDiv.classList.add('online'); statusDiv.classList.remove('status-offline');
if (isTx) cardDiv.dataset.lastTx = Date.now();
let timeSinceTx = Date.now() - (parseInt(cardDiv.dataset.lastTx) || 0);
let showActiveColor = isTx || (!isIdle && timeSinceTx < HANG_TIME_MS);
- cardDiv.style.setProperty('border-top-color', showActiveColor ? activeModeColor : "var(--border-color)", 'important');
- if(isTx) {
- let shadowRGB = '59, 130, 246';
- if (activeModeColor === '#10b981') shadowRGB = '16, 185, 129'; else if (activeModeColor === '#8b5cf6') shadowRGB = '139, 92, 246'; else if (activeModeColor === '#06b6d4') shadowRGB = '6, 182, 212'; else if (activeModeColor === '#f59e0b') shadowRGB = '245, 158, 11';
- cardDiv.style.boxShadow = `0 0 20px rgba(${shadowRGB}, 0.5) !important`;
- } else { cardDiv.style.boxShadow = '0 4px 12px rgba(0,0,0,0.2) !important'; }
+
+ if (showActiveColor) { cardDiv.style.borderColor = activeModeColor; }
+ else { cardDiv.style.borderColor = "var(--border-main)"; }
} else {
- cardDiv.classList.remove('online'); statusDiv.classList.add('status-offline'); cardDiv.style.opacity = "0.7"; cardDiv.style.filter = "grayscale(80%)";
- cardDiv.style.setProperty('border-top-color', '#64748b', 'important'); cardDiv.style.boxShadow = 'none !important';
+ cardDiv.classList.remove('online'); statusDiv.classList.add('status-offline');
+ cardDiv.style.borderColor = "var(--border-light)";
}
- const miniCard = document.getElementById(`mini-card-${c.id}`);
- const miniStatus = document.getElementById(`mini-status-${c.id}`);
- const miniName = document.getElementById(`mini-name-${c.id}`);
- const miniId = document.getElementById(`mini-id-${c.id}`);
-
+ const miniCard = document.getElementById(`mini-card-${c.id}`); const miniStatus = document.getElementById(`mini-status-${c.id}`); const miniName = document.getElementById(`mini-name-${c.id}`); const miniId = document.getElementById(`mini-id-${c.id}`);
if (miniCard && miniStatus) {
- if (genObj && isOnline) {
- if (miniName) miniName.innerText = genObj.callsign;
- if (miniId) miniId.innerText = `ID: ${genObj.radio_id}`;
- }
- else {
- if (miniName) miniName.innerText = c.name;
- if (miniId) miniId.innerText = `ID: ${c.id.toUpperCase()}`;
- }
+ if (genObj && isOnline) { if (miniName) miniName.innerText = genObj.callsign; if (miniId) miniId.innerText = `ID:${genObj.radio_id}`; }
+ else { if (miniName) miniName.innerText = c.name; if (miniId) miniId.innerText = `ID:${c.id.toUpperCase()}`; }
if (isOnline) {
let timeSinceTx = Date.now() - (parseInt(cardDiv.dataset.lastTx) || 0);
let showActiveColor = isTx || (!isIdle && timeSinceTx < HANG_TIME_MS);
-
- miniCard.style.opacity = "1";
- miniCard.style.filter = "none";
-
if (showActiveColor) {
- let shadowRGB = '59, 130, 246';
- if (activeModeColor === '#10b981') shadowRGB = '16, 185, 129';
- else if (activeModeColor === '#8b5cf6') shadowRGB = '139, 92, 246';
- else if (activeModeColor === '#06b6d4') shadowRGB = '6, 182, 212';
- else if (activeModeColor === '#f59e0b') shadowRGB = '245, 158, 11';
-
miniCard.style.borderColor = activeModeColor;
- miniCard.style.boxShadow = `0 0 15px rgba(${shadowRGB}, 0.5)`;
- miniStatus.innerText = "๐๏ธ TX";
- miniStatus.title = "Transmitting...";
- miniStatus.style.color = "#ffffff";
- miniStatus.style.background = activeModeColor;
- miniStatus.style.borderColor = activeModeColor;
- }
- else if (warns.length > 0) {
- miniCard.style.borderColor = "#f59e0b";
- miniCard.style.boxShadow = "none";
- miniStatus.innerText = "โ ๏ธ ALERT";
- miniStatus.title = warns.join(" | ");
- miniStatus.style.color = "#f59e0b";
- miniStatus.style.background = "rgba(245, 158, 11, 0.15)";
- miniStatus.style.borderColor = "rgba(245, 158, 11, 0.4)";
+ miniStatus.innerText = "( TX )"; miniStatus.title = "Transmitting..."; miniStatus.style.color = activeModeColor; miniStatus.style.borderColor = activeModeColor;
+ } else if (warns.length > 0) {
+ miniCard.style.borderColor = "var(--accent)";
+ miniStatus.innerText = "(!) ALERT"; miniStatus.title = warns.join(" | "); miniStatus.style.color = "var(--accent)"; miniStatus.style.borderColor = "var(--accent)";
} else {
- miniCard.style.borderColor = "var(--success)";
- miniCard.style.boxShadow = "none";
- miniStatus.innerText = stateValue;
- miniStatus.title = stateValue;
- miniStatus.style.color = "var(--success)";
- miniStatus.style.background = "rgba(16, 185, 129, 0.1)";
- miniStatus.style.borderColor = "rgba(16, 185, 129, 0.2)";
+ miniCard.style.borderColor = "var(--border-main)";
+ miniStatus.innerText = stateValue; miniStatus.title = stateValue; miniStatus.style.color = "var(--success)"; miniStatus.style.borderColor = "var(--border-light)";
}
} else {
- miniCard.style.borderColor = "var(--border-color)";
- miniCard.style.opacity = "0.6";
- miniCard.style.filter = "grayscale(80%)";
- miniCard.style.boxShadow = "none";
- miniStatus.innerText = "OFFLINE";
- miniStatus.title = "OFFLINE";
- miniStatus.style.color = "var(--danger)";
- miniStatus.style.background = "rgba(239, 68, 68, 0.1)";
- miniStatus.style.borderColor = "rgba(239, 68, 68, 0.2)";
+ miniCard.style.borderColor = "var(--border-light)";
+ miniStatus.innerText = "OFFLINE"; miniStatus.title = "OFFLINE"; miniStatus.style.color = "var(--danger)"; miniStatus.style.borderColor = "var(--border-light)";
}
}
});
applyFilters();
- if (document.getElementById('view-map').style.display === 'block') {
- initOrUpdateMap();
- }
- document.getElementById('last-update').innerText = "Sync: " + new Date().toLocaleTimeString();
+ if (document.getElementById('view-map').style.display === 'block') { initOrUpdateMap(); }
+ document.getElementById('last-update').innerText = "SYNC: " + new Date().toLocaleTimeString();
} catch (e) { console.error(e); }
}
@@ -784,7 +646,7 @@ async function refreshLogs() {
const url = savedLimit ? `/api/logs?limit=${encodeURIComponent(savedLimit)}` : '/api/logs';
const res = await fetch(url); const logs = await res.json();
const tbody = document.getElementById('log-body'); let tableHTML = ""; let networkLogs = {};
- logs.forEach(row => {
+ logs.forEach(row => {
const time = row[0] ? row[0].split(' ')[1] : "--:--";
const clientId = row[1]; const protocol = row[2] || "DMR"; let source = row[3] || "---"; const target = row[4] || "---";
const rawSlot = row[5]; const source_ext = row[8]; const rawRssi = row[9]; const sourceConn = row[10]; const ysfMode = row[11];
@@ -797,50 +659,37 @@ async function refreshLogs() {
if (source_ext && source_ext.trim() !== "") { sourceHtml += `
/${esc(source_ext)}`; }
let slotDisplay = rawSlot && String(rawSlot).trim() !== "" && rawSlot !== "undefined" ? (protocol === "DMR" && !String(rawSlot).toUpperCase().startsWith("TS") ? `TS${rawSlot}` : rawSlot) : "---";
- let protoColor = "#3b82f6"; if (protocol === "NXDN") protoColor = "#10b981"; else if (protocol === "YSF") protoColor = "#8b5cf6"; else if (protocol === "D-STAR") protoColor = "#06b6d4"; else if (protocol === "P25") protoColor = "#f59e0b";
+ let protoColor = "var(--primary)"; if (protocol === "NXDN") protoColor = "var(--success)"; else if (protocol === "YSF") protoColor = "var(--accent)"; else if (protocol === "D-STAR") protoColor = "var(--primary)"; else if (protocol === "P25") protoColor = "var(--accent)";
- let sourceBadge = sourceConn ? (sourceConn.toLowerCase() === 'rf' ? '
RF' : (sourceConn.toLowerCase() === 'network' ? '
NET' : `
${esc(sourceConn).toUpperCase()}`)) : "---";
- let modeDisplay = ysfMode && ysfMode.trim() !== "" ? `
${esc(ysfMode).toUpperCase()}` : "---";
+ let sourceBadge = sourceConn ? (sourceConn.toLowerCase() === 'rf' ? '
(RF)' : (sourceConn.toLowerCase() === 'network' ? '
(NET)' : `
(${esc(sourceConn).toUpperCase()})`)) : "---";
+ let modeDisplay = ysfMode && ysfMode.trim() !== "" ? `
${esc(ysfMode).toUpperCase()}` : "---";
let rssiDisplay = '---';
if (rawRssi && rawRssi !== 0) {
let sLabel = "S0";
- if (rawRssi >= -93) {
- let over = Math.round((rawRssi + 93) / 10) * 10;
- sLabel = over > 0 ? `S9
+${over}` : "S9";
- } else {
- let sUnits = Math.floor((rawRssi + 141) / 6) + 1;
- sLabel = `S${Math.max(1, Math.min(9, sUnits))}`;
- }
- let activeSegs = 1;
- if (rawRssi >= -53) activeSegs = 9; else if (rawRssi >= -63) activeSegs = 8; else if (rawRssi >= -73) activeSegs = 7; else if (rawRssi >= -83) activeSegs = 6; else if (rawRssi >= -93) activeSegs = 5; else if (rawRssi >= -105) activeSegs = 4; else if (rawRssi >= -117) activeSegs = 3; else if (rawRssi >= -129) activeSegs = 2;
- let barsHtml = ''; const heights = [4, 5, 6, 7, 8, 10, 12, 14, 14];
- for (let i = 0; i < 9; i++) {
- let color = "rgba(255,255,255,0.1)";
- if (i < activeSegs) { if (i < 5) color = "var(--success)"; else if (i < 7) color = "#f59e0b"; else color = "var(--danger)"; }
- barsHtml += `
`;
- }
- rssiDisplay = `
${sLabel}
${barsHtml}
${esc(rawRssi)} dBm`;
+ if (rawRssi >= -93) { let over = Math.round((rawRssi + 93) / 10) * 10; sLabel = over > 0 ? `S9+${over}` : "S9"; }
+ else { let sUnits = Math.floor((rawRssi + 141) / 6) + 1; sLabel = `S${Math.max(1, Math.min(9, sUnits))}`; }
+ rssiDisplay = `
${sLabel}`;
}
if (source.includes("๐")) {
if (!networkLogs[clientId]) networkLogs[clientId] = "";
- networkLogs[clientId] += `
[${esc(time)}] [${esc(protocol)}] ${esc(source.replace("๐", "").trim())}
`;
+ networkLogs[clientId] += `
[${esc(time)}] [${esc(protocol)}] ${esc(source.replace("๐", "").trim())}
`;
} else {
const selectedFilter = document.getElementById('stat-node-filter').value;
if (selectedFilter === 'all' || String(clientId).toLowerCase() === selectedFilter) {
tableHTML += `
| ${esc(time)} |
${esc(String(clientId).toUpperCase())} |
- ${esc(protocol)} |
+ ${esc(protocol)} |
${modeDisplay} |
- ${sourceBadge} |
- ${esc(slotDisplay)} |
- ${sourceHtml} |
- ${esc(target.trim())} |
+ ${sourceBadge} |
+ ${esc(slotDisplay)} |
+ ${sourceHtml} |
+ ${esc(target.trim())} |
${esc(row[6])}s |
${esc(row[7])}% |
- ${rssiDisplay} |
+ ${rssiDisplay} |
`;
}
}
@@ -854,24 +703,24 @@ async function refreshStats() {
try {
const node = document.getElementById('stat-node-filter').value || 'all';
const res = await fetch(`/api/stats?node=${node}`); const data = await res.json();
- document.getElementById('stat-tgs').innerHTML = data.top_tgs.map((t, i) => `
${i+1}. ${esc(t.target)} ${t.count} tx
`).join('') || t('statNoData');
- document.getElementById('stat-calls').innerHTML = data.top_calls.map((c, i) => `
${i+1}. ${esc(c.call)} ${c.count} tx
`).join('') || t('statNoData');
+ document.getElementById('stat-tgs').innerHTML = data.top_tgs.map((t, i) => `
${i+1}. ${esc(t.target)} [ ${t.count} TX ]
`).join('') || t('statNoData');
+ document.getElementById('stat-calls').innerHTML = data.top_calls.map((c, i) => `
${i+1}. ${esc(c.call)} [ ${c.count} TX ]
`).join('') || t('statNoData');
document.getElementById('stat-avg').innerText = data.avg_duration; document.getElementById('stat-today').innerText = data.today_tx;
- } catch (e) { console.error("Errore statistiche:", e); }
+ } catch (e) { console.error(e); }
}
async function subscribeToPush() {
- if (!('serviceWorker' in navigator) || !('PushManager' in window)) { customAlert("Error", "Push notifications are not supported by this browser.", true); return; }
+ if (!('serviceWorker' in navigator) || !('PushManager' in window)) { customAlert("ERR", "PUSH UNSUPPORTED", true); return; }
if (!me.logged_in) { openLoginModal(); return; }
const permission = await Notification.requestPermission();
- if (permission !== 'granted') { customAlert("Error", "Push notifications permission denied.", true); return; }
+ if (permission !== 'granted') { customAlert("ERR", "PERMISSION DENIED", true); return; }
try {
const reg = await navigator.serviceWorker.ready; const res = await fetch('/api/vapid_public_key'); const { public_key } = await res.json();
const subscription = await reg.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: urlB64ToUint8Array(public_key) });
const subRes = await fetch('/api/subscribe', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(subscription) });
- if (!subRes.ok) throw new Error('subscribe failed: HTTP ' + subRes.status);
- customAlert("Success", "Push notifications enabled successfully!"); document.getElementById('push-btn').style.color = 'var(--success)';
- } catch (e) { console.error(e); customAlert("Error", "Failed to enable notifications.", true); }
+ if (!subRes.ok) throw new Error('ERR HTTP ' + subRes.status);
+ customAlert("OK", "PUSH ENABLED"); document.getElementById('push-btn').style.color = 'var(--success)';
+ } catch (e) { console.error(e); customAlert("ERR", "PUSH FAIL", true); }
}
async function checkPushStatus() {
@@ -887,8 +736,8 @@ async function checkServerUpdate() {
}
function confirmServerUpdate() {
- customConfirm("๐ UPDATE SERVER", "Vuoi scaricare l'ultima versione del server da Gitea/GitHub e riavviare il servizio backend?", "var(--danger)", async () => {
- try { const res = await fetch('/api/server_update/apply', { method: 'POST' }); const data = await res.json(); if (data.success) { customAlert("โ
SUCCESS", "Aggiornamento in corso. La pagina si ricaricherร a breve."); setTimeout(() => location.reload(), 5000); } else { customAlert("โ ERRORE", esc(data.error), true); } } catch (e) { console.error(e); customAlert("โ ERRORE", "Errore di rete.", true); }
+ customConfirm("UPD_SRV", "EXECUTE GIT PULL ON BACKEND?", "var(--danger)", async () => {
+ try { const res = await fetch('/api/server_update/apply', { method: 'POST' }); const data = await res.json(); if (data.success) { customAlert("OK", "UPD EXECUTED. RELOAD IN 5s."); setTimeout(() => location.reload(), 5000); } else { customAlert("ERR", esc(data.error), true); } } catch (e) { console.error(e); customAlert("ERR", "NET ERR", true); }
});
}
@@ -898,7 +747,7 @@ const refreshLogsSoon = debounce(() => { refreshLogs(); refreshStats(); }, 500);
if (typeof io !== 'undefined') {
const socket = io();
- socket.on('mqtt_status', function(data) { const badge = document.getElementById('mqtt-badge'); if (badge) { if (data.connected) { badge.innerText = "MQTT: ONLINE"; badge.className = "mqtt-badge mqtt-online"; } else { badge.innerText = "MQTT: OFFLINE"; badge.className = "mqtt-badge mqtt-offline"; } } });
+ socket.on('mqtt_status', function(data) { const badge = document.getElementById('mqtt-badge'); if (badge) { if (data.connected) { badge.innerText = "MQTT: OK"; badge.className = "mqtt-badge mqtt-online"; } else { badge.innerText = "MQTT: ERR"; badge.className = "mqtt-badge mqtt-offline"; } } });
socket.on('connect', () => { refreshStates(); refreshLogs(); refreshStats(); });
socket.on('dati_aggiornati', refreshStatesSoon); socket.on('log_aggiornato', refreshLogsSoon);
}
diff --git a/static/js/modals.js b/static/js/modals.js
index ff368aa..39bd485 100644
--- a/static/js/modals.js
+++ b/static/js/modals.js
@@ -2,65 +2,65 @@
const i18n = {
en: {
lblLogLimit: "Rows:",
- lastTransits: "Lastheard", loginTitle: "๐ System Login",
+ lastTransits: "Lastheard", loginTitle: "SYSTEM_LOGIN",
thTime: "Time", thRep: "Repeater", thMode: "Mode", thCall: "Callsign", thDur: "Duration",
thUser: "User", thRole: "Role", thNodes: "Nodes", thActs: "Actions",
- btnReqCfg: "๐ REQ CONFIG", btnGlobal: "๐จ GLOBAL OVERRIDE", btnAdmin: "๐ ๏ธ ADMIN", btnPass: "๐ PASS", btnLogout: "LOGOUT",
- btnSvc: "โ๏ธ SVC", btnFile: "๐ FILE", btnBoot: "๐ BOOT", btnAdd: "+ ADD",
- waitNet: "> Waiting network...", waitData: "Waiting for node data...", forceUpdate: "๐ FORCE UPDATE",
- adminTitle: "๐ ๏ธ User & System Management", adminDBSync: "โ๏ธ Database Sync Config", adminTime: "Daily Update Time:", adminSave: "SAVE CONFIG", roleOp: "Operator",
- modSvcTitle: "โ๏ธ System Daemons:", modFileTitle: "๐ Config Files", modEditTitle: "๐ INI Editor:",
- warnEdit: "โ ๏ธ WARNING: This editor directly manipulates remote node parameters.",
- btnEdit: "๐ EDIT", btnStart: "โถ START", btnRestart: "๐ RESTART", btnStop: "๐ STOP", btnSave: "๐พ SAVE & SEND",
- btnHat: "๐ RESET HAT", confHat: "Are you sure you want to physically reset the MMDVM board on node ",
+ btnReqCfg: "REQ_CFG", btnGlobal: "GBL_OVR", btnAdmin: "SYS_ADM", btnPass: "CHG_PWD", btnLogout: "LOGOUT",
+ btnSvc: "SVC", btnFile: "CFG", btnBoot: "REBOOT", btnAdd: "ADD",
+ waitNet: "> Waiting network...", waitData: "Waiting for node data...", forceUpdate: "FORCE_UPD",
+ adminTitle: "SYS_ADMIN", adminDBSync: "DB_SYNC_CFG", adminTime: "Daily Update Time:", adminSave: "SAVE_CFG", roleOp: "Operator",
+ modSvcTitle: "DAEMONS:", modFileTitle: "CFG_FILES", modEditTitle: "EDIT:",
+ warnEdit: "[WARN] DIRECT EDIT ACTIVE",
+ btnEdit: "EDIT", btnStart: "START", btnRestart: "RST", btnStop: "STOP", btnSave: "WRITE_FILE",
+ btnHat: "RST_HAT", confHat: "PHYSICAL RESET MMDVM ON: ",
confOp: "Confirm operation on ", confTgOn: "ENABLE Telegram notifications for ", confTgOff: "MUTE Telegram notifications for ", confOvr: "Are you sure you want to overwrite file on ",
- warnDaemon: "โ ๏ธ SVC KO - CHECK DAEMONS โ ๏ธ",
+ warnDaemon: "[WARN] DAEMON OFFLINE",
promptOvr: "GLOBAL OVERRIDE", promptOvrConfirm: "Confirm sending to ENTIRE network?",
- modUpdateTitle: "๐ GLOBAL UPDATE", confUpdate: "Do you want to request updated data and configuration files from all nodes in the fleet?", alertUpdateOk: "Request sent successfully!",
- btnConfReset: "โ ๏ธ CONFIRM RESET", btnCancel: "CANCEL", promptPass: "Enter the new password:",
- titleError: "โ ERROR", titleSuccess: "โ
SUCCESS", titleAction: "โ๏ธ CONFIRM ACTION", titleDelete: "๐๏ธ DELETE USER", titleSave: "๐พ SAVE", titleGlobal: "๐จ GLOBAL OVERRIDE",
- btnYes: "YES, PROCEED", msgDelUser: "Confirm user deletion?", msgPassOk: "Password updated successfully!", msgPassErr: "Failed to update password.", msgLoginFail: "Login Failed",
- msgConfigSaved: "Configuration saved!", msgConfigErr: "Error saving configuration", msgNetErr: "Network Error", msgOvrSel: "Select the profile to send to the ENTIRE network:",
- msgOvrOk: "Command successfully sent to the network!", msgMissUser: "Missing Username", msgMissPass: "Password required for new user", btnSvcKo: "โ ๏ธ DAEMON KO",
- phNewPass: "New pass (empty to keep)", phPass: "Password",
- titleSwitch: "SWITCH PROFILE", confSwitch: "Are you sure you want to switch to", titleBoot: "SYSTEM REBOOT", confBoot: "Are you sure you want to REBOOT node ",
- ttReqCfg: "Request immediate data update", ttGlobal: "Force profile switch on network", ttAdmin: "User and system management", ttPass: "Change your password", ttLogout: "Log out",
- ttProfA: "Switch to Profile A", ttProfB: "Switch to Profile B", ttTgOn: "Enable Telegram notifications", ttTgOff: "Disable Telegram notifications", ttSvc: "Manage system daemons", ttFile: "Edit .ini configuration files", ttHat: "Send physical reset to modem", ttBoot: "Reboot node operating system",
- ttSwitchTo: "Switch to profile: ", ttSvcStart: "Start service", ttSvcRestart: "Restart service", ttSvcEdit: "Edit configuration", ttSvcStop: "Stop service", ttLang: "Change language",
- statTopTG: "๐ฏ TOP TALKGROUPS", statTopCall: "๐ฃ๏ธ TOP CALLSIGNS", statLoading: "Loading...", statAvgDur: "โฑ๏ธ AVERAGE DURATION", statTodayTx: "๐ก TRANSITS TODAY", statNoData: "No data",
- statTitle: "DAILY STATISTICS", statAllNodes: "ALL NODES", modVersions: "Software & Firmware",
- filtAll: "All Nodes", filtOnline: "Online", filtOffline: "Offline", filtAlerts: "โ ๏ธ Alerts"
+ modUpdateTitle: "GBL_UPDATE", confUpdate: "Do you want to request updated data and configuration files from all nodes in the fleet?", alertUpdateOk: "ACK",
+ btnConfReset: "CONFIRM", btnCancel: "ABORT", promptPass: "NEW PWD:",
+ titleError: "ERR", titleSuccess: "OK", titleAction: "CONFIRM", titleDelete: "DEL_USR", titleSave: "SAVE", titleGlobal: "GBL_OVR",
+ btnYes: "EXECUTE", msgDelUser: "DELETE USER?", msgPassOk: "PWD_UPDATED", msgPassErr: "PWD_ERR", msgLoginFail: "AUTH_FAIL",
+ msgConfigSaved: "CFG_SAVED", msgConfigErr: "CFG_ERR", msgNetErr: "NET_ERR", msgOvrSel: "SELECT_PROF:",
+ msgOvrOk: "CMD_BROADCASTED", msgMissUser: "MISSING_USR", msgMissPass: "MISSING_PWD", btnSvcKo: "DAEMON_ERR",
+ phNewPass: "NEW_PWD (EMPTY=KEEP)", phPass: "PWD",
+ titleSwitch: "SW_PROF", confSwitch: "SWITCH TO ", titleBoot: "SYS_REBOOT", confBoot: "REBOOT NODE ",
+ ttReqCfg: "REQ_DATA", ttGlobal: "GBL_OVR", ttAdmin: "ADMIN", ttPass: "CHG_PWD", ttLogout: "LOGOUT",
+ ttProfA: "PROF_A", ttProfB: "PROF_B", ttTgOn: "TG_ON", ttTgOff: "TG_OFF", ttSvc: "DAEMONS", ttFile: "FILES", ttHat: "RST_HAT", ttBoot: "REBOOT",
+ ttSwitchTo: "SW_TO: ", ttSvcStart: "START", ttSvcRestart: "RST", ttSvcEdit: "EDIT", ttSvcStop: "STOP", ttLang: "LANG",
+ statTopTG: "TOP_TG", statTopCall: "TOP_CALL", statLoading: "LOADING...", statAvgDur: "AVG_DUR", statTodayTx: "TX_TODAY", statNoData: "NO_DATA",
+ statTitle: "DAILY_STATS", statAllNodes: "ALL_NODES", modVersions: "SW_VERSIONS",
+ filtAll: "ALL_NODES", filtOnline: "ONLINE", filtOffline: "OFFLINE", filtAlerts: "ALERTS"
},
it: {
lblLogLimit: "Righe:",
- lastTransits: "Ultimi ascolti", loginTitle: "๐ Login di Sistema",
+ lastTransits: "Ultimi ascolti", loginTitle: "SYSTEM_LOGIN",
thTime: "Ora", thRep: "Ripetitore", thMode: "Modo", thCall: "Nominativo", thDur: "Durata",
thUser: "Utente", thRole: "Ruolo", thNodes: "Nodi", thActs: "Azioni",
- btnReqCfg: "๐ RICHIEDI CONFIG", btnGlobal: "๐จ OVERRIDE GLOBALE", btnAdmin: "๐ ๏ธ ADMIN", btnPass: "๐ PASS", btnLogout: "LOGOUT",
- btnSvc: "โ๏ธ SVC", btnFile: "๐ FILE", btnBoot: "๐ BOOT", btnAdd: "+ AGGIUNGI",
- waitNet: "> Attesa rete...", waitData: "In attesa dei dati dal nodo...", forceUpdate: "๐ FORZA AGGIORNAMENTO",
- adminTitle: "๐ ๏ธ Gestione Utenti e Sistema", adminDBSync: "โ๏ธ Sincronizzazione Database", adminTime: "Orario Aggiornamento:", adminSave: "SALVA CONFIG", roleOp: "Operatore",
- modSvcTitle: "โ๏ธ Demoni Sistema:", modFileTitle: "๐ File di Configurazione", modEditTitle: "๐ Editor INI:",
- warnEdit: "โ ๏ธ ATTENZIONE: Questo editor manipola direttamente i parametri del nodo remoto.",
- btnEdit: "๐ MODIFICA", btnStart: "โถ START", btnRestart: "๐ RESTART", btnStop: "๐ STOP", btnSave: "๐พ SALVA ED INVIA",
- btnHat: "๐ RESET HAT", confHat: "Sei sicuro di voler resettare fisicamente la scheda MMDVM sul nodo ",
+ btnReqCfg: "REQ_CFG", btnGlobal: "GBL_OVR", btnAdmin: "SYS_ADM", btnPass: "CHG_PWD", btnLogout: "LOGOUT",
+ btnSvc: "SVC", btnFile: "CFG", btnBoot: "REBOOT", btnAdd: "ADD",
+ waitNet: "> Attesa rete...", waitData: "In attesa dei dati dal nodo...", forceUpdate: "FORCE_UPD",
+ adminTitle: "SYS_ADMIN", adminDBSync: "DB_SYNC_CFG", adminTime: "Orario Aggiornamento:", adminSave: "SAVE_CFG", roleOp: "Operatore",
+ modSvcTitle: "DAEMONS:", modFileTitle: "CFG_FILES", modEditTitle: "EDIT:",
+ warnEdit: "[WARN] DIRECT EDIT ACTIVE",
+ btnEdit: "EDIT", btnStart: "START", btnRestart: "RST", btnStop: "STOP", btnSave: "WRITE_FILE",
+ btnHat: "RST_HAT", confHat: "PHYSICAL RESET MMDVM ON: ",
confOp: "Confermi l'operazione su ", confTgOn: "Vuoi ATTIVARE le notifiche Telegram per il nodo ", confTgOff: "Vuoi SILENZIARE le notifiche Telegram per il nodo ", confOvr: "Sei sicuro di voler sovrascrivere il file su ",
- warnDaemon: "โ ๏ธ SVC KO - CONTROLLA DEMONI โ ๏ธ",
- promptOvr: "OVERRIDE GLOBALE", promptOvrConfirm: "Confermi l'invio a TUTTA la rete?",
- modUpdateTitle: "๐ AGGIORNAMENTO GLOBALE", confUpdate: "Vuoi richiedere i dati e i file di configurazione aggiornati a tutti i nodi della flotta?", alertUpdateOk: "Richiesta inviata con successo!",
- btnConfReset: "โ ๏ธ CONFERMA RESET", btnCancel: "ANNULLA", promptPass: "Inserisci la nuova password:",
- titleError: "โ ERRORE", titleSuccess: "โ
OK", titleAction: "โ๏ธ CONFERMA AZIONE", titleDelete: "๐๏ธ ELIMINA UTENTE", titleSave: "๐พ SALVATAGGIO", titleGlobal: "๐จ OVERRIDE GLOBALE",
- btnYes: "SI, PROCEDI", msgDelUser: "Confermi l'eliminazione dell'utente?", msgPassOk: "Password aggiornata con successo!", msgPassErr: "Errore durante l'aggiornamento della password.", msgLoginFail: "Login Fallito",
- msgConfigSaved: "Configurazione salvata!", msgConfigErr: "Errore durante il salvataggio", msgNetErr: "Errore di rete", msgOvrSel: "Seleziona il profilo da inviare a TUTTA la rete:",
- msgOvrOk: "Comando inviato con successo a tutta la rete!", msgMissUser: "Username mancante", msgMissPass: "Password obbligatoria per il nuovo utente", btnSvcKo: "โ ๏ธ DEMONE KO",
- phNewPass: "Nuova pass (vuota per non cambiare)", phPass: "Password",
- titleSwitch: "CAMBIO PROFILO", confSwitch: "Sei sicuro di voler passare al", titleBoot: "RIAVVIO SISTEMA", confBoot: "Sei sicuro di voler RIAVVIARE il nodo ",
- ttReqCfg: "Richiedi aggiornamento dati", ttGlobal: "Forza cambio profilo globale", ttAdmin: "Gestione utenti e sistema", ttPass: "Cambia la tua password", ttLogout: "Disconnetti",
+ warnDaemon: "[WARN] DAEMON OFFLINE",
+ promptOvr: "GBL_OVR", promptOvrConfirm: "Confermi l'invio a TUTTA la rete?",
+ modUpdateTitle: "GBL_UPDATE", confUpdate: "Vuoi richiedere i dati e i file di configurazione aggiornati a tutti i nodi della flotta?", alertUpdateOk: "ACK",
+ btnConfReset: "CONFIRM", btnCancel: "ABORT", promptPass: "NEW PWD:",
+ titleError: "ERR", titleSuccess: "OK", titleAction: "CONFIRM", titleDelete: "DEL_USR", titleSave: "SAVE", titleGlobal: "GBL_OVR",
+ btnYes: "EXECUTE", msgDelUser: "DELETE USER?", msgPassOk: "PWD_UPDATED", msgPassErr: "PWD_ERR", msgLoginFail: "AUTH_FAIL",
+ msgConfigSaved: "CFG_SAVED", msgConfigErr: "CFG_ERR", msgNetErr: "NET_ERR", msgOvrSel: "SELECT_PROF:",
+ msgOvrOk: "CMD_BROADCASTED", msgMissUser: "MISSING_USR", msgMissPass: "MISSING_PWD", btnSvcKo: "DAEMON_ERR",
+ phNewPass: "NEW_PWD (EMPTY=KEEP)", phPass: "PWD",
+ titleSwitch: "SW_PROF", confSwitch: "SWITCH TO ", titleBoot: "SYS_REBOOT", confBoot: "REBOOT NODE ",
+ ttReqCfg: "REQ_DATA", ttGlobal: "GBL_OVR", ttAdmin: "ADMIN", ttPass: "CHG_PWD", ttLogout: "LOGOUT",
ttProfA: "Passa al Profilo A", ttProfB: "Passa al Profilo B", ttTgOn: "Abilita notifiche Telegram", ttTgOff: "Disabilita notifiche Telegram", ttSvc: "Gestisci demoni di sistema", ttFile: "Modifica file .ini da remoto", ttHat: "Reset fisico scheda modem", ttBoot: "Riavvia sistema operativo",
- ttSwitchTo: "Passa al profilo: ", ttSvcStart: "Avvia servizio", ttSvcRestart: "Riavvia servizio", ttSvcEdit: "Modifica configurazione", ttSvcStop: "Ferma servizio", ttLang: "Cambia lingua",
- statTopTG: "๐ฏ TOP TALKGROUPS", statTopCall: "๐ฃ๏ธ TOP CALLSIGNS", statLoading: "Caricamento...", statAvgDur: "โฑ๏ธ DURATA MEDIA", statTodayTx: "๐ก TRANSITI OGGI", statNoData: "Nessun dato",
- statTitle: "STATISTICHE GIORNALIERE", statAllNodes: "TUTTA LA RETE", modVersions: "Software & Firmware",
- filtAll: "Tutti i nodi", filtOnline: "Attivi", filtOffline: "Offline", filtAlerts: "โ ๏ธ Allarmi"
+ ttSwitchTo: "SW_TO: ", ttSvcStart: "START", ttSvcRestart: "RST", ttSvcEdit: "EDIT", ttSvcStop: "STOP", ttLang: "LANG",
+ statTopTG: "TOP_TG", statTopCall: "TOP_CALL", statLoading: "LOADING...", statAvgDur: "AVG_DUR", statTodayTx: "TX_TODAY", statNoData: "NO_DATA",
+ statTitle: "DAILY_STATS", statAllNodes: "ALL_NODES", modVersions: "SW_VERSIONS",
+ filtAll: "ALL_NODES", filtOnline: "ONLINE", filtOffline: "OFFLINE", filtAlerts: "ALERTS"
}
};
@@ -70,7 +70,7 @@ function toggleLang() { currentLang = currentLang === 'it' ? 'en' : 'it'; localS
function applyTranslations() {
const langBtn = document.getElementById('lang-btn');
- if (langBtn) langBtn.innerText = currentLang === 'it' ? "๐ฌ๐ง ENG" : "๐ฎ๐น ITA";
+ if (langBtn) langBtn.innerText = currentLang === 'it' ? "ENG" : "ITA";
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
if (i18n[currentLang][key]) el.innerHTML = i18n[currentLang][key];
@@ -90,19 +90,20 @@ function q(s) { return esc(JSON.stringify(String(s ?? ''))); }
// --- DIALOGHI ALERT & CONFIRM ---
function customAlert(title, desc, isError = false) {
const color = isError ? 'var(--danger)' : 'var(--success)';
- document.getElementById('alert-title').innerHTML = title;
+ document.getElementById('alert-title').innerHTML = '> ' + title;
document.getElementById('alert-title').style.color = color;
- document.getElementById('alert-box').style.borderColor = color;
+ document.getElementById('alert-box').style.borderTopColor = color;
document.getElementById('alert-desc').innerHTML = desc;
document.getElementById('alert-modal').style.display = 'flex';
}
function customConfirm(title, desc, color, callback) {
- document.getElementById('confirm-title').innerHTML = title;
+ document.getElementById('confirm-title').innerHTML = '> ' + title;
document.getElementById('confirm-title').style.color = color;
- document.getElementById('confirm-box').style.borderColor = color;
+ document.getElementById('confirm-box').style.borderTopColor = color;
document.getElementById('confirm-desc').innerHTML = desc;
- document.getElementById('confirm-yes-btn').style.background = color;
+ document.getElementById('confirm-yes-btn').style.borderColor = color;
+ document.getElementById('confirm-yes-btn').style.color = color;
document.getElementById('confirm-yes-btn').innerText = t('btnYes');
document.getElementById('confirm-cancel-btn').innerText = t('btnCancel');
confirmActionCallback = callback;
@@ -156,10 +157,10 @@ async function loadUsers() {
const res = await fetch('/api/users'); if (!res.ok) return; const users = await res.json(); usersCache = {}; users.forEach(u => { usersCache[u.id] = u; });
document.getElementById('users-table-body').innerHTML = users.map(u => `
- | ${u.id} | ${esc(u.username)} | ${esc(String(u.role).toUpperCase())} | ${esc(u.allowed_nodes)} |
-
-
-
+ | ${u.id} | ${esc(u.username)} | [ ${esc(String(u.role).toUpperCase())} ] | ${esc(u.allowed_nodes)} |
+
+
+
|
`).join('');
}
@@ -167,12 +168,12 @@ async function loadUsers() {
function startEditUser(id) {
const u = usersCache[id]; if (!u) return;
editingUserId = id; document.getElementById('new-user').value = u.username; document.getElementById('new-user').disabled = true; document.getElementById('new-pass').value = ""; document.getElementById('new-pass').placeholder = t('phNewPass'); document.getElementById('new-role').value = u.role; document.getElementById('new-nodes').value = u.allowed_nodes;
- const btnSubmit = document.getElementById('btn-user-submit'); btnSubmit.innerHTML = t('titleSave'); btnSubmit.style.background = "var(--accent)"; document.getElementById('btn-user-cancel').style.display = "block";
+ const btnSubmit = document.getElementById('btn-user-submit'); btnSubmit.innerHTML = "UPDATE"; btnSubmit.style.borderColor = "var(--accent)"; btnSubmit.style.color = "var(--accent) !important"; document.getElementById('btn-user-cancel').style.display = "block";
}
function cancelEdit() {
editingUserId = null; document.getElementById('new-user').value = ""; document.getElementById('new-user').disabled = false; document.getElementById('new-pass').value = ""; document.getElementById('new-pass').placeholder = t('phPass'); document.getElementById('new-role').value = "operator"; document.getElementById('new-nodes').value = "";
- const btnSubmit = document.getElementById('btn-user-submit'); btnSubmit.innerHTML = t('btnAdd'); btnSubmit.style.background = "var(--success)"; document.getElementById('btn-user-cancel').style.display = "none";
+ const btnSubmit = document.getElementById('btn-user-submit'); btnSubmit.innerHTML = "ADD"; btnSubmit.style.borderColor = "var(--success)"; btnSubmit.style.color = "var(--success) !important"; document.getElementById('btn-user-cancel').style.display = "none";
}
async function submitUser() {
@@ -208,13 +209,13 @@ function triggerGlobalEmergency() {
for (const [k, v] of Object.entries(globalHealthData[id].profiles)) { uniqueProfiles[k] = v; }
}
}
- const container = document.getElementById('global-btn-container'); let html = ''; const colors = ["var(--accent)", "#eab308", "var(--success)", "var(--primary)"]; let idx = 0;
+ const container = document.getElementById('global-btn-container'); let html = ''; const colors = ["var(--accent)", "#00ffcc", "var(--primary)"]; let idx = 0;
for (const [k, v] of Object.entries(uniqueProfiles)) {
let col = colors[idx % colors.length];
- html += `
`;
+ html += `
`;
idx++;
}
- if (Object.keys(uniqueProfiles).length === 0) { html = `
No profiles configured on the network.
`; }
+ if (Object.keys(uniqueProfiles).length === 0) { html = `
NO_PROFS_FOUND
`; }
container.innerHTML = html; document.getElementById('override-desc').innerText = t('msgOvrSel'); document.getElementById('override-modal').style.display = 'flex';
}
@@ -241,34 +242,50 @@ async function executePasswordChange() {
function fileLabel(stem, names) {
const key = String(stem).toLowerCase(); const full = (names || []).find(n => String(n).replace(/\.[^.]*$/, '').toLowerCase() === key);
if (full) { const m = String(full).match(/^(.*?)(\.[^.]*)?$/); return String(m[1]).toUpperCase() + (m[2] || ''); }
- return String(stem).toUpperCase() + '.ini';
+ return String(stem).toUpperCase() + '.INI';
}
function openConfigsModal(clientId) {
- const data = globalHealthData[clientId.toLowerCase()]; const listDiv = document.getElementById('configs-list'); let listaFile = data ? (data.config_files || data.files || []) : []; const fileNames = (data && data.file_names) || [];
- if (listaFile.length === 0) listDiv.innerHTML = `
${t('waitData')}
`;
- else listDiv.innerHTML = listaFile.map(f => `
${esc(fileLabel(f, fileNames))}
`).join('');
+ const data = globalHealthData[clientId.toLowerCase()];
+ const listDiv = document.getElementById('configs-list');
+ let listaFile = data ? (data.config_files || data.files || []) : [];
+ const fileNames = (data && data.file_names) || [];
+
+ if (listaFile.length === 0) {
+ listDiv.innerHTML = `
${t('waitData')}
`;
+ } else {
+ listDiv.innerHTML = listaFile.map(f => `
+ ${esc(fileLabel(f, fileNames))}
+
+
`).join('');
+ }
document.getElementById('configs-modal').style.display = 'flex';
}
function closeConfigsModal() { document.getElementById('configs-modal').style.display = 'none'; }
// --- MODALE GESTIONE DEMONI/SERVIZI ---
-function openServicesModal(clientId) { document.getElementById('svc-modal-title').innerText = clientId.toUpperCase(); document.getElementById('services-modal').style.display = 'flex'; renderServicesList(clientId); }
+function openServicesModal(clientId) {
+ document.getElementById('svc-modal-title').innerText = clientId.toUpperCase();
+ document.getElementById('services-modal').style.display = 'flex';
+ renderServicesList(clientId);
+}
function closeServicesModal() { document.getElementById('services-modal').style.display = 'none'; }
function renderServicesList(clientId) {
- const data = globalHealthData[clientId.toLowerCase()]; const listDiv = document.getElementById('services-list');
- if (!data || !data.processes || Object.keys(data.processes).length === 0) { listDiv.innerHTML = "
No service data available.
"; return; }
+ const data = globalHealthData[clientId.toLowerCase()];
+ const listDiv = document.getElementById('services-list');
+
+ if (!data || !data.processes || Object.keys(data.processes).length === 0) { listDiv.innerHTML = "
NO_DATA
"; return; }
let html = "";
for (const [name, status] of Object.entries(data.processes)) {
const isOnline = status.toLowerCase() === 'online'; const statusColor = isOnline ? 'var(--success)' : 'var(--danger)';
- html += `
-
${esc(name)}${esc(String(status).toUpperCase())}
-
- ${!isOnline ? `
` : ''}
-
-
- ${isOnline ? `
` : ''}
+ html += `
+
${esc(name)} [${esc(String(status).toUpperCase())}]
+
+ ${!isOnline ? `` : ''}
+
+
+ ${isOnline ? `` : ''}
`;
}
@@ -278,7 +295,7 @@ function renderServicesList(clientId) {
function controlService(clientId, service, action) {
customConfirm(t('titleAction'), `${t('confOp')}
${esc(service)}?`, "var(--accent)", async () => {
try { const res = await fetch('/api/service_control', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ clientId, service, action }) }); const data = await res.json();
- if(!data.success) customAlert(t('titleError'), "Error: " + esc(data.error), true);
+ if(!data.success) customAlert(t('titleError'), "ERR: " + esc(data.error), true);
} catch(e) { console.error(e); }
});
}
@@ -287,28 +304,38 @@ function controlService(clientId, service, action) {
let currentEditClient = ""; let currentEditService = "";
async function openEditorModal(clientId, service) {
currentEditClient = clientId; currentEditService = service; document.getElementById('editor-title').innerText = `${service.toUpperCase()} @ ${clientId.toUpperCase()}`;
- document.getElementById('config-textarea').value = "Connecting to server..."; document.getElementById('editor-status').innerText = ""; document.getElementById('editor-modal').style.display = 'flex';
- try { const res = await fetch(`/api/config_file/${encodeURIComponent(clientId)}/${encodeURIComponent(service)}`); const data = await res.json(); if (data.success) document.getElementById('config-textarea').value = data.data.raw_text || "Empty file"; else document.getElementById('config-textarea').value = "ERROR:\n" + data.error; } catch(e) { document.getElementById('config-textarea').value = "Connection error."; }
+ document.getElementById('config-textarea').value = "AWAITING_STREAM..."; document.getElementById('editor-status').innerText = ""; document.getElementById('editor-modal').style.display = 'flex';
+ try {
+ const res = await fetch(`/api/config_file/${encodeURIComponent(clientId)}/${encodeURIComponent(service)}`);
+ const data = await res.json();
+ if (data.success) {
+ document.getElementById('config-textarea').value = data.data.raw_text || "EMPTY";
+ } else {
+ document.getElementById('config-textarea').value = "ERR:\n" + data.error;
+ }
+ } catch(e) {
+ document.getElementById('config-textarea').value = "NET_ERR";
+ }
}
function closeEditorModal() { document.getElementById('editor-modal').style.display = 'none'; }
function saveConfig() {
const textValue = document.getElementById('config-textarea').value; const statusSpan = document.getElementById('editor-status');
customConfirm(t('titleSave'), `${t('confOvr')}
${currentEditClient.toUpperCase()}?`, "var(--danger)", async () => {
- statusSpan.innerText = "Sending..."; statusSpan.style.color = "var(--success)";
+ statusSpan.innerText = "WRITING..."; statusSpan.style.color = "var(--success)";
try {
const res = await fetch('/api/config_file', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ clientId: currentEditClient, service: currentEditService, config_data: { "raw_text": textValue } }) });
const data = await res.json();
- if (data.success) { customAlert(t('titleSuccess'), "File updated!"); closeEditorModal(); } else { customAlert(t('titleError'), "Server error: " + esc(data.error), true); statusSpan.innerText = "โ Error"; }
- } catch(e) { customAlert(t('titleError'), t('msgNetErr'), true); statusSpan.innerText = "โ Network Error"; }
+ if (data.success) { customAlert(t('titleSuccess'), "FILE_WRITTEN"); closeEditorModal(); } else { customAlert(t('titleError'), "ERR: " + esc(data.error), true); statusSpan.innerText = "ERR"; }
+ } catch(e) { customAlert(t('titleError'), t('msgNetErr'), true); statusSpan.innerText = "NET_ERR"; }
});
}
// --- MODALE VERSIONI SOFTWARE ---
function openVersionsModal(clientId) {
const versions = globalVersionsData[clientId.toLowerCase()]; const listDiv = document.getElementById('versions-list');
- if (!versions || Object.keys(versions).length === 0) { listDiv.innerHTML = "
Nessun dato ancora ricevuto. Usa il tasto ๐ RESTART sui servizi del nodo per forzare l'invio del log di avvio."; }
- else { let html = ""; for (const [software, version] of Object.entries(versions)) { html += `
${esc(software)}: ${esc(version)}
`; } listDiv.innerHTML = html; }
+ if (!versions || Object.keys(versions).length === 0) { listDiv.innerHTML = "
NO_DATA. RESTART SVCS TO PUSH LOGS.
"; }
+ else { let html = ""; for (const [software, version] of Object.entries(versions)) { html += `
${esc(software)}: ${esc(version)}
`; } listDiv.innerHTML = html; }
document.getElementById('versions-modal').style.display = 'flex';
}
function closeVersionsModal() { document.getElementById('versions-modal').style.display = 'none'; }
diff --git a/templates/index.html b/templates/index.html
index 3377fb8..e6b93e0 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -6,24 +6,26 @@
Fleet Control Console
-
+
-
+
+
+
-
+
-
FLEET CONTROL CONSOLE
+
SCHEMATIC // FLEET C2
@@ -31,10 +33,10 @@
-
-
MQTT: CHECKING...
-
-
+
@@ -50,19 +52,19 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -72,30 +74,30 @@
+
-
- ๐ข FLEET STATUS
+
+ [ FLEET_STATUS ]
+
-
-
- ๐ก Lastheard
-
+
+
[ LASTHEARD ]
-
-
-
-
+
+
@@ -103,15 +105,15 @@
- | Time |
- Repeater |
- Mode |
- YSF Mode |
- Source |
- REF / SLOT |
- Callsign |
- Target / TG |
- Duration |
+ TIME |
+ REPEATER |
+ MODE |
+ YSF_MODE |
+ SOURCE |
+ REF/SLOT |
+ CALLSIGN |
+ TARGET |
+ DUR |
BER |
RSSI |
@@ -121,30 +123,29 @@
+
-
- ๐ DAILY STATISTICS
-
+
[ DAILY_STATISTICS ]
-
-
๐ฏ TOP TALKGROUPS
-
Loading...
+
+
TOP_TALKGROUPS
+
LOADING...
-
-
๐ฃ๏ธ TOP CALLSIGNS
-
Loading...
+
+
TOP_CALLSIGNS
+
LOADING...
-
+
-
--s
-
โฑ๏ธ AVERAGE DURATION
+
--s
+
AVG_DURATION
-
+
-
--
-
๐ก TRANSITS TODAY
+
--
+
TRANSITS_TODAY
@@ -152,65 +153,60 @@