Getting there

This commit is contained in:
2025-12-12 11:18:28 -05:00
parent f7467690e4
commit dbb285fa20
15 changed files with 1080 additions and 36 deletions

View File

@@ -234,9 +234,9 @@
const data = JSON.parse(event.data);
console.log('WebSocket message received:', data);
// Refresh display when any PPR-related event occurs
if (data.type && (data.type.includes('ppr_') || data.type === 'status_update')) {
console.log('PPR update detected, refreshing display...');
// Refresh display when any PPR-related or local flight event occurs
if (data.type && (data.type.includes('ppr_') || data.type === 'status_update' || data.type.includes('local_flight_'))) {
console.log('Flight update detected, refreshing display...');
loadArrivals();
loadDepartures();
}
@@ -375,6 +375,7 @@
// Build rows asynchronously to lookup airport names
const rows = await Promise.all(departures.map(async (departure) => {
const isLocal = departure.isLocalFlight;
const isDeparture = departure.isDeparture;
if (isLocal) {
// Local flight
@@ -384,6 +385,21 @@
const time = convertToLocalTime(departure.etd);
const timeDisplay = `<div>${escapeHtml(time)}</div>`;
return `
<tr>
<td>${aircraftDisplay}</td>
<td>${toDisplay}</td>
<td>${timeDisplay}</td>
</tr>
`;
} else if (isDeparture) {
// Departure to other airport
const aircraftId = departure.ac_call || departure.ac_reg || '';
const aircraftDisplay = `${escapeHtml(aircraftId)} <span style="font-size: 0.8em; color: #666;">(${escapeHtml(departure.ac_type || '')})</span>`;
const toDisplay = await getAirportName(departure.out_to || '');
const time = convertToLocalTime(departure.etd);
const timeDisplay = `<div>${escapeHtml(time)}</div>`;
return `
<tr>
<td>${aircraftDisplay}</td>