Added Notifications
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Api;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
class AircraftApiController extends Controller
|
||||||
|
{
|
||||||
|
public function getLivery(string $aircraftDesignator){
|
||||||
|
$path = "images/livery_templates/{$aircraftDesignator}.png";
|
||||||
|
return $this->imageIfExists($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -49,21 +49,8 @@ class AirlineApiController extends ApiController
|
|||||||
|
|
||||||
public function getLivery(string $airlineInternalName, string $aircraftDesignator){
|
public function getLivery(string $airlineInternalName, string $aircraftDesignator){
|
||||||
$path = "images/liveries/{$airlineInternalName}_{$aircraftDesignator}.png";
|
$path = "images/liveries/{$airlineInternalName}_{$aircraftDesignator}.png";
|
||||||
$cacheLimit = 60 * 60 * 72;
|
|
||||||
|
|
||||||
if(!Storage::disk('local')->exists($path)){
|
return $this->imageIfExists($path);
|
||||||
return response()->json(['error' => 'Livery not found'], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$fullPath = Storage::disk('local')->path($path);
|
|
||||||
$lastModified = filemtime($fullPath);
|
|
||||||
|
|
||||||
return response()->file($fullPath, [
|
|
||||||
'Content-Type' => 'image/png',
|
|
||||||
'Cache-Control' => 'public, max-age='.$cacheLimit, // 24 hours
|
|
||||||
'Last-Modified' => gmdate('D, d M Y H:i:s', $lastModified) . ' GMT',
|
|
||||||
'ETag' => md5($path . $lastModified),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseAirlineData(Airline $airline){
|
function parseAirlineData(Airline $airline){
|
||||||
|
|||||||
@@ -2,7 +2,23 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
abstract class Controller
|
abstract class Controller
|
||||||
{
|
{
|
||||||
//
|
public function imageIfExists(string $path, $cacheLimit = 60 * 60 * 72){
|
||||||
|
if(!Storage::disk('local')->exists($path)){
|
||||||
|
return response()->json(['error' => 'Image not found'], 404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$fullPath = Storage::disk('local')->path($path);
|
||||||
|
$lastModified = filemtime($fullPath);
|
||||||
|
|
||||||
|
return response()->file($fullPath, [
|
||||||
|
'Content-Type' => 'image/png',
|
||||||
|
'Cache-Control' => 'public, max-age='.$cacheLimit, // 24 hours
|
||||||
|
'Last-Modified' => gmdate('D, d M Y H:i:s', $lastModified) . ' GMT',
|
||||||
|
'ETag' => md5($path . $lastModified),
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ class FlightController extends Controller
|
|||||||
return redirect()->route('profile.departure-board', [Auth::user()->name, $flight->id]);
|
return redirect()->route('profile.departure-board', [Auth::user()->name, $flight->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete(UserFlight $flight)
|
public function delete(UserFlight $flight, ?string $referrer = 'departure-board')
|
||||||
{
|
{
|
||||||
$this->authorize('delete', $flight);
|
$this->authorize('delete', $flight);
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ class FlightController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$flight->delete();
|
$flight->delete();
|
||||||
return redirect()->route('profile.departure-board', [Auth::user()->name]);
|
return redirect()->route('profile.'.$referrer, [Auth::user()->name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function staticData() : array {
|
public function staticData() : array {
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ class FlightProfileController extends Controller
|
|||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return Inertia::render('UserFlight', [
|
return Inertia::render('UserFlight', [
|
||||||
'flightCount' => $user->flights()->count(),
|
'flightCount' => $user->departedFlights()->count(),
|
||||||
'flight' => $userFlight->snapshot($userFlight->id),
|
'flight' => $userFlight->snapshot($userFlight->id),
|
||||||
|
'canEdit' => auth()->check() && auth()->id() === $user->id,
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
'isFollowing' => auth()->check() && auth()->user()->isFollowing($user),
|
'isFollowing' => auth()->check() && auth()->user()->isFollowing($user),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -227,17 +227,32 @@ class UserFlight extends Model
|
|||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: function () {
|
get: function () {
|
||||||
|
|
||||||
if(!$this->airline || !$this->aircraft){
|
$apiUrl = config('app.logo_api_url');
|
||||||
|
|
||||||
|
if (!$this->aircraft) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = "images/liveries/{$this->airline->internal_name}_{$this->aircraft->designator}.png";
|
|
||||||
|
|
||||||
if(!Storage::disk('local')->exists($path)){
|
if ($this->airline){
|
||||||
|
$path = "images/liveries/{$this->airline->internal_name}_{$this->aircraft->designator}.png";
|
||||||
|
if (Storage::disk('local')->exists($path)) {
|
||||||
|
$finalPath = $apiUrl."/airline/{$this->airline->internal_name}/livery/{$this->aircraft->designator}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($finalPath)){
|
||||||
|
$path = "images/livery_templates/{$this->aircraft->designator}.png";
|
||||||
|
if (Storage::disk('local')->exists($path)) {
|
||||||
|
$finalPath = $apiUrl."/aircraft/{$this->aircraft->designator}/livery";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($finalPath)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return config('app.logo_api_url')."/airline/{$this->airline->internal_name}/livery/{$this->aircraft->designator}";
|
return $finalPath;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Flight } from "@/Types/types";
|
import {Flight, User} from "@/Types/types";
|
||||||
import AirlineLogo from "@/Components/FlightsGoneBy/AirlineLogo.vue";
|
import AirlineLogo from "@/Components/FlightsGoneBy/AirlineLogo.vue";
|
||||||
import AirportToolTip from "@/Components/FlightsGoneBy/AirportToolTip.vue";
|
import AirportToolTip from "@/Components/FlightsGoneBy/AirportToolTip.vue";
|
||||||
import AircraftToolTip from "@/Components/FlightsGoneBy/AircraftToolTip.vue";
|
import AircraftToolTip from "@/Components/FlightsGoneBy/AircraftToolTip.vue";
|
||||||
import Distance from "@/Components/Distance.vue";
|
import Distance from "@/Components/Distance.vue";
|
||||||
|
import UserFlightContextMenu from "@/Components/FlightsGoneBy/UserFlightContextMenu.vue";
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
flight: Flight
|
flight: Flight
|
||||||
showTooltips?: boolean
|
showTooltips?: boolean
|
||||||
|
canEdit?: boolean
|
||||||
|
user?: User
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
|
||||||
@@ -19,6 +22,8 @@ defineProps<{
|
|||||||
<span v-if="flight.flight_class?.name !== 'Unspecified'" class="pass-header-class">
|
<span v-if="flight.flight_class?.name !== 'Unspecified'" class="pass-header-class">
|
||||||
{{ flight.flight_class?.name }}
|
{{ flight.flight_class?.name }}
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else></span>
|
||||||
|
<UserFlightContextMenu v-if="user" :profile-user="user" :flight="flight" :can-edit="canEdit ?? false" referrer="boarding-passes"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pass-body">
|
<div class="pass-body">
|
||||||
@@ -159,7 +164,7 @@ defineProps<{
|
|||||||
.pass-header {
|
.pass-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: space-between; /* was flex-end */
|
||||||
padding: 0.5rem 0.85rem;
|
padding: 0.5rem 0.85rem;
|
||||||
min-height: 2rem;
|
min-height: 2rem;
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.06);
|
border-bottom: 1px solid rgba(255,255,255,0.06);
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { Flight } from "@/Types/types";
|
import {Flight, User} from "@/Types/types";
|
||||||
import BoardingPass from "@/Components/FlightsGoneBy/BoardingPass.vue";
|
import BoardingPass from "@/Components/FlightsGoneBy/BoardingPass.vue";
|
||||||
import { FlightStats } from "@/Composables/useFlightStats";
|
import { FlightStats } from "@/Composables/useFlightStats";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
flightStats: FlightStats
|
flightStats: FlightStats
|
||||||
canEdit: boolean
|
canEdit: boolean
|
||||||
|
user: User
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const upcomingFlights = computed(() =>
|
const upcomingFlights = computed(() =>
|
||||||
@@ -64,7 +65,7 @@ function isUpcoming(flight: Flight): boolean {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<BoardingPass :flight="flight" />
|
<BoardingPass :user="user" :canEdit="canEdit" :flight="flight" />
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,11 +9,9 @@ import InlineBadge from "@/Components/FlightsGoneBy/InlineBadge.vue";
|
|||||||
import AirportToolTip from "@/Components/FlightsGoneBy/AirportToolTip.vue";
|
import AirportToolTip from "@/Components/FlightsGoneBy/AirportToolTip.vue";
|
||||||
import AircraftToolTip from "@/Components/FlightsGoneBy/AircraftToolTip.vue";
|
import AircraftToolTip from "@/Components/FlightsGoneBy/AircraftToolTip.vue";
|
||||||
import {FlightStats} from "@/Composables/useFlightStats";
|
import {FlightStats} from "@/Composables/useFlightStats";
|
||||||
import GlassTooltip from "@/Components/FlightsGoneBy/GlassTooltip.vue";
|
|
||||||
import CrewTooltip from "@/Components/FlightsGoneBy/CrewTooltip.vue";
|
import CrewTooltip from "@/Components/FlightsGoneBy/CrewTooltip.vue";
|
||||||
import {Link, router} from "@inertiajs/vue3";
|
|
||||||
import AllianceLogo from "@/Components/FlightsGoneBy/AllianceLogo.vue";
|
|
||||||
import Distance from "@/Components/Distance.vue";
|
import Distance from "@/Components/Distance.vue";
|
||||||
|
import UserFlightContextMenu from "@/Components/FlightsGoneBy/UserFlightContextMenu.vue";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
flightStats: FlightStats
|
flightStats: FlightStats
|
||||||
@@ -23,16 +21,6 @@ const props = defineProps<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
|
||||||
function editRoute(id: number) {
|
|
||||||
return route('flights.edit', { flight: id })
|
|
||||||
}
|
|
||||||
|
|
||||||
const flightToDelete = ref<Flight | null>(null)
|
|
||||||
const showDeleteDialog = computed({
|
|
||||||
get: () => flightToDelete.value !== null,
|
|
||||||
set: (val) => { if (!val) flightToDelete.value = null }
|
|
||||||
})
|
|
||||||
|
|
||||||
const ITEMS_PER_PAGE = 25
|
const ITEMS_PER_PAGE = 25
|
||||||
|
|
||||||
const headers = [
|
const headers = [
|
||||||
@@ -77,7 +65,6 @@ const customKeySort = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const deleting = ref(false)
|
|
||||||
const sortBy = ref<DataTableSortItem[]>([])
|
const sortBy = ref<DataTableSortItem[]>([])
|
||||||
const currentPage = ref(1)
|
const currentPage = ref(1)
|
||||||
|
|
||||||
@@ -268,54 +255,7 @@ watch(
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td actions-cell">
|
<td class="v-data-table__td actions-cell">
|
||||||
<v-menu>
|
<UserFlightContextMenu :profile-user="user" :can-edit="canEdit" :flight="(item as Flight)" />
|
||||||
<template #activator="{ props: menuProps }">
|
|
||||||
<v-btn
|
|
||||||
v-bind="menuProps"
|
|
||||||
icon="mdi-dots-horizontal"
|
|
||||||
variant="text"
|
|
||||||
size="small"
|
|
||||||
density="compact"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-list density="compact" bg-color="#1a1e2e">
|
|
||||||
<v-list-item
|
|
||||||
prepend-icon="mdi-magnify"
|
|
||||||
title="View Details"
|
|
||||||
:href="`/u/${user.name}/flight/${(item as Flight).id}`"
|
|
||||||
/>
|
|
||||||
<v-list-item v-if="canEdit"
|
|
||||||
prepend-icon="mdi-pencil-outline"
|
|
||||||
title="Edit"
|
|
||||||
:href="editRoute((item as Flight).id)"
|
|
||||||
/>
|
|
||||||
<v-list-item v-if="canEdit"
|
|
||||||
prepend-icon="mdi-trash-can-outline"
|
|
||||||
title="Delete"
|
|
||||||
@click="flightToDelete = (item as Flight)"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</v-list>
|
|
||||||
</v-menu>
|
|
||||||
<v-dialog v-if="canEdit" v-model="showDeleteDialog" max-width="400">
|
|
||||||
<v-card title="Delete Flight">
|
|
||||||
<v-card-text>Are you sure you want to delete this flight?</v-card-text>
|
|
||||||
<v-card-actions>
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn v-if="!deleting" @click="flightToDelete = null">Cancel</v-btn>
|
|
||||||
<v-btn
|
|
||||||
color="error"
|
|
||||||
:loading="deleting"
|
|
||||||
@click="deleting = true; router.delete(
|
|
||||||
route('flights.delete', { flight: flightToDelete!.id }),
|
|
||||||
{ onFinish: () => { deleting = false; flightToDelete = null } }
|
|
||||||
)"
|
|
||||||
>
|
|
||||||
Delete
|
|
||||||
</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ defineProps<{
|
|||||||
padding: 2.5rem 2rem;
|
padding: 2.5rem 2rem;
|
||||||
font-family: 'Barlow', sans-serif;
|
font-family: 'Barlow', sans-serif;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-width: 2000px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-state {
|
.loading-state {
|
||||||
@@ -37,20 +38,6 @@ defineProps<{
|
|||||||
min-height: 50dvh;
|
min-height: 50dvh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spinner {
|
|
||||||
display: block;
|
|
||||||
width: 2.5rem;
|
|
||||||
height: 2.5rem;
|
|
||||||
border: 3px solid rgba(255, 255, 255, 0.2);
|
|
||||||
border-top-color: white;
|
|
||||||
border-radius: 50%;
|
|
||||||
animation: spin 0.7s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes spin {
|
|
||||||
to { transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1200px) {
|
@media (max-width: 1200px) {
|
||||||
.board-wrapper {
|
.board-wrapper {
|
||||||
padding: 1em 0.25em;
|
padding: 1em 0.25em;
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import {computed, ref} from "vue";
|
||||||
|
import {Flight, User} from "@/Types/types";
|
||||||
|
import {router} from "@inertiajs/vue3";
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
profileUser: User
|
||||||
|
flight: Flight
|
||||||
|
canEdit: boolean
|
||||||
|
referrer?: "departure-board" | "boarding-passes"
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const deleting = ref(false)
|
||||||
|
function editRoute(id: number) {
|
||||||
|
return route('flights.edit', { flight: id })
|
||||||
|
}
|
||||||
|
|
||||||
|
const flightToDelete = ref<Flight | null>(null)
|
||||||
|
const showDeleteDialog = computed({
|
||||||
|
get: () => flightToDelete.value !== null,
|
||||||
|
set: (val) => { if (!val) flightToDelete.value = null }
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<v-menu>
|
||||||
|
<template #activator="{ props: menuProps }">
|
||||||
|
<v-btn
|
||||||
|
v-bind="menuProps"
|
||||||
|
icon="mdi-dots-horizontal"
|
||||||
|
variant="text"
|
||||||
|
size="small"
|
||||||
|
density="compact"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<v-list density="compact" bg-color="#1a1e2e">
|
||||||
|
<v-list-item
|
||||||
|
prepend-icon="mdi-magnify"
|
||||||
|
title="View Details"
|
||||||
|
:href="route('profile.flight', { userFlight: flight.id, user: profileUser.name })"
|
||||||
|
/>
|
||||||
|
<v-list-item v-if="canEdit"
|
||||||
|
prepend-icon="mdi-pencil-outline"
|
||||||
|
title="Edit"
|
||||||
|
:href="editRoute(flight.id)"
|
||||||
|
/>
|
||||||
|
<v-list-item v-if="canEdit"
|
||||||
|
prepend-icon="mdi-trash-can-outline"
|
||||||
|
title="Delete"
|
||||||
|
@click="flightToDelete = flight"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</v-list>
|
||||||
|
</v-menu>
|
||||||
|
<v-dialog v-if="canEdit" v-model="showDeleteDialog" max-width="400">
|
||||||
|
<v-card title="Delete Flight">
|
||||||
|
<v-card-text>Are you sure you want to delete this flight?</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer />
|
||||||
|
<v-btn v-if="!deleting" @click="flightToDelete = null">Cancel</v-btn>
|
||||||
|
<v-btn
|
||||||
|
color="error"
|
||||||
|
:loading="deleting"
|
||||||
|
@click="deleting = true; router.delete(
|
||||||
|
route('flights.delete', { flight: flightToDelete!.id , referrer: referrer ?? 'departure-board'}),
|
||||||
|
{ onFinish: () => { deleting = false; flightToDelete = null } }
|
||||||
|
)"
|
||||||
|
>
|
||||||
|
Delete
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -19,6 +19,7 @@ const props = defineProps<{
|
|||||||
flight: Flight
|
flight: Flight
|
||||||
flightCount: number
|
flightCount: number
|
||||||
isFollowing: boolean
|
isFollowing: boolean
|
||||||
|
canEdit: boolean
|
||||||
}>()
|
}>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ const props = defineProps<{
|
|||||||
<div class="profile-grid">
|
<div class="profile-grid">
|
||||||
<RoutePanel :flight="flight" />
|
<RoutePanel :flight="flight" />
|
||||||
<Panel label="Flight Details">
|
<Panel label="Flight Details">
|
||||||
<BoardingPass :showToolTips="false" style="width:100%;max-width:600px; margin:0 auto" :flight="flight"/>
|
<BoardingPass :user="user" :showToolTips="false" style="width:100%;max-width:600px; margin:0 auto" :flight="flight" :canEdit="canEdit" />
|
||||||
<DetailRows>
|
<DetailRows>
|
||||||
|
|
||||||
</DetailRows>
|
</DetailRows>
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ function switchView(view: ProfileView) {
|
|||||||
<ProfileLayout :is-following="isFollowing" :flightCount="flightCount" :user="user" :loading="flightsLoading">
|
<ProfileLayout :is-following="isFollowing" :flightCount="flightCount" :user="user" :loading="flightsLoading">
|
||||||
<ProfileViewSwitcher :user="user" :active-view="activeView" @update:active-view="switchView" />
|
<ProfileViewSwitcher :user="user" :active-view="activeView" @update:active-view="switchView" />
|
||||||
<DepartureBoard v-if="activeView === 'board'" :flight-id="localSelectedFlightId" :flight-stats="stats" :canEdit="canEdit" :user="user" />
|
<DepartureBoard v-if="activeView === 'board'" :flight-id="localSelectedFlightId" :flight-stats="stats" :canEdit="canEdit" :user="user" />
|
||||||
<BoardingPasses v-if="activeView === 'passes'" :flight-stats="stats" :canEdit="canEdit" />
|
<BoardingPasses v-if="activeView === 'passes'" :flight-stats="stats" :canEdit="canEdit" :user="user" />
|
||||||
<FlightMapAndCharts
|
<FlightMapAndCharts
|
||||||
v-if="activeView === 'map'"
|
v-if="activeView === 'map'"
|
||||||
:stats="stats"
|
:stats="stats"
|
||||||
|
|||||||
+10
-2
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use App\Http\Controllers\AchievementController;
|
use App\Http\Controllers\AchievementController;
|
||||||
use App\Http\Controllers\AdminToolsController;
|
use App\Http\Controllers\AdminToolsController;
|
||||||
|
use App\Http\Controllers\Api\AircraftApiController;
|
||||||
use App\Http\Controllers\Api\AirlineApiController;
|
use App\Http\Controllers\Api\AirlineApiController;
|
||||||
use App\Http\Controllers\Api\UserApiController;
|
use App\Http\Controllers\Api\UserApiController;
|
||||||
use App\Http\Controllers\FeedController;
|
use App\Http\Controllers\FeedController;
|
||||||
@@ -27,7 +28,10 @@ use Inertia\Inertia;
|
|||||||
Route::domain(config('app.domain'))->group(
|
Route::domain(config('app.domain'))->group(
|
||||||
function() {
|
function() {
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return Inertia::render(auth()->check() ? 'Dashboard' : 'Auth/Login');
|
if (auth()->check()) {
|
||||||
|
return redirect()->route('profile.view', auth()->user()->name);
|
||||||
|
}
|
||||||
|
return redirect()->route('login');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +52,7 @@ Route::domain(config('app.domain'))->group(
|
|||||||
Route::get('/flights/add', [FlightController::class, 'add'])->name('flights.add');
|
Route::get('/flights/add', [FlightController::class, 'add'])->name('flights.add');
|
||||||
Route::get('/flights/{flight}/edit', [FlightController::class, 'edit'])->name('flights.edit');
|
Route::get('/flights/{flight}/edit', [FlightController::class, 'edit'])->name('flights.edit');
|
||||||
Route::put('/flights/{flight}', [FlightController::class, 'update'])->name('flights.update');
|
Route::put('/flights/{flight}', [FlightController::class, 'update'])->name('flights.update');
|
||||||
Route::delete('/flights/{flight}', [FlightController::class, 'delete'])->name('flights.delete');
|
Route::delete('/flights/{flight}/{referrer?}', [FlightController::class, 'delete'])->name('flights.delete');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -117,6 +121,10 @@ Route::domain(config('app.api_domain'))->group(function () {
|
|||||||
Route::get('{airlineInternalName}/livery/{aircraftDesignator}', 'getLivery')->name('airline.livery');
|
Route::get('{airlineInternalName}/livery/{aircraftDesignator}', 'getLivery')->name('airline.livery');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::prefix('aircraft')->controller(AircraftApiController::class)->group(function () {
|
||||||
|
Route::get('{aircraftDesignator}/livery', 'getLivery')->name('aircraft.livery');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Route::prefix('user')->controller(UserApiController::class)->group(function () {
|
Route::prefix('user')->controller(UserApiController::class)->group(function () {
|
||||||
Route::get('{username}/next-flight', 'nextFlight');
|
Route::get('{username}/next-flight', 'nextFlight');
|
||||||
|
|||||||
Reference in New Issue
Block a user