Files
dockersyshome/app/Modules/Chatbot/resources/views/admin/conversation-show.blade.php
T
marco 38295e7e88 feat(cms): implement complete SysSiteCMS content management system
Initial implementation of the HomeSysPanel CMS built with Laravel 13.0.
Includes complete admin panel, content management, user authentication,
modular architecture for products/services/chatbot, and marketing tools.

Key features:
- User authentication with email verification and password reset
- Role-based access control (Admin/User with granular permissions)
- Content management (pages, news, FAQ, downloads, galleries, banners)
- Contact management system with subjects and responses
- Marketing tools (email campaigns, visitor analytics, social sharing)
- Modular architecture (Products, Services, Chatbot modules)
- AI Chatbot integration with OpenRouter.ai and LlamaCpp support
- Visitor tracking with geolocation
- SEO optimization with meta tags and Open Graph
- Responsive design with Bootstrap 5
- Dark mode support
- Maintenance mode
- Feature request system
2026-09-07 19:06:53 -03:00

127 lines
6.1 KiB
PHP
Executable File

@extends('layouts.admin')
@section('title', 'Chatbot - Conversa com ' . $conversation->visitor_name)
@section('content')
<div class="container-fluid px-4">
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 text-gray-800">
<i class="bi bi-robot me-2"></i>Conversa com {{ $conversation->visitor_name }}
</h1>
<a href="{{ route('admin.chatbot.conversations') }}" class="btn btn-secondary btn-sm">
<i class="bi bi-arrow-left me-1"></i>Voltar
</a>
</div>
<!-- Visitor Info Card -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
<i class="bi bi-person me-1"></i>Dados do Visitante
</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-3">
<p class="mb-1 text-muted small">Nome</p>
<p class="font-weight-bold">{{ $conversation->visitor_name }}</p>
</div>
<div class="col-md-3">
<p class="mb-1 text-muted small">Telefone</p>
<p>
@if($conversation->visitor_phone)
<a href="tel:{{ $conversation->visitor_phone }}">{{ $conversation->visitor_phone }}</a>
<a href="https://wa.me/55{{ preg_replace('/\D/', '', $conversation->visitor_phone) }}" target="_blank" class="btn btn-sm btn-success ml-2">
<i class="bi bi-whatsapp me-1"></i>WhatsApp
</a>
@else
<span class="text-muted">—</span>
@endif
</p>
</div>
<div class="col-md-3">
<p class="mb-1 text-muted small">Cidade</p>
<p>{{ $conversation->visitor_city ?? '—' }}</p>
</div>
<div class="col-md-3">
<p class="mb-1 text-muted small">Status</p>
<p>
@if($conversation->status === 'active')
<span class="badge badge-success">
<i class="bi bi-chat-dots me-1"></i>Ativa
</span>
@else
<span class="badge badge-secondary">
<i class="bi bi-check-circle me-1"></i>Finalizada
</span>
@if($conversation->ended_at)
<br><small class="text-muted">{{ $conversation->ended_at->format('d/m/Y H:i:s') }}</small>
@endif
@endif
</p>
</div>
</div>
<div class="row">
<div class="col-md-3">
<p class="mb-1 text-muted small">Data de Início</p>
<p>{{ $conversation->created_at->format('d/m/Y H:i:s') }}</p>
</div>
<div class="col-md-3">
<p class="mb-1 text-muted small">Total de Mensagens</p>
<p>{{ $conversation->messages->count() }}</p>
</div>
<div class="col-md-6">
<p class="mb-1 text-muted small">Avaliação do Atendimento</p>
<p>
@if($conversation->rating)
<span style="color: #f5a623; font-size: 1.3rem; letter-spacing: 2px;">
{{ str_repeat('★', $conversation->rating) }}{{ str_repeat('☆', 5 - $conversation->rating) }}
</span>
<span class="ml-2">({{ $conversation->rating }}/5)</span>
@if($conversation->rating_comment)
<br><span class="text-muted"><i class="bi bi-chat-quote me-1"></i>"{{ $conversation->rating_comment }}"</span>
@endif
@else
<span class="text-muted">Não avaliada</span>
@endif
</p>
</div>
</div>
</div>
</div>
<!-- Chat Messages -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
<i class="bi bi-chat-dots me-1"></i>Histórico de Mensagens
</h6>
</div>
<div class="card-body p-0">
<div class="p-3" style="max-height: 500px; overflow-y: auto;">
@forelse($conversation->messages as $message)
<div class="d-flex mb-3 {{ $message->role === 'user' ? 'justify-content-end' : '' }}">
<div class="{{ $message->role === 'user' ? 'bg-primary text-white' : 'bg-light' }} rounded p-3" style="max-width: 75%;">
<div class="small font-weight-bold mb-1 {{ $message->role === 'user' ? 'text-white-50' : 'text-muted' }}">
@if($message->role === 'user')
<i class="bi bi-person me-1"></i>{{ $conversation->visitor_name }}
@elseif($message->role === 'assistant')
<i class="bi bi-robot me-1"></i>Assistente
@else
<i class="bi bi-gear me-1"></i>Sistema
@endif
<span class="ml-2" style="font-size: 0.7rem;">{{ $message->created_at->format('H:i') }}</span>
</div>
<div style="white-space: pre-wrap;">{{ $message->content }}</div>
</div>
</div>
@empty
<p class="text-center text-muted py-4">Nenhuma mensagem nesta conversa.</p>
@endforelse
</div>
</div>
</div>
</div>
@endsection