mirror of
https://github.com/Lissy93/dashy.git
synced 2025-10-28 18:03:53 +01:00
🔀 Merge pull request #1940 from rnowotniak/FIX/1939_Flights-widget-issues
Fix Flights.vue widget to work with the current aerodatabox API
This commit is contained in:
commit
8fea366703
@ -5,7 +5,7 @@
|
||||
Live {{ direction !== 'both' ? direction: 'flight' }} data from {{ airport }}
|
||||
</p>
|
||||
<!-- Departures -->
|
||||
<div v-if="departures.length > 0" class="flight-group">
|
||||
<div v-if="direction !== 'arrival' && departures.length > 0" class="flight-group">
|
||||
<h3 class="flight-type-subtitle" v-if="direction === 'both'">
|
||||
{{ $t('widgets.flight-data.departures') }}
|
||||
</h3>
|
||||
@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- Arrivals -->
|
||||
<div v-if="arrivals.length > 0" class="flight-group">
|
||||
<div v-if="direction !== 'departure' && arrivals.length > 0" class="flight-group">
|
||||
<h3 class="flight-type-subtitle" v-if="direction === 'both'">
|
||||
{{ $t('widgets.flight-data.arrivals') }}
|
||||
</h3>
|
||||
@ -137,10 +137,12 @@ export default {
|
||||
flights.forEach((flight) => {
|
||||
results.push({
|
||||
number: flight.number,
|
||||
airline: flight.airline.name,
|
||||
aircraft: flight.aircraft.model,
|
||||
airport: flight.movement.airport.name,
|
||||
time: flight.movement.actualTimeUtc,
|
||||
airline: flight.airline?.name ?? "unknown airline",
|
||||
aircraft: flight.aircraft?.model ?? "unknown aircraft",
|
||||
airport: flight.movement?.airport?.name ?? "unknown airport",
|
||||
time: flight.movement
|
||||
? (flight.movement?.revisedTime?.local ?? flight.movement?.scheduledTime?.local ?? "unknown time")
|
||||
: "unknown time"
|
||||
});
|
||||
});
|
||||
return results;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user