update index.html #3
+19
-2
@@ -979,8 +979,25 @@
|
||||
const slotDisplay = protocol === "DMR" ? `TS${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";
|
||||
|
||||
// Formatta l'RSSI (nascondilo se è 0)
|
||||
const rssiDisplay = rawRssi && rawRssi !== 0 ? `${esc(rawRssi)} dBm` : '---';
|
||||
// Formatta l'RSSI con S-Meter grafico (nascondilo se è 0)
|
||||
let rssiDisplay = '---';
|
||||
if (rawRssi && rawRssi !== 0) {
|
||||
// Calcola la percentuale su un range utile di 80 dB (da -130 a -50 dBm)
|
||||
const pct = Math.max(0, Math.min(100, ((rawRssi + 130) / 80) * 100));
|
||||
|
||||
// Assegna il colore in stile S-Meter amatoriale
|
||||
let barColor = "var(--success)"; // Verde (fino a S9 / -93 dBm)
|
||||
if (rawRssi > -93) barColor = "#f59e0b"; // Giallo (S9+)
|
||||
if (rawRssi > -73) barColor = "var(--danger)"; // Rosso (S9+20 o superiore)
|
||||
|
||||
rssiDisplay = `
|
||||
<div style="display: flex; align-items: center; gap: 8px;" title="${esc(rawRssi)} dBm">
|
||||
<div style="width: 50px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);">
|
||||
<div style="width: ${pct}%; height: 100%; background: ${barColor}; transition: width 0.3s ease;"></div>
|
||||
</div>
|
||||
<span style="font-size: 0.85em; color: var(--text-muted); min-width: 3ch;">${esc(rawRssi)}</span>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (source.includes("🌐")) {
|
||||
if (!networkLogs[clientId]) networkLogs[clientId] = "";
|
||||
|
||||
Reference in New Issue
Block a user