@extends('layouts.app') @section('title', 'Chatbot AI — Log & Monitoring') @section('content') {{-- Stats --}}
{{ number_format($stats['today_total']) }}
Respons Hari Ini
{{ number_format($stats['today_escalated']) }}
Eskalasi Hari Ini
@if($stats['today_total'] > 0)
{{ round(($stats['today_escalated'] / $stats['today_total']) * 100, 1) }}% dari total
@endif
{{ number_format($stats['month_total']) }}
Respons Bulan Ini
{{ $stats['avg_ms'] > 0 ? $stats['avg_ms'] . 'ms' : '—' }}
Rata-rata Respons
{{-- Log Table --}}
{{-- Filter --}}
@if(request()->hasAny(['search','escalated','date'])) Reset @endif
@if($logs->isEmpty())
Belum ada log chatbot

Log akan muncul setelah chatbot aktif menerima pesan

@else @foreach($logs as $log) @endforeach
Waktu Kontak Intent Pesan User Respons AI Waktu (ms) Status
{{ $log->created_at->locale('id')->isoFormat('D MMM, HH:mm') }} @if($log->conversation?->contact) {{ $log->conversation->contact->name }} @elseif($log->conversation) {{ $log->conversation->wa_number }} @else @endif {{ $log->intent ?? 'general' }}
{{ Str::limit($log->user_input, 50) }}
{{ Str::limit($log->ai_response, 50) }}
@if($log->response_ms) {{ number_format($log->response_ms) }}ms @else @endif @if($log->escalated) Eskalasi @else OK @endif
@endif
@if($logs->hasPages())
{{ $logs->firstItem() }}–{{ $logs->lastItem() }} dari {{ $logs->total() }}
@endif
{{-- Intent Chart --}}
Intent Bulan Ini
@if($intentChart->isEmpty())

Belum ada data

@else
@php $maxCount = $intentChart->max('total'); @endphp @foreach($intentChart as $item)
{{ $item->intent ?? 'general' }} {{ number_format($item->total) }}
@endforeach
@endif
{{-- Quick actions --}}
@endsection