Added search box

This commit is contained in:
2026-04-04 09:50:11 +10:00
parent 877caa3291
commit bfe246ab44
4 changed files with 10 additions and 3 deletions
@@ -31,6 +31,7 @@ class HandleInertiaRequests extends Middleware
{ {
return [ return [
...parent::share($request), ...parent::share($request),
'logo_api_url' => config('app.logo_api_url'),
'auth' => [ 'auth' => [
'user' => $request->user(), 'user' => $request->user(),
'isLoggedIn' => $request->user() !== null, 'isLoggedIn' => $request->user() !== null,
+1
View File
@@ -55,6 +55,7 @@ return [
'url' => env('APP_URL', 'http://localhost'), 'url' => env('APP_URL', 'http://localhost'),
'domain' => env('APP_DOMAIN', 'flightsgoneby.com'), 'domain' => env('APP_DOMAIN', 'flightsgoneby.com'),
'api_domain' => env('API_DOMAIN', 'api.flightsgoneby.com'), 'api_domain' => env('API_DOMAIN', 'api.flightsgoneby.com'),
'logo_api_url' => env('LOGO_API_URL', 'https://api.flightsgoneby.com'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Timezone | Application Timezone
@@ -1,12 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, nextTick } from 'vue' import { ref, nextTick } from 'vue'
import axios from 'axios' import axios from 'axios'
import {usePage} from "@inertiajs/vue3";
import type {SharedProps} from "@/Types/types";
const props = defineProps<{ const props = defineProps<{
prefilledOptions: { value: number, title: string }[] prefilledOptions: { value: number, title: string }[]
errorMessages?: string[] | string errorMessages?: string[] | string
}>() }>()
const page = usePage<SharedProps>().props
const model = defineModel<{ value: number, title: string } | null>() const model = defineModel<{ value: number, title: string } | null>()
const airlineOptions = ref(props.prefilledOptions ?? []) const airlineOptions = ref(props.prefilledOptions ?? [])
@@ -54,13 +58,13 @@ const searchAirlines = async (query: string) => {
style="padding: 0.25em" style="padding: 0.25em"
width="40" width="40"
height="40" height="40"
:src="`http://api.flightsgoneby.test:8000/airlines/logos/tail/id/${model.value}`" :src="`${page.logo_api_url}/airlines/logos/tail/id/${model.value}`"
/> />
</template> </template>
<template #item="{ item, props: itemProps }"> <template #item="{ item, props: itemProps }">
<v-list-item v-bind="itemProps"> <v-list-item v-bind="itemProps">
<template #prepend> <template #prepend>
<img style="padding:0.25em" width="40" height="40" :src="`http://api.flightsgoneby.test:8000/airlines/logos/tail/id/${item.value}`" /> <img style="padding:0.25em" width="40" height="40" :src="`${page.logo_api_url}/airlines/logos/tail/id/${item.value}`" />
</template> </template>
</v-list-item> </v-list-item>
+2 -1
View File
@@ -19,7 +19,8 @@ export type SharedProps = import('@inertiajs/core').PageProps & {
auth: { auth: {
user: User | null user: User | null
isLoggedIn: boolean isLoggedIn: boolean
} },
logo_api_url: string
} }
declare module '@inertiajs/vue3' { declare module '@inertiajs/vue3' {