Simplify calibration status text in sidebar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ruslan Bakiev
2026-03-06 13:57:35 +07:00
parent f54bc165f6
commit b87665e8bc

View File

@@ -302,8 +302,7 @@
<div class="sidebar-panel">
<button class="btn-calibrate" id="btnCalibrate" onclick="doCalibrate()">Calibrate Court</button>
<div class="calibrate-status" id="calStatus">
CAM 0: <span id="calStatus0">--</span><br>
CAM 1: <span id="calStatus1">--</span>
<span id="calStatusText">Not calibrated</span>
</div>
</div>
</div>
@@ -396,12 +395,18 @@ function updateCalibrationStatus() {
fetch('/api/calibration/status')
.then(function(r) { return r.json(); })
.then(function(data) {
var s0 = document.getElementById('calStatus0');
var s1 = document.getElementById('calStatus1');
s0.textContent = data['0'] ? 'OK' : 'not calibrated';
s0.className = data['0'] ? 'ok' : '';
s1.textContent = data['1'] ? 'OK' : 'not calibrated';
s1.className = data['1'] ? 'ok' : '';
var el = document.getElementById('calStatusText');
var ok0 = data['0'], ok1 = data['1'];
if (ok0 && ok1) {
el.textContent = 'Calibrated';
el.className = 'ok';
} else if (ok0 || ok1) {
el.textContent = 'Partially calibrated';
el.className = 'ok';
} else {
el.textContent = 'Not calibrated';
el.className = '';
}
});
}
// Check on load