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
140 lines
6.8 KiB
PHP
Executable File
140 lines
6.8 KiB
PHP
Executable File
@extends('layouts.admin')
|
|
|
|
@section('title', 'Chatbot - Conversas')
|
|
|
|
@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>Chatbot - Conversas
|
|
</h1>
|
|
<div class="d-flex gap-2">
|
|
<a href="{{ route('admin.chatbot.index') }}" class="btn btn-secondary btn-sm">
|
|
<i class="bi bi-book me-1"></i>Base de Conhecimento
|
|
</a>
|
|
<a href="{{ route('admin.chatbot.settings') }}" class="btn btn-secondary btn-sm">
|
|
<i class="bi bi-gear me-1"></i>Configurações
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
@if(session('success'))
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
{{ session('success') }}
|
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
@endif
|
|
|
|
<!-- Conversations Table -->
|
|
<div class="card shadow mb-4">
|
|
<div class="card-header py-3">
|
|
<h6 class="m-0 font-weight-bold text-primary">Contatos Recebidos ({{ $conversations->total() }} conversas)</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
@if($conversations->count() > 0)
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered table-hover" width="100%" cellspacing="0">
|
|
<thead>
|
|
<tr>
|
|
<th>Nome</th>
|
|
<th>Telefone</th>
|
|
<th>Cidade</th>
|
|
<th>Status</th>
|
|
<th>Avaliação</th>
|
|
<th>Mensagens</th>
|
|
<th>Data</th>
|
|
<th width="140">Ações</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($conversations as $conv)
|
|
<tr class="{{ $conv->status === 'ended' ? '' : 'font-weight-bold' }}">
|
|
<td>
|
|
<i class="bi bi-person me-1 text-primary"></i>{{ $conv->visitor_name }}
|
|
</td>
|
|
<td>
|
|
@if($conv->visitor_phone)
|
|
<a href="tel:{{ $conv->visitor_phone }}">
|
|
<i class="bi bi-telephone me-1"></i>{{ $conv->visitor_phone }}
|
|
</a>
|
|
@else
|
|
<span class="text-muted">—</span>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if($conv->visitor_city)
|
|
<i class="bi bi-geo-alt me-1"></i>{{ $conv->visitor_city }}
|
|
@else
|
|
<span class="text-muted">—</span>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if($conv->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>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if($conv->rating)
|
|
<span style="color: #f5a623; font-size: 1.1rem; letter-spacing: 2px;">
|
|
{{ str_repeat('★', $conv->rating) }}{{ str_repeat('☆', 5 - $conv->rating) }}
|
|
</span>
|
|
@if($conv->rating_comment)
|
|
<br><small class="text-muted" title="{{ $conv->rating_comment }}">
|
|
<i class="bi bi-chat-quote me-1"></i>{{ Str::limit($conv->rating_comment, 40) }}
|
|
</small>
|
|
@endif
|
|
@else
|
|
<span class="text-muted">—</span>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
<span class="badge badge-info">{{ $conv->messages->count() }} msgs</span>
|
|
</td>
|
|
<td>{{ $conv->created_at->format('d/m/Y H:i') }}</td>
|
|
<td>
|
|
<a href="{{ route('admin.chatbot.conversation.show', $conv) }}" class="btn btn-sm btn-outline-primary" title="Ver conversa">
|
|
<i class="bi bi-eye"></i>
|
|
</a>
|
|
@if($conv->visitor_phone)
|
|
<a href="https://wa.me/55{{ preg_replace('/\D/', '', $conv->visitor_phone) }}" target="_blank" class="btn btn-sm btn-outline-success" title="WhatsApp">
|
|
<i class="bi bi-whatsapp"></i>
|
|
</a>
|
|
@endif
|
|
<form action="{{ route('admin.chatbot.conversation.destroy', $conv) }}" method="POST" class="d-inline" onsubmit="return confirm('Tem certeza que deseja excluir esta conversa?');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn btn-sm btn-outline-danger" title="Excluir">
|
|
<i class="bi bi-trash"></i>
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-center">
|
|
{{ $conversations->withQueryString()->links() }}
|
|
</div>
|
|
@else
|
|
<div class="text-center py-5">
|
|
<i class="bi bi-chat-left-text text-muted" style="font-size: 3rem;"></i>
|
|
<h5 class="mt-3 text-muted">Nenhuma conversa registrada</h5>
|
|
<p class="text-muted">As conversas aparecerão aqui quando os visitantes iniciarem um chat.</p>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|