diff --git a/static/css/index.css b/static/css/index.css index 61437ab..42d1477 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -743,6 +743,7 @@ header h1 { align-items: center; gap: 12px; margin-left: auto; + flex-shrink: 0; } @media (min-width: 1024px) { @@ -757,6 +758,8 @@ header h1 { gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: 11px; + flex-shrink: 0; + white-space: nowrap; } .nav-clock .utc-label { @@ -781,6 +784,7 @@ header h1 { display: flex; align-items: center; gap: 4px; + flex-shrink: 0; } .nav-tool-btn { diff --git a/templates/index.html b/templates/index.html index cc80149..bf4ee39 100644 --- a/templates/index.html +++ b/templates/index.html @@ -924,9 +924,18 @@ + + + + + +
GAIN @@ -6512,43 +6521,62 @@ const device = getSelectedDevice(); const gain = document.getElementById('aprsStripGain').value; + // Build request body + const requestBody = { + region, + device: parseInt(device), + gain: parseInt(gain) + }; + + // Add custom frequency if selected + if (region === 'custom') { + const customFreq = document.getElementById('aprsStripCustomFreq').value; + if (!customFreq) { + alert('Please enter a custom frequency'); + return; + } + requestBody.frequency = customFreq; + } + fetch('/aprs/start', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ region, device: parseInt(device), gain: parseInt(gain) }) + body: JSON.stringify(requestBody) }) - .then(r => r.json()) - .then(data => { - if (data.status === 'started') { - isAprsRunning = true; - aprsPacketCount = 0; - aprsStationCount = 0; - // Update function bar buttons - document.getElementById('aprsStripStartBtn').style.display = 'none'; - document.getElementById('aprsStripStopBtn').style.display = 'inline-block'; - // Update map status - document.getElementById('aprsMapStatus').textContent = 'TRACKING'; - document.getElementById('aprsMapStatus').style.color = 'var(--accent-green)'; - // Update function bar status - updateAprsStatus('listening', data.frequency); - // Reset function bar stats - document.getElementById('aprsStripStations').textContent = '0'; - document.getElementById('aprsStripPackets').textContent = '0'; - document.getElementById('aprsStripSignal').textContent = '--'; - // Disable controls while running - document.getElementById('aprsStripRegion').disabled = true; - document.getElementById('aprsStripGain').disabled = true; - startAprsMeterCheck(); - startAprsStream(); - } else { - alert('APRS Error: ' + data.message); - updateAprsStatus('error'); - } - }) - .catch(err => { - alert('APRS Error: ' + err); + .then(r => r.json()) + .then(data => { + if (data.status === 'started') { + isAprsRunning = true; + aprsPacketCount = 0; + aprsStationCount = 0; + // Update function bar buttons + document.getElementById('aprsStripStartBtn').style.display = 'none'; + document.getElementById('aprsStripStopBtn').style.display = 'inline-block'; + // Update map status + document.getElementById('aprsMapStatus').textContent = 'TRACKING'; + document.getElementById('aprsMapStatus').style.color = 'var(--accent-green)'; + // Update function bar status + updateAprsStatus('listening', data.frequency); + // Reset function bar stats + document.getElementById('aprsStripStations').textContent = '0'; + document.getElementById('aprsStripPackets').textContent = '0'; + document.getElementById('aprsStripSignal').textContent = '--'; + // Disable controls while running + document.getElementById('aprsStripRegion').disabled = true; + document.getElementById('aprsStripGain').disabled = true; + const customFreqInput = document.getElementById('aprsStripCustomFreq'); + if (customFreqInput) customFreqInput.disabled = true; + startAprsMeterCheck(); + startAprsStream(); + } else { + alert('APRS Error: ' + data.message); updateAprsStatus('error'); - }); + } + }) + .catch(err => { + alert('APRS Error: ' + err); + updateAprsStatus('error'); + }); } function stopAprs() { @@ -6569,6 +6597,8 @@ // Re-enable controls document.getElementById('aprsStripRegion').disabled = false; document.getElementById('aprsStripGain').disabled = false; + const customFreqInput = document.getElementById('aprsStripCustomFreq'); + if (customFreqInput) customFreqInput.disabled = false; // Remove signal quality class const signalStat = document.getElementById('aprsStripSignalStat'); if (signalStat) { @@ -6677,6 +6707,22 @@ } } + // Handle region selection changes to show/hide custom frequency input + document.addEventListener('DOMContentLoaded', function() { + const regionSelect = document.getElementById('aprsStripRegion'); + const customFreqControl = document.getElementById('aprsStripCustomFreqControl'); + + if (regionSelect && customFreqControl) { + regionSelect.addEventListener('change', function() { + if (this.value === 'custom') { + customFreqControl.style.display = 'flex'; + } else { + customFreqControl.style.display = 'none'; + } + }); + } + }); + function processAprsPacket(packet) { // Update packet log const logEl = document.getElementById('aprsPacketLog');