78 lines
4.1 KiB
PHP
78 lines
4.1 KiB
PHP
<x-filament-panels::page>
|
|
<div class="mx-auto max-w-7xl space-y-6">
|
|
<div class="bg-white border rounded-md p-4 space-y-3">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<div class="text-sm font-semibold text-gray-800">Richieste AI</div>
|
|
<div class="text-xs text-gray-500">File: incoming/ai_requests.md</div>
|
|
</div>
|
|
<button type="button" wire:click="$refresh" class="netgescon-btn netgescon-btn-outline-secondary netgescon-btn-sm">
|
|
Ricarica
|
|
</button>
|
|
</div>
|
|
<textarea class="w-full text-xs font-mono rounded-md border-gray-300" rows="10" readonly>{{ $aiRequestsText }}</textarea>
|
|
</div>
|
|
|
|
<div class="bg-white border rounded-md p-4 space-y-3">
|
|
<div>
|
|
<div class="text-sm font-semibold text-gray-800">Risposte AI</div>
|
|
<div class="text-xs text-gray-500">Salvato in: incoming/ai_responses.md</div>
|
|
</div>
|
|
<textarea wire:model.defer="aiResponseText" class="w-full text-xs font-mono rounded-md border-gray-300" rows="12"></textarea>
|
|
<div class="flex flex-wrap justify-end gap-2">
|
|
<button type="button" wire:click="saveAiQaToDb" class="netgescon-btn netgescon-btn-outline-secondary netgescon-btn-sm">
|
|
Registra Q/A in tabella
|
|
</button>
|
|
<button type="button" wire:click="saveAiResponse" class="netgescon-btn netgescon-btn-primary netgescon-btn-sm">
|
|
Salva risposta
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bg-white border rounded-md p-4 space-y-3">
|
|
<div>
|
|
<div class="text-sm font-semibold text-gray-800">Storico Q/A (DB)</div>
|
|
<div class="text-xs text-gray-500">Ultimi 50 record dalla tabella ai_requests.</div>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full text-xs border border-gray-200">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-2 py-1 text-left">ID</th>
|
|
<th class="px-2 py-1 text-left">Contesto</th>
|
|
<th class="px-2 py-1 text-left">Stato</th>
|
|
<th class="px-2 py-1 text-left">Filtri</th>
|
|
<th class="px-2 py-1 text-left">Richiesta</th>
|
|
<th class="px-2 py-1 text-left">Risposta</th>
|
|
<th class="px-2 py-1 text-left">Data</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($this->aiRequestsDb as $row)
|
|
<tr class="border-t">
|
|
<td class="px-2 py-1">{{ $row['id'] }}</td>
|
|
<td class="px-2 py-1">{{ $row['context'] }}</td>
|
|
<td class="px-2 py-1">{{ $row['status'] }}</td>
|
|
<td class="px-2 py-1">{{ json_encode($row['filters_json'], JSON_UNESCAPED_UNICODE) }}</td>
|
|
<td class="px-2 py-1">{{ $row['request_text'] }}</td>
|
|
<td class="px-2 py-1">{{ $row['response_text'] }}</td>
|
|
<td class="px-2 py-1">{{ $row['created_at'] }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr class="border-t">
|
|
<td class="px-2 py-2 text-center text-gray-500" colspan="7">Nessun record.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bg-white border rounded-md p-4 space-y-3">
|
|
<div class="text-sm font-semibold text-gray-800">Incassi</div>
|
|
<div class="text-xs text-gray-500">Elenco con azioni per dettaglio nominativo e feedback AI.</div>
|
|
{{ $this->table }}
|
|
</div>
|
|
</div>
|
|
</x-filament-panels::page>
|