From 79469c02cff38ff9a086ee7703b666d078973009 Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 7 Apr 2026 18:11:12 +1000 Subject: [PATCH] Started a flight view --- .../2026_04_07_072737_add_municipality.php | 113 ++++++ .../Components/FlightsGoneBy/AirlineLogo.vue | 29 ++ .../FlightsGoneBy/FlightClassBadge.vue | 103 +++++ resources/js/Pages/Dashboard.vue | 2 +- resources/js/Pages/FlightProfile.vue | 364 ++++++++++++++---- resources/js/Types/types.d.ts | 73 ++++ 6 files changed, 600 insertions(+), 84 deletions(-) create mode 100644 database/migrations/2026_04_07_072737_add_municipality.php create mode 100644 resources/js/Components/FlightsGoneBy/AirlineLogo.vue create mode 100644 resources/js/Components/FlightsGoneBy/FlightClassBadge.vue diff --git a/database/migrations/2026_04_07_072737_add_municipality.php b/database/migrations/2026_04_07_072737_add_municipality.php new file mode 100644 index 0000000..a5755be --- /dev/null +++ b/database/migrations/2026_04_07_072737_add_municipality.php @@ -0,0 +1,113 @@ +update(['municipality' => 'Lizard Island']); + Airport::where('iata_code', 'SYD')->update(['municipality' => 'Sydney']); + Airport::where('iata_code', 'ISB')->update(['municipality' => 'Islamabad']); + Airport::where('iata_code', 'KUL')->update(['municipality' => 'Kuala Lumpur']); + Airport::where('iata_code', 'USM')->update(['municipality' => 'Ko Samui']); + Airport::where('iata_code', 'CDG')->update(['municipality' => 'Paris']); + Airport::where('iata_code', 'ORY')->update(['municipality' => 'Paris']); + Airport::where('iata_code', 'FRA')->update(['municipality' => 'Frankfurt']); + Airport::where('iata_code', 'EZE')->update(['municipality' => 'Buenos Aires']); + Airport::where('iata_code', 'PVG')->update(['municipality' => 'Shanghai']); + Airport::where('iata_code', 'MRU')->update(['municipality' => 'Mauritius']); + Airport::where('iata_code', 'HNL')->update(['municipality' => 'Honolulu']); + Airport::where('iata_code', 'NCL')->update(['municipality' => 'Newcastle upon Tyne']); + Airport::where('iata_code', 'KRK')->update(['municipality' => 'Krakow']); + Airport::where('iata_code', 'OTP')->update(['municipality' => 'Bucharest']); + Airport::where('iata_code', 'CAN')->update(['municipality' => 'Guangzhou']); + Airport::where('iata_code', 'XIY')->update(['municipality' => "Xi'an"]); + Airport::where('iata_code', 'ROR')->update(['municipality' => "Koror"]); + Airport::where('iata_code', 'WUH')->update(['municipality' => "Wuhan"]); + Airport::where('iata_code', 'CCS')->update(['municipality' => "Caracas"]); + Airport::where('iata_code', 'TFU')->update(['municipality' => "Chengdu"]); + Airport::where('iata_code', 'CTU')->update(['municipality' => "Chengdu"]); + Airport::where('iata_code', 'DMM')->update(['municipality' => "Dammam"]); + Airport::where('iata_code', 'VCE')->update(['municipality' => "Venice"]); + Airport::where('iata_code', 'MXP')->update(['municipality' => "Milan"]); + Airport::where('iata_code', 'DPS')->update(['municipality' => "Denpasar"]); + Airport::where('iata_code', 'CAY')->update(['municipality' => "Cayenne"]); + Airport::where('iata_code', 'LPA')->update(['municipality' => "Gran Canaria"]); + + Airline::where('internal_name', 'thy-turkish-airlines')->update(['name' => 'Turkish Airlines']); + Airline::where('internal_name', 'air-china')->update(['name' => 'Air China']); + Airline::where('internal_name', 'jetstar-airways-pty')->update(['name' => 'Jetstar']); + Airline::where('internal_name', 'easyjet')->update(['name' => 'Easyjet']); + Airline::where('internal_name', 'china-west-air')->update(['name' => 'China West Air']); + Airline::where('internal_name', 'aeroenlaces-nacionales-s-a-de-c-v')->update(['name' => 'Viva']); + Airline::where('internal_name', 'aircompany-somon-air')->update(['name' => 'Somon Air']); + Airline::where('internal_name', 'hinterland-aviation-pty')->update(['name' => 'Hinterland Aviation']); + Airline::where('internal_name', 'mango-airlines-soc-trading-as-mango')->update(['name' => 'Mango']); + Airline::where('internal_name', 'air-manas-dba-air-manas-air')->update(['name' => 'Air Manas']); + Airline::where('internal_name', 'airasia-x-berhad-dba-airasia-x')->update(['name' => 'Air Asia X']); + Airline::where('internal_name', 'mesa-airlines')->update(['name' => 'Mesa Airlines']); + Airport::where('iata_code', 'MCT')->update(['municipality' => "Muscat"]); + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Airport::where('iata_code', 'LZR')->update(['municipality' => '']); + Airport::where('iata_code', 'SYD')->update(['municipality' => 'Sydney (Mascot)']); + Airport::where('iata_code', 'ISB')->update(['municipality' => 'Attock']); + Airport::where('iata_code', 'KUL')->update(['municipality' => 'Sepang']); + Airport::where('iata_code', 'USM')->update(['municipality' => 'Na Thon (Ko Samui Island)']); + Airport::where('iata_code', 'CDG')->update(['municipality' => "Paris (Roissy-en-France, Val-d'Oise)"]); + Airport::where('iata_code', 'ORY')->update(['municipality' => "Paris (Orly, Val-de-Marne)"]); + Airport::where('iata_code', 'FRA')->update(['municipality' => 'Frankfurt am Main']); + Airport::where('iata_code', 'EZE')->update(['municipality' => 'Buenos Aires (Ezeiza)']); + Airport::where('iata_code', 'PVG')->update(['municipality' => 'Shanghai (Pudong)']); + Airport::where('iata_code', 'MRU')->update(['municipality' => 'Plaine Magnien']); + Airport::where('iata_code', 'HNL')->update(['municipality' => 'Honolulu, Oahu']); + Airport::where('iata_code', 'NCL')->update(['municipality' => 'Newcastle upon Tyne, Tyne and Wear']); + Airport::where('iata_code', 'KRK')->update(['municipality' => 'Balice']); + Airport::where('iata_code', 'OTP')->update(['municipality' => 'Otopeni']); + Airport::where('iata_code', 'CAN')->update(['municipality' => 'Guangzhou (Huadu)']); + Airport::where('iata_code', 'XIY')->update(['municipality' => "Xianyang (Weicheng)"]); + Airport::where('iata_code', 'ROR')->update(['municipality' => "Babelthuap Island"]); + Airport::where('iata_code', 'WUH')->update(['municipality' => "Wuhan (Huangpi)"]); + Airport::where('iata_code', 'CCS')->update(['municipality' => "Maiquetía"]); + Airport::where('iata_code', 'TFU')->update(['municipality' => "Chengdu (Jianyang)"]); + Airport::where('iata_code', 'CTU')->update(['municipality' => "Chengdu (Shuangliu)"]); + Airport::where('iata_code', 'DMM')->update(['municipality' => "Ad Dammam"]); + Airport::where('iata_code', 'VCE')->update(['municipality' => "Venezia (VE)"]); + Airport::where('iata_code', 'MXP')->update(['municipality' => "Ferno (VA)"]); + Airport::where('iata_code', 'DPS')->update(['municipality' => "Kuta, Badung"]); + Airport::where('iata_code', 'CAY')->update(['municipality' => "Matoury"]); + Airport::where('iata_code', 'LPA')->update(['municipality' => "Gran Canaria Island"]); + Airport::where('iata_code', 'MCT')->update(['municipality' => "Muscat/Seeb"]); + + + Airline::where('internal_name', 'thy-turkish-airlines')->update(['name' => ' THY - Turkish Airlines']); + Airline::where('internal_name', 'air-china')->update(['name' => 'Air China Limited']); + Airline::where('internal_name', 'jetstar-airways-pty')->update(['name' => 'Jetstar Airways Pty Limited']); + Airline::where('internal_name', 'easyjet')->update(['name' => 'Easyjet Airline Company Limited']); + Airline::where('internal_name', 'china-west-air')->update(['name' => 'China West Air Co. Ltd.']); + Airline::where('internal_name', 'aeroenlaces-nacionales-s-a-de-c-v')->update(['name' => 'Aeroenlaces Nacionales S.A. De C.V.']); + Airline::where('internal_name', 'aircompany-somon-air')->update(['name' => 'Aircompany Somon Air LLC']); + Airline::where('internal_name', 'hinterland-aviation-pty')->update(['name' => 'Hinterland Aviation Pty Ltd']); + Airline::where('internal_name', 'mango-airlines-soc-trading-as-mango')->update(['name' => 'Mango Airlines (SOC) Ltd trading as MANGO']); + Airline::where('internal_name', 'air-manas-dba-air-manas-air')->update(['name' => 'Air Manas dba Air Manas ltd. Air Company']); + Airline::where('internal_name', 'airasia-x-berhad-dba-airasia-x')->update(['name' => 'Airasia X Berhad dba Airasia X']); + Airline::where('internal_name', 'mesa-airlines')->update(['name' => 'Mesa Airlines, Inc']); + + + + } +}; diff --git a/resources/js/Components/FlightsGoneBy/AirlineLogo.vue b/resources/js/Components/FlightsGoneBy/AirlineLogo.vue new file mode 100644 index 0000000..6c394aa --- /dev/null +++ b/resources/js/Components/FlightsGoneBy/AirlineLogo.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/resources/js/Components/FlightsGoneBy/FlightClassBadge.vue b/resources/js/Components/FlightsGoneBy/FlightClassBadge.vue new file mode 100644 index 0000000..f35719b --- /dev/null +++ b/resources/js/Components/FlightsGoneBy/FlightClassBadge.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/Dashboard.vue index 178846d..ecb619a 100644 --- a/resources/js/Pages/Dashboard.vue +++ b/resources/js/Pages/Dashboard.vue @@ -29,7 +29,7 @@ const name = computed(() => page?.props?.auth?.user?.name || 'there'); - + Import from FR24 diff --git a/resources/js/Pages/FlightProfile.vue b/resources/js/Pages/FlightProfile.vue index 87dbe1b..9086edb 100644 --- a/resources/js/Pages/FlightProfile.vue +++ b/resources/js/Pages/FlightProfile.vue @@ -1,61 +1,14 @@ + + diff --git a/resources/js/Types/types.d.ts b/resources/js/Types/types.d.ts index 1c99924..cf72dc9 100644 --- a/resources/js/Types/types.d.ts +++ b/resources/js/Types/types.d.ts @@ -23,6 +23,79 @@ export type SharedProps = import('@inertiajs/core').PageProps & { logo_api_url: string } +export interface Airport { + id: number + name: string + latitude_deg: number + longitude_deg: number + elevation_ft: number | null + region_id: number + municipality: string | null + icao_code: string | null + iata_code: string | null + local_code: string | null + type: string + created_at: string | null + updated_at: string | null + timezone: string +} + +export interface Airline { + id: number + IATA_code: string | null + ICAO_code: string | null + name: string | null + internal_name: string | null + active: boolean + logo: string | null + country_id: number +} + +export interface Aircraft { + id: number + designator: string + manufacturer_code: string + model_full_name: string + aircraft_description: string + engine_type: string + engine_count: number + wtc: string + created_at: string | null + updated_at: string | null +} + +export interface SeatType { + id: number + name: string +} + +export interface FlightReason { + id: number + name: string +} + +export interface FlightClass { + id: number + name: string +} + +export interface Flight { + id: number + flight_number: string | null + departure_date: string + arrival_date: string + aircraft_registration: string | null + seat_number: string | null + note: string | null + departure_airport: Airport + arrival_airport: Airport + airline: Airline | null + aircraft: Aircraft | null + seat_type: SeatType | null + flight_reason: FlightReason | null + flight_class: FlightClass | null +} + declare module '@inertiajs/vue3' { interface PageProps extends SharedProps {} }