netgescon-day0/resources/views/filament/pages/impostazioni/partials/scheda-amministratore-posta-operativita.blade.php

202 lines
12 KiB
PHP
Executable File

<div class="space-y-6">
{{-- Google OAuth & General Studio Actions --}}
<div class="rounded-2xl border border-slate-200 bg-white p-4 shadow-sm space-y-3">
<div class="flex items-center justify-between">
<div class="font-bold text-sm text-slate-900 flex items-center gap-2">
<span>🌐</span>
<span>Integrazione Google Workspace & Posta Studio</span>
</div>
<span class="text-xs text-slate-500">Convalida rapida OAuth e sincronizzazione IMAP</span>
</div>
<div class="text-xs text-slate-600 leading-relaxed">
Verifica via web la prontezza dell'integrazione Google e delle caselle IMAP/PEC dello studio. Le credenziali salvate sopra vengono utilizzate per scaricare le comunicazioni in formato canonico <code class="bg-slate-100 px-1 py-0.5 rounded text-indigo-600 font-mono">.EML</code>.
</div>
<div class="flex flex-wrap items-center gap-2 pt-1">
<x-filament::button type="button" color="success" wire:click="connectGoogle">
<span class="flex items-center gap-1.5">
<span>🔑</span>
<span>Collega Account Google</span>
</span>
</x-filament::button>
<x-filament::button type="button" color="info" wire:click="runGoogleOAuthReadinessCheck">
<span class="flex items-center gap-1.5">
<span>🔍</span>
<span>Verifica Google OAuth</span>
</span>
</x-filament::button>
<x-filament::button type="button" color="danger" wire:click="disconnectGoogle">
<span class="flex items-center gap-1.5">
<span>✕</span>
<span>Scollega Google</span>
</span>
</x-filament::button>
<a
href="{{ url('/admin-filament/comunicazioni/posta-ordinaria?stabile_id=studio') }}"
class="inline-flex items-center gap-1.5 px-3 py-1.5 bg-blue-50 text-blue-700 hover:bg-blue-100 border border-blue-200 text-xs font-semibold rounded-lg shadow-xs transition"
>
<span>✉️</span>
<span>Webmail Ordinaria Studio</span>
</a>
<a
href="{{ url('/admin-filament/comunicazioni/posta-pec?stabile_id=studio') }}"
class="inline-flex items-center gap-1.5 px-3 py-1.5 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 border border-emerald-200 text-xs font-semibold rounded-lg shadow-xs transition"
>
<span>🛡️</span>
<span>Webmail PEC Studio</span>
</a>
</div>
</div>
@if(filled($this->opsLastOutput))
<div class="rounded-2xl border border-slate-200 bg-slate-50 p-4 shadow-sm">
<div class="mb-2 text-xs font-bold text-slate-700 uppercase tracking-wider">Ultimo output verifica posta / Google</div>
<pre class="max-h-64 overflow-auto whitespace-pre-wrap text-xs font-mono text-slate-800 bg-white p-3 rounded-xl border border-slate-200">{{ $this->opsLastOutput }}</pre>
</div>
@endif
{{-- Stabili Mailboxes Overview Table (All 16 Stabili) --}}
@php
$stabiliStatus = $this->stabiliMailboxStatus;
@endphp
<div class="rounded-2xl border border-slate-200 bg-white shadow-sm overflow-hidden space-y-0">
<div class="border-b border-slate-200 bg-slate-50/80 px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2">
<div class="flex items-center gap-2.5">
<span class="text-lg">📬</span>
<div>
<div class="font-bold text-sm text-slate-900">Stato Posta e PEC degli Stabili Gestiti</div>
<div class="text-xs text-slate-500">Quadro di configurazione e monitoraggio messaggi per tutti i {{ count($stabiliStatus) }} stabili</div>
</div>
</div>
<div class="flex items-center gap-2">
<span class="rounded-full bg-indigo-50 border border-indigo-200 px-3 py-1 text-xs font-bold text-indigo-800">
{{ count($stabiliStatus) }} Stabili Attivi
</span>
</div>
</div>
<div class="overflow-x-auto">
<table class="w-full text-left text-xs">
<thead class="bg-slate-100/70 text-slate-700 font-semibold border-b border-slate-200">
<tr>
<th class="px-4 py-3">Stabile</th>
<th class="px-4 py-3">Codice Fiscale</th>
<th class="px-4 py-3">Posta Ordinaria (IMAP)</th>
<th class="px-4 py-3">Posta Certificata (PEC)</th>
<th class="px-4 py-3 text-center">Messaggi</th>
<th class="px-4 py-3 text-right">Azioni Rapide</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100">
@forelse($stabiliStatus as $stb)
<tr class="hover:bg-slate-50/60 transition">
<td class="px-4 py-3">
<div class="font-bold text-slate-900 text-sm flex items-center gap-1.5">
<span class="px-1.5 py-0.5 rounded bg-slate-200 text-slate-800 font-mono text-[11px]">{{ $stb['codice_stabile'] }}</span>
<span>{{ $stb['denominazione'] }}</span>
</div>
<div class="text-[11px] text-slate-500 mt-0.5">{{ $stb['comune'] ?: '' }}</div>
</td>
<td class="px-4 py-3 font-mono text-[11px] text-slate-700">
{{ $stb['codice_fiscale'] ?: '' }}
</td>
<td class="px-4 py-3">
@if($stb['email_configured'])
<div class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-emerald-50 border border-emerald-200 text-emerald-800 font-semibold text-[11px]">
<span class="w-2 h-2 rounded-full bg-emerald-500"></span>
<span>Configurata</span>
</div>
@if($stb['email_info'])
<div class="text-[10px] text-slate-400 font-mono truncate max-w-xs mt-1" title="{{ $stb['email_info'] }}">
{{ $stb['email_info'] }}
</div>
@endif
@else
<span class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-slate-100 border border-slate-200 text-slate-500 font-medium text-[11px]">
<span class="w-2 h-2 rounded-full bg-slate-400"></span>
<span>Non configurata</span>
</span>
@endif
</td>
<td class="px-4 py-3">
@if($stb['pec_configured'])
<div class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-emerald-50 border border-emerald-200 text-emerald-800 font-semibold text-[11px]">
<span class="w-2 h-2 rounded-full bg-emerald-500"></span>
<span>Configurata</span>
</div>
@if($stb['pec_info'])
<div class="text-[10px] text-slate-400 font-mono truncate max-w-xs mt-1" title="{{ $stb['pec_info'] }}">
{{ $stb['pec_info'] }}
</div>
@endif
@else
<span class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-slate-100 border border-slate-200 text-slate-500 font-medium text-[11px]">
<span class="w-2 h-2 rounded-full bg-slate-400"></span>
<span>Non configurata</span>
</span>
@endif
</td>
<td class="px-4 py-3 text-center">
@if($stb['msg_count'] > 0)
<span class="px-2 py-0.5 rounded-full bg-blue-100 text-blue-800 font-bold font-mono text-xs">
{{ $stb['msg_count'] }}
</span>
@else
<span class="text-slate-400 font-mono text-xs">0</span>
@endif
</td>
<td class="px-4 py-3 text-right whitespace-nowrap">
<div class="flex items-center justify-end gap-1.5">
<a
href="{{ $stb['config_url'] }}"
class="inline-flex items-center gap-1 px-2.5 py-1 text-[11px] font-semibold rounded-lg bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 transition"
title="Configura casella IMAP/PEC dello stabile"
>
<x-heroicon-m-cog-6-tooth class="w-3.5 h-3.5 text-slate-500" />
<span>Configura</span>
</a>
<a
href="{{ $stb['webmail_email_url'] }}"
class="inline-flex items-center gap-1 px-2.5 py-1 text-[11px] font-semibold rounded-lg bg-blue-50 hover:bg-blue-100 text-blue-700 border border-blue-200 transition"
title="Apri Webmail Posta Ordinaria"
>
<span>✉️</span>
<span>Posta</span>
</a>
<a
href="{{ $stb['webmail_pec_url'] }}"
class="inline-flex items-center gap-1 px-2.5 py-1 text-[11px] font-semibold rounded-lg bg-emerald-50 hover:bg-emerald-100 text-emerald-700 border border-emerald-200 transition"
title="Apri Webmail PEC"
>
<span>🛡️</span>
<span>PEC</span>
</a>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-4 py-8 text-center text-slate-400">
Nessuno stabile accessibile censito.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>