feat(slm): replace Lmin/Lpeak with configurable Ln1/Ln2 percentile slots
Live SLM display (dashboard + unit detail) now shows two configurable percentile slots instead of Lmin/Lpeak. Values come from `ln1`/`ln2`; labels come from `ln1_label`/`ln2_label` (default L1/L10), so a future job can reconfigure the device's Ln slots to any percentile without a Terra-View redeploy. Contract for SLMM: emit ln1/ln2 (+ optional ln1_label/ln2_label) in both the /status data dict and the DRD stream payload. No Terra-View Python changes needed — proxy WS and current_status are transparent passthroughs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -173,17 +173,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-purple-50 dark:bg-purple-900/20 rounded-lg p-4">
|
<div class="bg-purple-50 dark:bg-purple-900/20 rounded-lg p-4">
|
||||||
<p class="text-xs text-gray-600 dark:text-gray-400 mb-1">Lmin (Min)</p>
|
<p id="live-ln1-label" class="text-xs text-gray-600 dark:text-gray-400 mb-1">{% if current_status and current_status.ln1_label %}{{ current_status.ln1_label }}{% else %}L1{% endif %}</p>
|
||||||
<p id="live-lmin" class="text-2xl font-bold text-purple-600 dark:text-purple-400">
|
<p id="live-ln1" class="text-2xl font-bold text-purple-600 dark:text-purple-400">
|
||||||
{% if current_status and current_status.lmin %}{{ current_status.lmin }}{% else %}--{% endif %}
|
{% if current_status and current_status.ln1 %}{{ current_status.ln1 }}{% else %}--{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p class="text-xs text-gray-500 dark:text-gray-400">dB</p>
|
<p class="text-xs text-gray-500 dark:text-gray-400">dB</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-orange-50 dark:bg-orange-900/20 rounded-lg p-4">
|
<div class="bg-orange-50 dark:bg-orange-900/20 rounded-lg p-4">
|
||||||
<p class="text-xs text-gray-600 dark:text-gray-400 mb-1">Lpeak (Peak)</p>
|
<p id="live-ln2-label" class="text-xs text-gray-600 dark:text-gray-400 mb-1">{% if current_status and current_status.ln2_label %}{{ current_status.ln2_label }}{% else %}L10{% endif %}</p>
|
||||||
<p id="live-lpeak" class="text-2xl font-bold text-orange-600 dark:text-orange-400">
|
<p id="live-ln2" class="text-2xl font-bold text-orange-600 dark:text-orange-400">
|
||||||
{% if current_status and current_status.lpeak %}{{ current_status.lpeak }}{% else %}--{% endif %}
|
{% if current_status and current_status.ln2 %}{{ current_status.ln2 }}{% else %}--{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p class="text-xs text-gray-500 dark:text-gray-400">dB</p>
|
<p class="text-xs text-gray-500 dark:text-gray-400">dB</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -570,11 +570,17 @@ function updateLiveMetrics(data) {
|
|||||||
if (document.getElementById('live-lmax')) {
|
if (document.getElementById('live-lmax')) {
|
||||||
document.getElementById('live-lmax').textContent = data.lmax || '--';
|
document.getElementById('live-lmax').textContent = data.lmax || '--';
|
||||||
}
|
}
|
||||||
if (document.getElementById('live-lmin')) {
|
if (document.getElementById('live-ln1')) {
|
||||||
document.getElementById('live-lmin').textContent = data.lmin || '--';
|
document.getElementById('live-ln1').textContent = data.ln1 || '--';
|
||||||
}
|
}
|
||||||
if (document.getElementById('live-lpeak')) {
|
if (data.ln1_label && document.getElementById('live-ln1-label')) {
|
||||||
document.getElementById('live-lpeak').textContent = data.lpeak || '--';
|
document.getElementById('live-ln1-label').textContent = data.ln1_label;
|
||||||
|
}
|
||||||
|
if (document.getElementById('live-ln2')) {
|
||||||
|
document.getElementById('live-ln2').textContent = data.ln2 || '--';
|
||||||
|
}
|
||||||
|
if (data.ln2_label && document.getElementById('live-ln2-label')) {
|
||||||
|
document.getElementById('live-ln2-label').textContent = data.ln2_label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,14 +81,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-purple-50 dark:bg-purple-900/20 rounded-lg p-4">
|
<div class="bg-purple-50 dark:bg-purple-900/20 rounded-lg p-4">
|
||||||
<p class="text-xs text-gray-600 dark:text-gray-400 mb-1">Lmin (Min)</p>
|
<p id="chart-ln1-label" class="text-xs text-gray-600 dark:text-gray-400 mb-1">L1</p>
|
||||||
<p id="chart-lmin" class="text-2xl font-bold text-purple-600 dark:text-purple-400">--</p>
|
<p id="chart-ln1" class="text-2xl font-bold text-purple-600 dark:text-purple-400">--</p>
|
||||||
<p class="text-xs text-gray-500 dark:text-gray-400">dB</p>
|
<p class="text-xs text-gray-500 dark:text-gray-400">dB</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-orange-50 dark:bg-orange-900/20 rounded-lg p-4">
|
<div class="bg-orange-50 dark:bg-orange-900/20 rounded-lg p-4">
|
||||||
<p class="text-xs text-gray-600 dark:text-gray-400 mb-1">Lpeak (Peak)</p>
|
<p id="chart-ln2-label" class="text-xs text-gray-600 dark:text-gray-400 mb-1">L10</p>
|
||||||
<p id="chart-lpeak" class="text-2xl font-bold text-orange-600 dark:text-orange-400">--</p>
|
<p id="chart-ln2" class="text-2xl font-bold text-orange-600 dark:text-orange-400">--</p>
|
||||||
<p class="text-xs text-gray-500 dark:text-gray-400">dB</p>
|
<p class="text-xs text-gray-500 dark:text-gray-400">dB</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -322,8 +322,10 @@ function updateDashboardMetrics(data) {
|
|||||||
document.getElementById('chart-lp').textContent = data.lp || '--';
|
document.getElementById('chart-lp').textContent = data.lp || '--';
|
||||||
document.getElementById('chart-leq').textContent = data.leq || '--';
|
document.getElementById('chart-leq').textContent = data.leq || '--';
|
||||||
document.getElementById('chart-lmax').textContent = data.lmax || '--';
|
document.getElementById('chart-lmax').textContent = data.lmax || '--';
|
||||||
document.getElementById('chart-lmin').textContent = data.lmin || '--';
|
document.getElementById('chart-ln1').textContent = data.ln1 || '--';
|
||||||
document.getElementById('chart-lpeak').textContent = data.lpeak || '--';
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDashboardChart(data) {
|
function updateDashboardChart(data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user