Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a39f97a4be | ||
|
|
c575a8dcba | ||
|
|
647120cfcd | ||
|
|
ee095d6ae8 | ||
|
|
cb8070eabc |
No files matched your search
@@ -133,7 +133,7 @@ class SettingsRegistry
|
|||||||
'category' => 'FlightsGoneBy Settings',
|
'category' => 'FlightsGoneBy Settings',
|
||||||
'type' => 'multiselect',
|
'type' => 'multiselect',
|
||||||
'label' => 'Which columns to show on the Departure Board',
|
'label' => 'Which columns to show on the Departure Board',
|
||||||
'default' => ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined'],
|
'default' => ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'aircraft_registration', 'class_seat_combined'],
|
||||||
'options' => [
|
'options' => [
|
||||||
['value' => 'airline', 'label' => 'Airline Logo w/ Info Popup'],
|
['value' => 'airline', 'label' => 'Airline Logo w/ Info Popup'],
|
||||||
['value' => 'airline.name', 'label' => 'Airline Name'],
|
['value' => 'airline.name', 'label' => 'Airline Name'],
|
||||||
@@ -148,7 +148,7 @@ class SettingsRegistry
|
|||||||
['value' => 'duration', 'label' => 'Duration'],
|
['value' => 'duration', 'label' => 'Duration'],
|
||||||
['value' => 'distance', 'label' => 'Distance'],
|
['value' => 'distance', 'label' => 'Distance'],
|
||||||
['value' => 'aircraft', 'label' => 'Aircraft Designator w/ Info Popup'],
|
['value' => 'aircraft', 'label' => 'Aircraft Designator w/ Info Popup'],
|
||||||
['value' => 'registration', 'label' => 'Aircraft Registration'],
|
['value' => 'aircraft_registration', 'label' => 'Aircraft Registration'],
|
||||||
['value' => 'aircraft.manufacturer_code', 'label' => 'Aircraft Manufacturer'],
|
['value' => 'aircraft.manufacturer_code', 'label' => 'Aircraft Manufacturer'],
|
||||||
['value' => 'aircraft.model_full_name', 'label' => 'Aircraft Model'],
|
['value' => 'aircraft.model_full_name', 'label' => 'Aircraft Model'],
|
||||||
['value' => 'flight_class', 'label' => 'Class'],
|
['value' => 'flight_class', 'label' => 'Class'],
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.4",
|
"php": "^8.5.12",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
"inertiajs/inertia-laravel": "^2.0",
|
"inertiajs/inertia-laravel": "^2.0",
|
||||||
"laravel-notification-channels/webpush": "^11.0",
|
"laravel-notification-channels/webpush": "^11.0",
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
$this->renameDepartureBoardColumn('registration', 'aircraft_registration');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
$this->renameDepartureBoardColumn('aircraft_registration', 'registration');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Walk every user's settings JSON and rename a value inside
|
||||||
|
* departure_board_columns, if present.
|
||||||
|
*/
|
||||||
|
private function renameDepartureBoardColumn(string $from, string $to): void
|
||||||
|
{
|
||||||
|
DB::table('users')
|
||||||
|
->select('id', 'settings')
|
||||||
|
->whereNotNull('settings')
|
||||||
|
->orderBy('id')
|
||||||
|
->chunkById(500, function ($users) use ($from, $to) {
|
||||||
|
foreach ($users as $user) {
|
||||||
|
$settings = json_decode($user->settings, true);
|
||||||
|
|
||||||
|
// Skip rows with malformed/empty JSON rather than blowing up the migration.
|
||||||
|
if (! is_array($settings) || ! isset($settings['departure_board_columns'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! is_array($settings['departure_board_columns'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$columns = $settings['departure_board_columns'];
|
||||||
|
$key = array_search($from, $columns, true);
|
||||||
|
|
||||||
|
if ($key === false) {
|
||||||
|
continue; // nothing to change for this user
|
||||||
|
}
|
||||||
|
|
||||||
|
$columns[$key] = $to;
|
||||||
|
$settings['departure_board_columns'] = $columns;
|
||||||
|
|
||||||
|
DB::table('users')
|
||||||
|
->where('id', $user->id)
|
||||||
|
->update([
|
||||||
|
'settings' => json_encode($settings),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
FROM php:8.4-fpm-alpine
|
FROM php:8.5-fpm-alpine
|
||||||
|
|
||||||
RUN apk add --no-cache nginx curl zip unzip git postgresql-dev nodejs npm dcron \
|
RUN apk add --no-cache nginx curl zip unzip git postgresql-dev nodejs npm dcron \
|
||||||
&& docker-php-ext-install pdo pdo_pgsql pgsql opcache pcntl
|
&& docker-php-ext-install pdo pdo_pgsql pgsql pcntl
|
||||||
|
|
||||||
RUN docker-php-ext-install bcmath
|
RUN docker-php-ext-install bcmath
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import ButtonLink from "@/Components/FlightsGoneBy/ButtonLink.vue";
|
|||||||
import Distance from "@/Components/Distance.vue";
|
import Distance from "@/Components/Distance.vue";
|
||||||
import FormattedNumber from "@/Components/FormattedNumber.vue";
|
import FormattedNumber from "@/Components/FormattedNumber.vue";
|
||||||
|
|
||||||
const distanceAchievementCategoryId = 6
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
achievement: Achievement
|
achievement: Achievement
|
||||||
userAchievement?: UserAchievement
|
userAchievement?: UserAchievement
|
||||||
@@ -18,6 +16,20 @@ const props = defineProps<{
|
|||||||
distanceUnit? : "mi" | "km" | "nm"
|
distanceUnit? : "mi" | "km" | "nm"
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const dynamicDistanceUnit = computed(() => {
|
||||||
|
if(props.achievement.internal_name == 'distance.million_miles'){
|
||||||
|
return 'mi'
|
||||||
|
}
|
||||||
|
|
||||||
|
if(props.achievement.internal_name == 'distance.million_kilometers'){
|
||||||
|
return 'km'
|
||||||
|
}
|
||||||
|
|
||||||
|
return props.distanceUnit ?? 'km';
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const progress = computed(() => {
|
const progress = computed(() => {
|
||||||
if (!props.achievement.progressive || !props.achievement.threshold) return null
|
if (!props.achievement.progressive || !props.achievement.threshold) return null
|
||||||
const current = props.userAchievement?.progress ?? 0
|
const current = props.userAchievement?.progress ?? 0
|
||||||
@@ -88,9 +100,9 @@ const unlocked = computed(() => {
|
|||||||
|
|
||||||
<template v-if="achievement.progressive && progress">
|
<template v-if="achievement.progressive && progress">
|
||||||
<div class="progress-label">
|
<div class="progress-label">
|
||||||
<span v-if="achievement.achievement_category_id == distanceAchievementCategoryId">
|
<span v-if="achievement.category?.internal_name == 'distance'">
|
||||||
<Distance :unit="distanceUnit" :showUnits="false" :value="Math.min(progress.current, progress.threshold)" /> /
|
<Distance :unit="dynamicDistanceUnit" :showUnits="false" :value="Math.min(progress.current, progress.threshold)" /> /
|
||||||
<Distance :unit="distanceUnit" :value="progress.threshold" />
|
<Distance :unit="dynamicDistanceUnit" :value="progress.threshold" />
|
||||||
</span>
|
</span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<FormattedNumber :value="Math.min(progress.current, progress.threshold)" /> /
|
<FormattedNumber :value="Math.min(progress.current, progress.threshold)" /> /
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const props = defineProps<{
|
|||||||
const page = usePage<SharedProps>().props
|
const page = usePage<SharedProps>().props
|
||||||
const ITEMS_PER_PAGE = 25
|
const ITEMS_PER_PAGE = 25
|
||||||
|
|
||||||
const defaultColumns = ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined', 'note']
|
const defaultColumns = ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'aircraft_registration', 'class_seat_combined', 'note']
|
||||||
const columnsToShow = computed(() => page.auth.user?.resolved_settings?.departure_board_columns ?? defaultColumns)
|
const columnsToShow = computed(() => page.auth.user?.resolved_settings?.departure_board_columns ?? defaultColumns)
|
||||||
const showColumn = (column: string) => columnsToShow.value.includes(column)
|
const showColumn = (column: string) => columnsToShow.value.includes(column)
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ const allHeaders = [
|
|||||||
{ title: 'MODEL', key: 'aircraft.model_full_name', sortable: true },
|
{ title: 'MODEL', key: 'aircraft.model_full_name', sortable: true },
|
||||||
{ title: 'AIRCRAFT', key: 'aircraft.display_name_short', sortable: true },
|
{ title: 'AIRCRAFT', key: 'aircraft.display_name_short', sortable: true },
|
||||||
{ title: 'AIRCRAFT', key: 'aircraft', sortable: true },
|
{ title: 'AIRCRAFT', key: 'aircraft', sortable: true },
|
||||||
{ title: 'REG', key: 'registration', sortable: true },
|
{ title: 'REG', key: 'aircraft_registration', sortable: true },
|
||||||
{ title: 'CLASS', key: 'flight_class', sortable: true },
|
{ title: 'CLASS', key: 'flight_class', sortable: true },
|
||||||
{ title: 'CLASS', key: 'class_seat_combined', sortable: true },
|
{ title: 'CLASS', key: 'class_seat_combined', sortable: true },
|
||||||
{ title: 'SEAT TYPE', key: 'seat_type_id', sortable: true },
|
{ title: 'SEAT TYPE', key: 'seat_type_id', sortable: true },
|
||||||
@@ -70,7 +70,7 @@ const customKeySort = {
|
|||||||
aircraft: (a: Flight['aircraft'], b: Flight['aircraft']) => (a?.designator ?? '').localeCompare(b?.designator ?? ''),
|
aircraft: (a: Flight['aircraft'], b: Flight['aircraft']) => (a?.designator ?? '').localeCompare(b?.designator ?? ''),
|
||||||
duration: (a: any, b: any) => (a ?? 0) - (b ?? 0),
|
duration: (a: any, b: any) => (a ?? 0) - (b ?? 0),
|
||||||
departure_airport: (a: Flight['departure_airport'], b: Flight['departure_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''),
|
departure_airport: (a: Flight['departure_airport'], b: Flight['departure_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''),
|
||||||
arrival_airport: (a: Flight['arrival_airport'], b: Flight['arrival_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? '')
|
arrival_airport: (a: Flight['arrival_airport'], b: Flight['arrival_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''),
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortBy = ref<DataTableSortItem[]>([])
|
const sortBy = ref<DataTableSortItem[]>([])
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ const reasonBadgeVariant = (reason: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const showColumn = (column: string) => props.columnsToShow.includes(column)
|
const showColumn = (column: string) => props.columnsToShow.includes(column)
|
||||||
console.log(props.columnsToShow)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -138,7 +137,7 @@ console.log(props.columnsToShow)
|
|||||||
</AircraftToolTip>
|
</AircraftToolTip>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td v-if="showColumn('registration')" class="v-data-table__td registration-cell">
|
<td v-if="showColumn('aircraft_registration')" class="v-data-table__td registration-cell">
|
||||||
<Mono muted smaller v-if="flight.aircraft_registration">{{ flight.aircraft_registration }}</Mono>
|
<Mono muted smaller v-if="flight.aircraft_registration">{{ flight.aircraft_registration }}</Mono>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,34 @@ const page = usePage<SharedProps>().props
|
|||||||
router.on('success', () => {
|
router.on('success', () => {
|
||||||
transitionKey.value++;
|
transitionKey.value++;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isIOS27PlusPWA = (() => {
|
||||||
|
const ua = navigator.userAgent;
|
||||||
|
|
||||||
|
const isStandalone =
|
||||||
|
window.matchMedia('(display-mode: standalone)').matches ||
|
||||||
|
(navigator as Navigator & { standalone?: boolean }).standalone;
|
||||||
|
|
||||||
|
if (!isStandalone) return false;
|
||||||
|
|
||||||
|
// iPhone / iPad detection
|
||||||
|
const isIOS =
|
||||||
|
/iPhone|iPad|iPod/.test(ua) ||
|
||||||
|
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
||||||
|
|
||||||
|
if (!isIOS) return false;
|
||||||
|
|
||||||
|
// iOS 27+ detection (Safari version token)
|
||||||
|
const version = ua.match(/Version\/(\d+)/);
|
||||||
|
|
||||||
|
return version && parseInt(version[1]) >= 27;
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Radar>
|
<Radar>
|
||||||
<div class="layoutContainer">
|
<div class="layoutContainer">
|
||||||
|
<div v-if="isIOS27PlusPWA" class="ios-top-bar"></div>
|
||||||
<MainHeader :key="`header-${transitionKey}`" />
|
<MainHeader :key="`header-${transitionKey}`" />
|
||||||
<Transition name="fade" mode="out-in">
|
<Transition name="fade" mode="out-in">
|
||||||
<main id="pageContainer" :key="`main-${transitionKey}`">
|
<main id="pageContainer" :key="`main-${transitionKey}`">
|
||||||
@@ -49,6 +72,16 @@ router.on('success', () => {
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ios-top-bar {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 6px;
|
||||||
|
z-index: 9999;
|
||||||
|
background: var(--surface);
|
||||||
|
}
|
||||||
|
|
||||||
header,
|
header,
|
||||||
footer {
|
footer {
|
||||||
flex: 0 0 5dvh;
|
flex: 0 0 5dvh;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
<link rel="apple-touch-icon" href="/img/app_icons/apple-touch-icon-180.png">
|
<link rel="apple-touch-icon" href="/img/app_icons/apple-touch-icon-180.png">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
||||||
<meta name="apple-mobile-web-app-title" content="FlightsGoneBy">
|
<meta name="apple-mobile-web-app-title" content="FlightsGoneBy">
|
||||||
<script defer src="https://stats.dredgy.au/script.js" data-website-id="70a7276c-bdd3-4833-b286-4962ab28b5b5"></script>
|
<script defer src="https://stats.dredgy.au/script.js" data-website-id="70a7276c-bdd3-4833-b286-4962ab28b5b5"></script>
|
||||||
<link rel="apple-touch-startup-image" media="screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/img/logos/apple-splash-portrait-2048x2732.png">
|
<link rel="apple-touch-startup-image" media="screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/img/logos/apple-splash-portrait-2048x2732.png">
|
||||||
|
|||||||
@@ -44,6 +44,13 @@ use Inertia\Inertia;
|
|||||||
Route::get('/missing-airlines', [AdminController::class, 'reconcileMissingAirlines'])->name('reconcile-missing-airlines')->middleware('permission:reconcile_missing_liveries');
|
Route::get('/missing-airlines', [AdminController::class, 'reconcileMissingAirlines'])->name('reconcile-missing-airlines')->middleware('permission:reconcile_missing_liveries');
|
||||||
Route::post('/ignore-missing-airline', [AdminController::class, 'ignoreMissingAirline'])->name('admin.ignore-missing-airline');
|
Route::post('/ignore-missing-airline', [AdminController::class, 'ignoreMissingAirline'])->name('admin.ignore-missing-airline');
|
||||||
|
|
||||||
|
Route::get('/server-info', function () {
|
||||||
|
return response()->json([
|
||||||
|
'php_version' => PHP_VERSION,
|
||||||
|
'laravel_version' => app()->version(),
|
||||||
|
'environment' => app()->environment(),
|
||||||
|
]);
|
||||||
|
})->name('server-info');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user