mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
fix: Pass bias-T setting to ADS-B and AIS dashboards
The bias-T checkbox on the main dashboard was not being passed to the ADS-B and AIS tracking start requests. Added getBiasTEnabled() helper to each dashboard that reads from shared localStorage, and updated all start request bodies to include bias_t parameter. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -316,6 +316,13 @@
|
||||
</main>
|
||||
|
||||
<script>
|
||||
// ============================================
|
||||
// BIAS-T HELPER (reads from main dashboard localStorage)
|
||||
// ============================================
|
||||
function getBiasTEnabled() {
|
||||
return localStorage.getItem('biasTEnabled') === 'true';
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// STATE
|
||||
// ============================================
|
||||
@@ -2424,7 +2431,8 @@ sudo make install</code>
|
||||
const adsbDevice = parseInt(document.getElementById('adsbDeviceSelect').value) || 0;
|
||||
|
||||
const requestBody = {
|
||||
device: adsbDevice
|
||||
device: adsbDevice,
|
||||
bias_t: getBiasTEnabled()
|
||||
};
|
||||
if (remoteConfig) {
|
||||
requestBody.remote_sbs_host = remoteConfig.host;
|
||||
@@ -2605,7 +2613,7 @@ sudo make install</code>
|
||||
const startResponse = await fetch('/adsb/start', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ device: device })
|
||||
body: JSON.stringify({ device: device, bias_t: getBiasTEnabled() })
|
||||
});
|
||||
|
||||
const result = await startResponse.json();
|
||||
|
||||
@@ -240,6 +240,11 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Bias-T helper (reads from main dashboard localStorage)
|
||||
function getBiasTEnabled() {
|
||||
return localStorage.getItem('biasTEnabled') === 'true';
|
||||
}
|
||||
|
||||
const historyEnabled = {{ 'true' if history_enabled else 'false' }};
|
||||
|
||||
const summaryMessages = document.getElementById('summaryMessages');
|
||||
@@ -632,7 +637,7 @@
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({ device, source: 'adsb_history' })
|
||||
body: JSON.stringify({ device, source: 'adsb_history', bias_t: getBiasTEnabled() })
|
||||
});
|
||||
if (!resp.ok) {
|
||||
sessionNotice.textContent = 'Start failed';
|
||||
|
||||
@@ -190,6 +190,11 @@
|
||||
</main>
|
||||
|
||||
<script>
|
||||
// Bias-T helper (reads from main dashboard localStorage)
|
||||
function getBiasTEnabled() {
|
||||
return localStorage.getItem('biasTEnabled') === 'true';
|
||||
}
|
||||
|
||||
// State
|
||||
let vesselMap = null;
|
||||
let vessels = {};
|
||||
@@ -542,7 +547,7 @@
|
||||
fetch(`/controller/agents/${aisCurrentAgent}/ais/start`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ device, gain })
|
||||
body: JSON.stringify({ device, gain, bias_t: getBiasTEnabled() })
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(result => {
|
||||
@@ -567,7 +572,7 @@
|
||||
fetch('/ais/start', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ device, gain })
|
||||
body: JSON.stringify({ device, gain, bias_t: getBiasTEnabled() })
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
@@ -1619,7 +1624,7 @@
|
||||
fetch(`/controller/agents/${aisCurrentAgent}/ais/start`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ device, gain })
|
||||
body: JSON.stringify({ device, gain, bias_t: getBiasTEnabled() })
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
fetch('/ais/start', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ device, gain })
|
||||
body: JSON.stringify({ device, gain, bias_t: typeof getBiasTEnabled === 'function' ? getBiasTEnabled() : false })
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
|
||||
Reference in New Issue
Block a user