Fix orbit track to use selected pass's satellite, not dropdown

Bug: Both files were fetching orbit data for the dropdown-selected
satellite instead of the satellite from the selected pass.

Fixes:
- satellite_dashboard.html: updateRealTimePositions() now uses
  passes[selectedPass].satellite instead of selectedSatellite
- index.html: updateRealTimePosition() now ensures the selected
  pass's satellite is included in the position request, and added
  includeTrack: true to get orbit data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
James Smith
2025-12-30 15:26:23 +00:00
parent 0f6f642fd9
commit ebe0bf9431
2 changed files with 22 additions and 4 deletions

View File

@@ -1344,7 +1344,17 @@
async function updateRealTimePositions() {
const lat = parseFloat(document.getElementById('obsLat').value);
const lon = parseFloat(document.getElementById('obsLon').value);
const satColor = satellites[selectedSatellite]?.color || '#00d4ff';
// Use satellite from selected pass, or fall back to dropdown selection
let targetSatellite = selectedSatellite;
let satColor = satellites[selectedSatellite]?.color || '#00d4ff';
if (selectedPass !== null && passes[selectedPass]) {
const pass = passes[selectedPass];
// Use the satellite name from the pass (backend accepts names or NORAD IDs)
targetSatellite = pass.satellite;
satColor = pass.color || satColor;
}
try {
const response = await fetch('/satellite/position', {
@@ -1353,7 +1363,7 @@
body: JSON.stringify({
latitude: lat,
longitude: lon,
satellites: [selectedSatellite],
satellites: [targetSatellite],
includeTrack: true
})
});