Added search box
This commit is contained in:
@@ -31,6 +31,7 @@ class HandleInertiaRequests extends Middleware
|
||||
{
|
||||
return [
|
||||
...parent::share($request),
|
||||
'logo_api_url' => config('app.logo_api_url'),
|
||||
'auth' => [
|
||||
'user' => $request->user(),
|
||||
'isLoggedIn' => $request->user() !== null,
|
||||
|
||||
@@ -55,6 +55,7 @@ return [
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
'domain' => env('APP_DOMAIN', 'flightsgoneby.com'),
|
||||
'api_domain' => env('API_DOMAIN', 'api.flightsgoneby.com'),
|
||||
'logo_api_url' => env('LOGO_API_URL', 'https://api.flightsgoneby.com'),
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick } from 'vue'
|
||||
import axios from 'axios'
|
||||
import {usePage} from "@inertiajs/vue3";
|
||||
import type {SharedProps} from "@/Types/types";
|
||||
|
||||
const props = defineProps<{
|
||||
prefilledOptions: { value: number, title: string }[]
|
||||
errorMessages?: string[] | string
|
||||
}>()
|
||||
|
||||
const page = usePage<SharedProps>().props
|
||||
|
||||
const model = defineModel<{ value: number, title: string } | null>()
|
||||
|
||||
const airlineOptions = ref(props.prefilledOptions ?? [])
|
||||
@@ -54,13 +58,13 @@ const searchAirlines = async (query: string) => {
|
||||
style="padding: 0.25em"
|
||||
width="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 #item="{ item, props: itemProps }">
|
||||
<v-list-item v-bind="itemProps">
|
||||
<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>
|
||||
|
||||
</v-list-item>
|
||||
|
||||
Vendored
+2
-1
@@ -19,7 +19,8 @@ export type SharedProps = import('@inertiajs/core').PageProps & {
|
||||
auth: {
|
||||
user: User | null
|
||||
isLoggedIn: boolean
|
||||
}
|
||||
},
|
||||
logo_api_url: string
|
||||
}
|
||||
|
||||
declare module '@inertiajs/vue3' {
|
||||
|
||||
Reference in New Issue
Block a user