All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
104 lines
2.4 KiB
PHP
104 lines
2.4 KiB
PHP
<x-filament-panels::page>
|
|
|
|
|
|
{{ $this->form }}
|
|
|
|
<div class="flex flex-row gap-2 mt-4">
|
|
{{-- <button
|
|
type="button"
|
|
wire:click="generateSticker"
|
|
class="px-3 py-1 border border-primary-500 text-primary-600 rounded hover:bg-primary-50 hover:border-primary-700 transition text-sm"
|
|
>
|
|
Generate Sticker
|
|
</button> --}}
|
|
<button
|
|
type="button"
|
|
wire:click="generateStickerId"
|
|
class="px-3 py-1 border border-primary-500 text-primary-600 rounded hover:bg-primary-50 hover:border-primary-700 transition text-sm"
|
|
>
|
|
Generate Sticker
|
|
</button>
|
|
</div>
|
|
{{-- <label class="flex items-center gap-2 mt-4">
|
|
<input
|
|
type="checkbox"
|
|
wire:model="showMultipleSerials"
|
|
class="rounded border-gray-300 text-primary-600 focus:ring-primary-500"
|
|
>
|
|
<span class="text-sm font-medium">Show Multiple Serial Numbers</span>
|
|
</label> --}}
|
|
{{-- <div class="bg-white shadow rounded-xl p-4 mt-6">
|
|
<livewire:random-serial-number-list />
|
|
</div> --}}
|
|
|
|
<div class="bg-white shadow rounded-xl p-4 mt-6">
|
|
<livewire:random-serial-number-list
|
|
:plant-id="$filters['plant_id'] ?? null"
|
|
:machine-id="$filters['machine_id'] ?? null"
|
|
/>
|
|
</div>
|
|
|
|
{{-- <script>
|
|
document.addEventListener('livewire:init', () => {
|
|
|
|
Livewire.on('open-sticker-pdf', (event) => {
|
|
|
|
console.log('PDF EVENT RECEIVED', event);
|
|
|
|
const urls = event.urls;
|
|
|
|
console.log('PDF URLs:', urls);
|
|
|
|
urls.forEach(url => {
|
|
window.open(url, '_blank');
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
</script> --}}
|
|
|
|
<script>
|
|
document.addEventListener('livewire:init', () => {
|
|
|
|
if (window.stickerPdfListenerRegistered) {
|
|
return;
|
|
}
|
|
|
|
window.stickerPdfListenerRegistered = true;
|
|
|
|
Livewire.on('open-sticker-pdf', (event) => {
|
|
|
|
const urls = event.urls || [];
|
|
|
|
if (!urls.length) {
|
|
return;
|
|
}
|
|
|
|
urls.forEach((url, index) => {
|
|
|
|
setTimeout(() => {
|
|
|
|
const link = document.createElement('a');
|
|
|
|
link.href = url;
|
|
|
|
link.download = '';
|
|
|
|
document.body.appendChild(link);
|
|
|
|
link.click();
|
|
|
|
document.body.removeChild(link);
|
|
|
|
}, index * 1000);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
</x-filament-panels::page>
|