diff --git a/app/Console/Commands/FlightFeedUpdate.php b/app/Console/Commands/FlightFeedUpdate.php index 0a051bf..9cb9b5a 100644 --- a/app/Console/Commands/FlightFeedUpdate.php +++ b/app/Console/Commands/FlightFeedUpdate.php @@ -7,6 +7,7 @@ use App\Models\UserFlight; use Illuminate\Console\Attributes\Description; use Illuminate\Console\Attributes\Signature; use Illuminate\Console\Command; +use Illuminate\Database\Eloquent\Collection; #[Signature('app:flight-feed-update')] #[Description('Command description')] @@ -14,24 +15,26 @@ class FlightFeedUpdate extends Command { public function handle() { - $time = now('UTC'); + $time = now('UTC')->startOfMinute(); - $this->logFlightActions('flight_departing', UserFlight::where('departure_date', $time)->get()->toArray()); - $this->logFlightActions('flight_arriving', UserFlight::where('arrival_date', $time)->get()->toArray()); + $this->logFlightActions('flight_departing', UserFlight::where('departure_date', $time)->get()); + $this->logFlightActions('flight_arriving', UserFlight::where('arrival_date', $time)->get()); } /** * @param string $type - * @param UserFlight[] $flights + * @param Collection $flights * @return void */ - private function logFlightActions(string $type, array $flights): void + private function logFlightActions(string $type, Collection $flights): void { foreach ($flights as $flight) { UserAction::create([ 'user_id' => $flight->user_id, 'type' => $type, - 'data' => $flight->snapshot($flight->id), + 'data' => [ + 'flight' => $flight->snapshot($flight->id), + ] ]); } } diff --git a/app/Console/Commands/UpdateDepartedFlights.php b/app/Console/Commands/UpdateDepartedFlights.php index 382b945..bd36e6a 100644 --- a/app/Console/Commands/UpdateDepartedFlights.php +++ b/app/Console/Commands/UpdateDepartedFlights.php @@ -44,7 +44,6 @@ class UpdateDepartedFlights extends Command public function handle(): void { $now = now()->utc(); - $oneHourAgo = $now->copy()->subHours(1); $userFlights = UserFlight::where('arrival_date', '<=', $now->copy()->subHour()->toDateTimeString()) ->where('auto_update', true) diff --git a/app/Http/Controllers/AdminToolsController.php b/app/Http/Controllers/AdminToolsController.php index 490e38a..3b4c67a 100644 --- a/app/Http/Controllers/AdminToolsController.php +++ b/app/Http/Controllers/AdminToolsController.php @@ -13,7 +13,7 @@ class AdminToolsController extends Controller ->map(fn ($path) => pathinfo($path, PATHINFO_FILENAME)) ->toArray();*/ - $existingFiles = collect(glob('C:\\Users\\josh\\WebstormProjects\\Watermark-Remover\\images\\liveries_processed\\*')) + $existingFiles = collect(glob(public_path('img/liveries/generated/*'))) ->map(fn ($path) => pathinfo($path, PATHINFO_FILENAME)) ->toArray(); diff --git a/app/Models/UserAction.php b/app/Models/UserAction.php index 5592368..5cb9832 100644 --- a/app/Models/UserAction.php +++ b/app/Models/UserAction.php @@ -33,6 +33,8 @@ class UserAction extends Model 'flight_imported' => 'Flight Imported from FR24', 'flight_logged' => 'Flight Logged', 'flight_deleted' => 'Flight Deleted', + 'flight_departing' => 'Flight Departed', + 'flight_arriving' => 'Flight Landed', default => 'Unknown Action' } ); diff --git a/database/migrations/2026_05_18_113037_extra_additions.php b/database/migrations/2026_05_18_113037_extra_additions.php new file mode 100644 index 0000000..ab70c31 --- /dev/null +++ b/database/migrations/2026_05_18_113037_extra_additions.php @@ -0,0 +1,50 @@ + 'Scoot', + 'IATA_code' => 'TR', + 'ICAO_code' => 'TGW', + 'internal_name' => 'scoot-new', + 'logo' => 'TR.png', + 'active' => true, + 'country_id' => Country::whereCode('SG')->first()->id, + ]); + + Aircraft::where('manufacturer_code', 'ATR') + ->each(function ($aircraft) { + $aircraft->update([ + 'model_full_name' => str_replace('ATR-', '', $aircraft->model_full_name), + ]); + }); + + Aircraft::where('manufacturer_code', 'AIRBUS') + ->each(function ($aircraft) { + $aircraft->update([ + 'model_full_name' => str_replace('A-', 'A', $aircraft->model_full_name), + ]); + }); + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +}; diff --git a/public/img/liveries/generated/V5_B462.png b/public/img/liveries/generated/V5_B462.png new file mode 100644 index 0000000..a7a9e7d Binary files /dev/null and b/public/img/liveries/generated/V5_B462.png differ diff --git a/public/img/liveries/generated/air-busan_A31N.png b/public/img/liveries/generated/air-busan_A31N.png new file mode 100644 index 0000000..371cddd Binary files /dev/null and b/public/img/liveries/generated/air-busan_A31N.png differ diff --git a/public/img/liveries/generated/air-china_A359.png b/public/img/liveries/generated/air-china_A359.png new file mode 100644 index 0000000..e901eb4 Binary files /dev/null and b/public/img/liveries/generated/air-china_A359.png differ diff --git a/public/img/liveries/generated/air-china_B77W.png b/public/img/liveries/generated/air-china_B77W.png new file mode 100644 index 0000000..531dfae Binary files /dev/null and b/public/img/liveries/generated/air-china_B77W.png differ diff --git a/public/img/liveries/generated/air-new-zealand_B744.png b/public/img/liveries/generated/air-new-zealand_B744.png new file mode 100644 index 0000000..a291a2d Binary files /dev/null and b/public/img/liveries/generated/air-new-zealand_B744.png differ diff --git a/public/img/liveries/generated/alliance-airlines_F100.png b/public/img/liveries/generated/alliance-airlines_F100.png new file mode 100644 index 0000000..1a91f47 Binary files /dev/null and b/public/img/liveries/generated/alliance-airlines_F100.png differ diff --git a/public/img/liveries/generated/alliance-airlines_F70.png b/public/img/liveries/generated/alliance-airlines_F70.png new file mode 100644 index 0000000..1214b1f Binary files /dev/null and b/public/img/liveries/generated/alliance-airlines_F70.png differ diff --git a/public/img/liveries/generated/cathay-pacific_A333.png b/public/img/liveries/generated/cathay-pacific_A333.png new file mode 100644 index 0000000..4ce4161 Binary files /dev/null and b/public/img/liveries/generated/cathay-pacific_A333.png differ diff --git a/public/img/liveries/generated/cathay-pacific_A359.png b/public/img/liveries/generated/cathay-pacific_A359.png new file mode 100644 index 0000000..673ca1e Binary files /dev/null and b/public/img/liveries/generated/cathay-pacific_A359.png differ diff --git a/public/img/liveries/generated/china-airlines_A359.png b/public/img/liveries/generated/china-airlines_A359.png new file mode 100644 index 0000000..94a9dc4 Binary files /dev/null and b/public/img/liveries/generated/china-airlines_A359.png differ diff --git a/public/img/liveries/generated/china-airlines_B744.png b/public/img/liveries/generated/china-airlines_B744.png new file mode 100644 index 0000000..9a31c9e Binary files /dev/null and b/public/img/liveries/generated/china-airlines_B744.png differ diff --git a/public/img/liveries/generated/china-southern-airlines_AJ27.png b/public/img/liveries/generated/china-southern-airlines_AJ27.png new file mode 100644 index 0000000..f913c22 Binary files /dev/null and b/public/img/liveries/generated/china-southern-airlines_AJ27.png differ diff --git a/public/img/liveries/generated/china-southern-airlines_B77W.png b/public/img/liveries/generated/china-southern-airlines_B77W.png new file mode 100644 index 0000000..32a04b7 Binary files /dev/null and b/public/img/liveries/generated/china-southern-airlines_B77W.png differ diff --git a/public/img/liveries/generated/japan-airlines_A359.png b/public/img/liveries/generated/japan-airlines_A359.png new file mode 100644 index 0000000..7248dbd Binary files /dev/null and b/public/img/liveries/generated/japan-airlines_A359.png differ diff --git a/public/img/liveries/generated/jetstar_A21N.png b/public/img/liveries/generated/jetstar_A21N.png new file mode 100644 index 0000000..ccc9aa2 Binary files /dev/null and b/public/img/liveries/generated/jetstar_A21N.png differ diff --git a/public/img/liveries/generated/juneyao-airlines_A320.png b/public/img/liveries/generated/juneyao-airlines_A320.png new file mode 100644 index 0000000..613ec80 Binary files /dev/null and b/public/img/liveries/generated/juneyao-airlines_A320.png differ diff --git a/public/img/liveries/generated/qantas_A320.png b/public/img/liveries/generated/qantas_A320.png new file mode 100644 index 0000000..5b27732 Binary files /dev/null and b/public/img/liveries/generated/qantas_A320.png differ diff --git a/public/img/liveries/generated/scoot-new_B789.png b/public/img/liveries/generated/scoot-new_B789.png new file mode 100644 index 0000000..880f127 Binary files /dev/null and b/public/img/liveries/generated/scoot-new_B789.png differ diff --git a/public/img/liveries/generated/us-airways_CRJ9.png b/public/img/liveries/generated/us-airways_CRJ9.png new file mode 100644 index 0000000..c6715dd Binary files /dev/null and b/public/img/liveries/generated/us-airways_CRJ9.png differ diff --git a/public/img/liveries/generated/virgin-australia_B77W.png b/public/img/liveries/generated/virgin-australia_B77W.png new file mode 100644 index 0000000..7b295b6 Binary files /dev/null and b/public/img/liveries/generated/virgin-australia_B77W.png differ diff --git a/public/img/liveries/generated/virgin-australia_E190.png b/public/img/liveries/generated/virgin-australia_E190.png new file mode 100644 index 0000000..3b99545 Binary files /dev/null and b/public/img/liveries/generated/virgin-australia_E190.png differ diff --git a/resources/js/Components/FlightsGoneBy/Feed/FeedItem.vue b/resources/js/Components/FlightsGoneBy/Feed/FeedItem.vue index 9f271c8..9284d5a 100644 --- a/resources/js/Components/FlightsGoneBy/Feed/FeedItem.vue +++ b/resources/js/Components/FlightsGoneBy/Feed/FeedItem.vue @@ -13,13 +13,14 @@ import FlightUpdatedFeedItem from "@/Components/FlightsGoneBy/Feed/FlightUpdated import FlightCancelledFeedItem from "@/Components/FlightsGoneBy/Feed/FlightCancelledFeedItem.vue"; import FlightImportedFeedItem from "@/Components/FlightsGoneBy/Feed/FlightImportedFeedItem.vue"; import FlightMovedFeedItem from "@/Components/FlightsGoneBy/Feed/FlightMovedFeedItem.vue"; +import ButtonLink from "@/Components/FlightsGoneBy/ButtonLink.vue"; const props = defineProps<{ action: UserAction }>() const flight = computed(() =>{ - if (props.action.type === 'flight_booked' || props.action.type === 'flight_logged'){ + if (props.action.type === 'flight_booked' || props.action.type === 'flight_logged' || props.action.type === 'flight_departing' || props.action.type === 'flight_arriving' || props.action.type === 'flight_imported'){ return (props.action.data as UserActionFlightBookedData).flight } else if (props.action.type === 'flight_updated'){ return (props.action.data as UserActionFlightUpdatedData).updated @@ -77,15 +78,10 @@ function timeAgo(dateStr: string): string { - / +
- - View Flight - - - - +
@@ -146,13 +142,6 @@ function timeAgo(dateStr: string): string { color: #9ca3af; } -.changes { - display: grid; - grid-template-columns: auto 1fr; - gap: 0.3rem 1rem; - margin: 0; - font-size: 0.82rem; -} .changes dt { color: #9ca3af; @@ -166,24 +155,6 @@ function timeAgo(dateStr: string): string { word-break: break-word; } -.view-flight-link { - display: inline-flex; - align-items: center; - gap: 0.4rem; - font-size: 0.8rem; - font-weight: 500; - color: #818cf8; - text-decoration: none; - padding: 0.35rem 0.75rem; - border: 1px solid rgba(99, 102, 241, 0.25); - background: rgba(99, 102, 241, 0.08); - transition: background 0.15s, border-color 0.15s; -} - -.view-flight-link:hover { - background: rgba(99, 102, 241, 0.18); - border-color: rgba(99, 102, 241, 0.45); -} .view-flight-link svg { width: 0.85rem; diff --git a/resources/js/Components/FlightsGoneBy/Feed/FlightMovedFeedItem.vue b/resources/js/Components/FlightsGoneBy/Feed/FlightMovedFeedItem.vue index bc7a7ac..43289bd 100644 --- a/resources/js/Components/FlightsGoneBy/Feed/FlightMovedFeedItem.vue +++ b/resources/js/Components/FlightsGoneBy/Feed/FlightMovedFeedItem.vue @@ -15,9 +15,22 @@ const actionText = computed(() => props.action === 'flight_departing' ? 'departe diff --git a/resources/js/Components/FlightsGoneBy/MainHeader.vue b/resources/js/Components/FlightsGoneBy/MainHeader.vue index ac7f054..4219099 100644 --- a/resources/js/Components/FlightsGoneBy/MainHeader.vue +++ b/resources/js/Components/FlightsGoneBy/MainHeader.vue @@ -112,37 +112,6 @@ header { color: var(--text); } -/* Notification button */ -.notif-btn { - position: relative; - display: flex; - align-items: center; - justify-content: center; - width: 36px; - height: 36px; - background: none; - border: none; - cursor: pointer; - color: var(--text); - border-radius: 4px; - transition: color 0.15s ease, background 0.15s ease; -} - -.notif-btn:hover { - color: var(--accent); - background: rgba(56, 189, 248, 0.07); -} - -.notif-dot { - position: absolute; - top: 6px; - right: 6px; - width: 7px; - height: 7px; - background: var(--accent); - border-radius: 50%; - border: 1.5px solid var(--bg); -} /* Shared nav link base */ .nav-link { diff --git a/resources/js/Components/FlightsGoneBy/NotificationMenu.vue b/resources/js/Components/FlightsGoneBy/NotificationMenu.vue index 12d198a..02ccf6b 100644 --- a/resources/js/Components/FlightsGoneBy/NotificationMenu.vue +++ b/resources/js/Components/FlightsGoneBy/NotificationMenu.vue @@ -21,6 +21,10 @@ const markAllRead = async (notifications: Notification[]) => { unread.forEach(n => n.read_at = new Date().toISOString()) } +const emit = defineEmits<{ + (e: 'update:unreadCount', value: number): void +}>() + watch(open, async (isOpen) => { if (!isOpen || notifications.value.length) return loading.value = true @@ -28,6 +32,7 @@ watch(open, async (isOpen) => { notifications.value = data loading.value = false await markAllRead(notifications.value) + emit('update:unreadCount', 0) // <-- add this }) @@ -84,7 +89,8 @@ watch(open, async (isOpen) => { .notif-menu { position: absolute; top: calc(100% + 0.4rem); - right: 0; + left: 50%; + transform: translateX(-50%); width: 320px; background: var(--bg); border: 1px solid rgba(56, 189, 248, 0.12);