fix(slm): don't blank L1/L10 on percentile-less live-stream frames
The DRD stream carries Lp/Leq/Lmax but not the Ln percentiles (those come from DOD polling), so updateLiveMetrics/updateDashboardMetrics were overwriting the DOD-sourced L1/L10 values with '--' on every stream frame. Guard the value updates on `data.lnN != null` so a frame without the key leaves the existing value intact — mirrors the existing label guards. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -322,8 +322,10 @@ function updateDashboardMetrics(data) {
|
||||
document.getElementById('chart-lp').textContent = data.lp || '--';
|
||||
document.getElementById('chart-leq').textContent = data.leq || '--';
|
||||
document.getElementById('chart-lmax').textContent = data.lmax || '--';
|
||||
document.getElementById('chart-ln1').textContent = data.ln1 || '--';
|
||||
document.getElementById('chart-ln2').textContent = data.ln2 || '--';
|
||||
// Guard: DRD stream frames omit percentiles, so only overwrite when present
|
||||
// (else the live stream blanks L1/L10 over the cached DOD snapshot values).
|
||||
if (data.ln1 != null) document.getElementById('chart-ln1').textContent = data.ln1;
|
||||
if (data.ln2 != null) document.getElementById('chart-ln2').textContent = data.ln2;
|
||||
if (data.ln1_label) document.getElementById('chart-ln1-label').textContent = data.ln1_label;
|
||||
if (data.ln2_label) document.getElementById('chart-ln2-label').textContent = data.ln2_label;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user