fix(dashboard): refactoring colonne Target e REF/SLOT

- Separata la destinazione radio (Target) dall'infrastruttura di rete (REF/SLOT).
- Risolto il bug dei moduli D-STAR troncati causato dai beacon INFO locali di MMDVMHost.
- La colonna Target ora mostra l'UR CALL reale, mentre REF/SLOT usa in modo esclusivo la memoria di linking iniziale.
- Aggiornati index.html (nuova UI) e la logica di parsing/salvataggio in app.py.
This commit is contained in:
2026-10-20 14:27:47 +02:00
parent 445cc5e97d
commit cae5c4ea83
2 changed files with 27 additions and 11 deletions
+18 -9
View File
@@ -567,21 +567,30 @@ def on_message(client, userdata, msg):
elif k == 'P25': src = get_call(p.get('src_id', '---'), 'DMR')
else: src = str(p.get('Callsign', p.get('src_callsign', p.get('src_info', p.get('src_id', '---')))))
t_list = [p.get('reflector'), p.get('dst_callsign'), p.get('dst_id')]
current_target = next((str(x).strip() for x in t_list if x and str(x).strip() not in ['', '---', '0', 'CQCQCQ']), None)
# --- NUOVA GESTIONE TARGET VS REF/SLOT ---
current_target = str(p.get('dst_callsign', p.get('dst_id', ''))).strip()
if not current_target or current_target == cid.upper():
target = last_seen_reflector.get(f"{cid}_{name}", "---")
if name == 'D-STAR':
target = current_target if current_target else "---"
ref_slot = last_seen_reflector.get(f"{cid}_{name}", "---")
else:
target = current_target
target = current_target if current_target else "---"
raw_slot = p.get('slot', '')
ref_slot = str(raw_slot) if raw_slot != '' else "---"
active_calls[cid][k] = {'src': src, 'dst': target, 'ext': str(p.get('src_ext', ''))}
client_telemetry[cid].update({"ts1":"","ts2":"","alt": f"{ico} {name}: {src} ➔ {target}"})
active_calls[cid][k] = {'src': src, 'dst': target, 'slot': ref_slot, 'ext': str(p.get('src_ext', ''))}
# Aggiorniamo anche la stringa telemetrica visuale per la dashboard
client_telemetry[cid].update({"ts1":"","ts2":"","alt": f"{ico} {name}: {src} ➔ {target} ({ref_slot})"})
notify_update()
elif act in ['end', 'lost']:
info = active_calls[cid].get(k, {'src': '---', 'dst': '---', 'ext': ''})
p.update({'src_id': info['src'], 'dst_id': info['dst'], 'src_ext': info['ext']})
# Estraiamo anche la variabile 'slot' memorizzata prima
info = active_calls[cid].get(k, {'src': '---', 'dst': '---', 'slot': '---', 'ext': ''})
# Forziamo l'inserimento dello slot nel dizionario 'p' che verrà salvato nel DB
p.update({'src_id': info['src'], 'dst_id': info['dst'], 'slot': info['slot'], 'src_ext': info['ext']})
save_to_sqlite(cid, p, protocol=name)
client_telemetry[cid]["alt"] = f"{'✅' if act=='end' else '⚠️'} {name}: {info['src']}"
save_cache(client_telemetry)
+9 -2
View File
@@ -236,7 +236,7 @@
<th data-i18n="thTime">Time</th>
<th data-i18n="thRep">Repeater</th>
<th data-i18n="thMode">Mode</th>
<th style="text-align: center;">Slot</th>
<th style="text-align: center;">REF / SLOT</th>
<th data-i18n="thCall">Callsign</th>
<th>Target / TG</th>
<th data-i18n="thDur">Duration</th>
@@ -1021,7 +1021,14 @@
let sourceHtml = esc(source);
if (source_ext && source_ext.trim() !== "") { sourceHtml += ` <span style="font-size:0.8em; color:#94a3b8; font-family:'JetBrains Mono', monospace;">/${esc(source_ext)}</span>`; }
const slotDisplay = protocol === "DMR" ? `TS${rawSlot}` : "--";
let slotDisplay = "---";
if (rawSlot && String(rawSlot).trim() !== "" && rawSlot !== "undefined") {
if (protocol === "DMR" && !String(rawSlot).toUpperCase().startsWith("TS")) {
slotDisplay = `TS${rawSlot}`;
} else {
slotDisplay = 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 con S-Meter grafico a segmenti