Files
dockersyshome/app/Modules/Chatbot/resources/views/admin/rules/index.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

111 lines
5.5 KiB
PHP
Executable File

@extends('layouts.admin')
@section('title', 'Chatbot - Regras da IA')
@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-shield-lock me-2"></i>Chatbot - Regras da IA
</h1>
<a href="{{ route('admin.chatbot.rules.create') }}" class="btn btn-primary btn-sm">
<i class="bi bi-plus-circle me-1"></i>Nova Regra
</a>
</div>
<!-- Info Card -->
<div class="card border-info mb-4">
<div class="card-body">
<h6 class="card-title mb-2"><i class="bi bi-info-circle me-1 text-info"></i>Como funcionam as Regras</h6>
<p class="small text-muted mb-0">
As regras são instruções obrigatórias que a IA <strong>deve seguir</strong> em todas as respostas.
Elas são enviadas automaticamente no início do prompt do sistema, antes das informações da base de conhecimento.
Use para definir tom de voz, proibições específicas, fluxos obrigatórios ou qualquer comportamento desejado.
Regras desativadas são ignoradas. Use o campo <strong>Ordem</strong> para definir a prioridade (menor = mais importante).
</p>
</div>
</div>
@if(session('success'))
<div class="alert alert-success alert-dismissible fade show" role="alert">
<i class="bi bi-check-circle me-1"></i>{{ session('success') }}
<button type="button" class="close" data-dismiss="alert" aria-label="Fechar">
<span aria-hidden="true">&times;</span>
</button>
</div>
@endif
<!-- Rules List -->
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex align-items-center">
<h6 class="m-0 font-weight-bold text-primary">Regras Configuradas</h6>
</div>
<div class="card-body p-0">
@if($rules->isEmpty())
<div class="text-center py-5">
<i class="bi bi-shield-lock" style="font-size:3rem;color:#dddfeb;"></i>
<p class="mt-3 text-muted">Nenhuma regra configurada ainda.</p>
<p class="text-muted small">Adicione regras para definir como a IA deve se comportar no atendimento.</p>
<a href="{{ route('admin.chatbot.rules.create') }}" class="btn btn-primary btn-sm">
<i class="bi bi-plus-circle me-1"></i>Adicionar Primeira Regra
</a>
</div>
@else
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead class="thead-light">
<tr>
<th width="60">Ordem</th>
<th>Título</th>
<th>Conteúdo da Regra</th>
<th width="100">Status</th>
<th width="140">Ações</th>
</tr>
</thead>
<tbody>
@foreach($rules as $rule)
<tr>
<td>
<span class="badge badge-secondary">{{ $rule->order }}</span>
</td>
<td>
<strong>{{ $rule->title }}</strong>
</td>
<td>
<span class="text-muted">{{ \Illuminate\Support\Str::limit($rule->content, 150) }}</span>
</td>
<td>
@if($rule->active)
<span class="badge badge-success"><i class="bi bi-check-circle"></i> Ativa</span>
@else
<span class="badge badge-secondary"><i class="bi bi-pause-circle"></i> Inativa</span>
@endif
</td>
<td>
<a href="{{ route('admin.chatbot.rules.edit', $rule) }}" class="btn btn-sm btn-outline-primary" title="Editar">
<i class="bi bi-pencil"></i>
</a>
<form action="{{ route('admin.chatbot.rules.destroy', $rule) }}" method="POST" class="d-inline" onsubmit="return confirm('Tem certeza que deseja excluir esta regra?');">
@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="p-3">
{{ $rules->withQueryString()->links() }}
</div>
@endif
</div>
</div>
</div>
@endsection