Add New Zealand APRS frequency and custom frequency input

- Add New Zealand (144.575 MHz) to APRS region dropdown
- Add Argentina, Brazil, and China regions
- Add custom frequency input option for user-specified frequencies
- Custom frequency field shows/hides dynamically when selected
- Properly disable/enable custom frequency control during operation
- CSS improvements for nav element flex behavior

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-18 18:47:59 +00:00
parent 92984a7bae
commit 176014b706
2 changed files with 82 additions and 32 deletions
+4
View File
@@ -743,6 +743,7 @@ header h1 {
align-items: center; align-items: center;
gap: 12px; gap: 12px;
margin-left: auto; margin-left: auto;
flex-shrink: 0;
} }
@media (min-width: 1024px) { @media (min-width: 1024px) {
@@ -757,6 +758,8 @@ header h1 {
gap: 6px; gap: 6px;
font-family: 'JetBrains Mono', monospace; font-family: 'JetBrains Mono', monospace;
font-size: 11px; font-size: 11px;
flex-shrink: 0;
white-space: nowrap;
} }
.nav-clock .utc-label { .nav-clock .utc-label {
@@ -781,6 +784,7 @@ header h1 {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;
flex-shrink: 0;
} }
.nav-tool-btn { .nav-tool-btn {
+78 -32
View File
@@ -924,9 +924,18 @@
<option value="europe">Europe (144.800)</option> <option value="europe">Europe (144.800)</option>
<option value="uk">UK (144.800)</option> <option value="uk">UK (144.800)</option>
<option value="australia">Australia (145.175)</option> <option value="australia">Australia (145.175)</option>
<option value="new_zealand">New Zealand (144.575)</option>
<option value="argentina">Argentina (144.930)</option>
<option value="brazil">Brazil (145.570)</option>
<option value="japan">Japan (144.640)</option> <option value="japan">Japan (144.640)</option>
<option value="china">China (144.640)</option>
<option value="custom">Custom Frequency</option>
</select> </select>
</div> </div>
<div class="strip-control" id="aprsStripCustomFreqControl" style="display: none;">
<span class="strip-input-label">FREQ (MHz)</span>
<input type="number" id="aprsStripCustomFreq" class="strip-input" placeholder="144.390" step="0.001" min="144" max="146">
</div>
<div class="strip-control"> <div class="strip-control">
<span class="strip-input-label">GAIN</span> <span class="strip-input-label">GAIN</span>
<input type="number" id="aprsStripGain" class="strip-input" value="40" min="0" max="50"> <input type="number" id="aprsStripGain" class="strip-input" value="40" min="0" max="50">
@@ -6512,43 +6521,62 @@
const device = getSelectedDevice(); const device = getSelectedDevice();
const gain = document.getElementById('aprsStripGain').value; 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', { fetch('/aprs/start', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ region, device: parseInt(device), gain: parseInt(gain) }) body: JSON.stringify(requestBody)
}) })
.then(r => r.json()) .then(r => r.json())
.then(data => { .then(data => {
if (data.status === 'started') { if (data.status === 'started') {
isAprsRunning = true; isAprsRunning = true;
aprsPacketCount = 0; aprsPacketCount = 0;
aprsStationCount = 0; aprsStationCount = 0;
// Update function bar buttons // Update function bar buttons
document.getElementById('aprsStripStartBtn').style.display = 'none'; document.getElementById('aprsStripStartBtn').style.display = 'none';
document.getElementById('aprsStripStopBtn').style.display = 'inline-block'; document.getElementById('aprsStripStopBtn').style.display = 'inline-block';
// Update map status // Update map status
document.getElementById('aprsMapStatus').textContent = 'TRACKING'; document.getElementById('aprsMapStatus').textContent = 'TRACKING';
document.getElementById('aprsMapStatus').style.color = 'var(--accent-green)'; document.getElementById('aprsMapStatus').style.color = 'var(--accent-green)';
// Update function bar status // Update function bar status
updateAprsStatus('listening', data.frequency); updateAprsStatus('listening', data.frequency);
// Reset function bar stats // Reset function bar stats
document.getElementById('aprsStripStations').textContent = '0'; document.getElementById('aprsStripStations').textContent = '0';
document.getElementById('aprsStripPackets').textContent = '0'; document.getElementById('aprsStripPackets').textContent = '0';
document.getElementById('aprsStripSignal').textContent = '--'; document.getElementById('aprsStripSignal').textContent = '--';
// Disable controls while running // Disable controls while running
document.getElementById('aprsStripRegion').disabled = true; document.getElementById('aprsStripRegion').disabled = true;
document.getElementById('aprsStripGain').disabled = true; document.getElementById('aprsStripGain').disabled = true;
startAprsMeterCheck(); const customFreqInput = document.getElementById('aprsStripCustomFreq');
startAprsStream(); if (customFreqInput) customFreqInput.disabled = true;
} else { startAprsMeterCheck();
alert('APRS Error: ' + data.message); startAprsStream();
updateAprsStatus('error'); } else {
} alert('APRS Error: ' + data.message);
})
.catch(err => {
alert('APRS Error: ' + err);
updateAprsStatus('error'); updateAprsStatus('error');
}); }
})
.catch(err => {
alert('APRS Error: ' + err);
updateAprsStatus('error');
});
} }
function stopAprs() { function stopAprs() {
@@ -6569,6 +6597,8 @@
// Re-enable controls // Re-enable controls
document.getElementById('aprsStripRegion').disabled = false; document.getElementById('aprsStripRegion').disabled = false;
document.getElementById('aprsStripGain').disabled = false; document.getElementById('aprsStripGain').disabled = false;
const customFreqInput = document.getElementById('aprsStripCustomFreq');
if (customFreqInput) customFreqInput.disabled = false;
// Remove signal quality class // Remove signal quality class
const signalStat = document.getElementById('aprsStripSignalStat'); const signalStat = document.getElementById('aprsStripSignalStat');
if (signalStat) { 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) { function processAprsPacket(packet) {
// Update packet log // Update packet log
const logEl = document.getElementById('aprsPacketLog'); const logEl = document.getElementById('aprsPacketLog');