Simplify calibration status text in sidebar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -302,8 +302,7 @@
|
|||||||
<div class="sidebar-panel">
|
<div class="sidebar-panel">
|
||||||
<button class="btn-calibrate" id="btnCalibrate" onclick="doCalibrate()">Calibrate Court</button>
|
<button class="btn-calibrate" id="btnCalibrate" onclick="doCalibrate()">Calibrate Court</button>
|
||||||
<div class="calibrate-status" id="calStatus">
|
<div class="calibrate-status" id="calStatus">
|
||||||
CAM 0: <span id="calStatus0">--</span><br>
|
<span id="calStatusText">Not calibrated</span>
|
||||||
CAM 1: <span id="calStatus1">--</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -396,12 +395,18 @@ function updateCalibrationStatus() {
|
|||||||
fetch('/api/calibration/status')
|
fetch('/api/calibration/status')
|
||||||
.then(function(r) { return r.json(); })
|
.then(function(r) { return r.json(); })
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
var s0 = document.getElementById('calStatus0');
|
var el = document.getElementById('calStatusText');
|
||||||
var s1 = document.getElementById('calStatus1');
|
var ok0 = data['0'], ok1 = data['1'];
|
||||||
s0.textContent = data['0'] ? 'OK' : 'not calibrated';
|
if (ok0 && ok1) {
|
||||||
s0.className = data['0'] ? 'ok' : '';
|
el.textContent = 'Calibrated';
|
||||||
s1.textContent = data['1'] ? 'OK' : 'not calibrated';
|
el.className = 'ok';
|
||||||
s1.className = data['1'] ? 'ok' : '';
|
} else if (ok0 || ok1) {
|
||||||
|
el.textContent = 'Partially calibrated';
|
||||||
|
el.className = 'ok';
|
||||||
|
} else {
|
||||||
|
el.textContent = 'Not calibrated';
|
||||||
|
el.className = '';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Check on load
|
// Check on load
|
||||||
|
|||||||
Reference in New Issue
Block a user