Small fixes
This commit is contained in:
@@ -36,6 +36,7 @@ class CountryCompareController extends Controller
|
|||||||
$requests = Http::pool(fn (Pool $pool) => [
|
$requests = Http::pool(fn (Pool $pool) => [
|
||||||
CountryCode::all()->each(function ($countryCode) use ($pool, $ta_code) {
|
CountryCode::all()->each(function ($countryCode) use ($pool, $ta_code) {
|
||||||
$this->countries[] = $countryCode->country_name;
|
$this->countries[] = $countryCode->country_name;
|
||||||
|
Log::info('Getting page {url}', [ 'url' => $countryCode->search_url . $ta_code ] );
|
||||||
return $pool->as($countryCode->country_name)->get($countryCode->search_url . $ta_code);
|
return $pool->as($countryCode->country_name)->get($countryCode->search_url . $ta_code);
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|||||||
38
resources/js/Components/SearchInput.vue
Normal file
38
resources/js/Components/SearchInput.vue
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<script setup>
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
modelValue: String,
|
||||||
|
});
|
||||||
|
|
||||||
|
defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
|
const input = ref(null);
|
||||||
|
|
||||||
|
// onMounted(() => {
|
||||||
|
// if (input.value.hasAttribute('autofocus')) {
|
||||||
|
// input.value.focus();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
defineExpose({ focus: () => input.value.focus() });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<form>
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<div class="flex border-2 rounded">
|
||||||
|
<input type="text" class="px-4 py-2 w-80"
|
||||||
|
:value="modelValue"
|
||||||
|
@input="$emit('update:modelValue', $event.target.value)" placeholder="Search...">
|
||||||
|
<button class="flex items-center justify-center px-4 border-l bg-slate-500">
|
||||||
|
<svg class="w-6 h-6 text-white" fill="currentColor" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24">
|
||||||
|
<path
|
||||||
|
d="M16.32 14.9l5.39 5.4a1 1 0 0 1-1.42 1.4l-5.38-5.38a8 8 0 1 1 1.41-1.41zM10 16a6 6 0 1 0 0-12 6 6 0 0 0 0 12z" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</template>
|
||||||
@@ -6,6 +6,7 @@ import Multiselect from 'vue-multiselect';
|
|||||||
import { GChart } from 'vue-google-charts';
|
import { GChart } from 'vue-google-charts';
|
||||||
import { FwbDropdown, FwbListGroup, FwbListGroupItem } from 'flowbite-vue';
|
import { FwbDropdown, FwbListGroup, FwbListGroupItem } from 'flowbite-vue';
|
||||||
import EasyTable from "vue3-easy-data-table";
|
import EasyTable from "vue3-easy-data-table";
|
||||||
|
import SearchInput from '@/Components/SearchInput.vue';
|
||||||
//import autocomplete from '@trevoreyre/autocomplete-vue';
|
//import autocomplete from '@trevoreyre/autocomplete-vue';
|
||||||
|
|
||||||
|
|
||||||
@@ -23,6 +24,7 @@ const ccountry = ref([]);
|
|||||||
const ccountry_filter = ref([['Country'],]);
|
const ccountry_filter = ref([['Country'],]);
|
||||||
const ccountry_list = ref(['TEST']);
|
const ccountry_list = ref(['TEST']);
|
||||||
const selected = ref(null);
|
const selected = ref(null);
|
||||||
|
const article = ref('');
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
region: 150,
|
region: 150,
|
||||||
@@ -131,9 +133,7 @@ onMounted(fetch);
|
|||||||
<span class="font-extrabold font-mono">Zadaj polozku</span>
|
<span class="font-extrabold font-mono">Zadaj polozku</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<multiselect :multiple="false" :options="[]">
|
<SearchInput v-model="article"></SearchInput>
|
||||||
|
|
||||||
</multiselect>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-5">
|
<div class="mt-5">
|
||||||
<EasyTable :rows-per-page=10 :headers="headers" :items="items"></EasyTable>
|
<EasyTable :rows-per-page=10 :headers="headers" :items="items"></EasyTable>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ Route::get('/', function () {
|
|||||||
Route::get('/ccountry/', [CountryCodeController::class, 'index'])->name('ccountry.index');
|
Route::get('/ccountry/', [CountryCodeController::class, 'index'])->name('ccountry.index');
|
||||||
Route::get('/ccountry/active/', [CountryCodeController::class, 'active'])->name('ccountry.active');
|
Route::get('/ccountry/active/', [CountryCodeController::class, 'active'])->name('ccountry.active');
|
||||||
Route::get('/search/{id}',[CountryCompareController::class,'search'])->name('ccompare.search');
|
Route::get('/search/{id}',[CountryCompareController::class,'search'])->name('ccompare.search');
|
||||||
|
|
||||||
Route::middleware(['auth:sanctum', config('jetstream.auth_session'), 'verified'])->group(function () {
|
Route::middleware(['auth:sanctum', config('jetstream.auth_session'), 'verified'])->group(function () {
|
||||||
// Route::get('/', function () {
|
// Route::get('/', function () {
|
||||||
// return Inertia::render('Dashboard');
|
// return Inertia::render('Dashboard');
|
||||||
|
|||||||
Reference in New Issue
Block a user