diff --git a/templates/index.html b/templates/index.html index 143e311..def69ac 100644 --- a/templates/index.html +++ b/templates/index.html @@ -858,49 +858,6 @@ Stop Tracking - -
-

- ACARS Messaging - -

-
-
- Decode aircraft digital messages (ACARS) on VHF frequencies. -
-
- ⚠ Two SDRs Required
- ADS-B uses 1090 MHz, ACARS uses VHF (~131 MHz). To receive both simultaneously, you need two separate RTL-SDR devices. -
-
- - -
Comma-separated VHF ACARS frequencies
-
-
- - -
-
- - -
-
- - - -
-
- acarsdec:Checking... -
- - -
-
@@ -7378,113 +7335,8 @@ } // ============================================ - // ACARS Functions + // ACARS Output Helper (used by main sidebar) // ============================================ - let acarsEventSource = null; - let isAcarsRunning = false; - let acarsMessageCount = 0; - - function toggleAcarsPanel() { - const panel = document.getElementById('acarsPanel'); - const icon = document.getElementById('acarsToggleIcon'); - if (panel.style.display === 'none') { - panel.style.display = 'block'; - icon.innerHTML = '▼'; - } else { - panel.style.display = 'none'; - icon.innerHTML = '▶'; - } - } - - function setAcarsRegion(region) { - const freqInput = document.getElementById('acarsFrequencies'); - const regions = { - 'na': '129.125,130.025,130.450,131.550', - 'eu': '131.525,131.725,131.550', - 'ap': '131.550,131.450' - }; - freqInput.value = regions[region] || regions['na']; - } - - function checkAcarsTools() { - fetch('/acars/tools') - .then(r => r.json()) - .then(data => { - const status = document.getElementById('acarsdecStatus'); - if (data.acarsdec) { - status.textContent = 'OK'; - status.className = 'tool-status ok'; - } else { - status.textContent = 'Missing'; - status.className = 'tool-status missing'; - } - }) - .catch(() => { - const status = document.getElementById('acarsdecStatus'); - status.textContent = 'Error'; - status.className = 'tool-status missing'; - }); - } - - function startAcars() { - const frequencies = document.getElementById('acarsFrequencies').value.split(',').map(f => f.trim()); - const gain = document.getElementById('acarsGain').value; - const ppm = document.getElementById('acarsPpm').value; - const device = getSelectedDevice(); - - fetch('/acars/start', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ frequencies, gain, ppm, device }) - }) - .then(r => r.json()) - .then(data => { - if (data.status === 'started') { - isAcarsRunning = true; - acarsMessageCount = 0; - document.getElementById('startAcarsBtn').style.display = 'none'; - document.getElementById('stopAcarsBtn').style.display = 'block'; - startAcarsStream(); - } else { - alert('ACARS Error: ' + data.message); - } - }) - .catch(err => alert('ACARS Error: ' + err)); - } - - function stopAcars() { - fetch('/acars/stop', { method: 'POST' }) - .then(r => r.json()) - .then(data => { - isAcarsRunning = false; - document.getElementById('startAcarsBtn').style.display = 'block'; - document.getElementById('stopAcarsBtn').style.display = 'none'; - if (acarsEventSource) { - acarsEventSource.close(); - acarsEventSource = null; - } - }); - } - - function startAcarsStream() { - if (acarsEventSource) acarsEventSource.close(); - acarsEventSource = new EventSource('/acars/stream'); - - acarsEventSource.onmessage = function(e) { - const data = JSON.parse(e.data); - if (data.type === 'acars') { - acarsMessageCount++; - addAcarsToOutput(data); - } else if (data.type === 'error') { - console.error('ACARS error:', data.message); - } - }; - - acarsEventSource.onerror = function() { - console.error('ACARS stream error'); - }; - } - function addAcarsToOutput(data) { const output = document.getElementById('outputList'); const item = document.createElement('div');