netgescon-day0/resources/views/superadmin/impostazioni/index.blade.php

142 lines
8.0 KiB
PHP

@extends('admin.layouts.netgescon')
@section('title', 'Impostazioni Sistema')
@section('breadcrumb')
<a href="{{ route('superadmin.dashboard') }}">SuperAdmin</a>
<i class="fas fa-chevron-right text-xs"></i>
<span>Impostazioni Sistema</span>
@endsection
@section('content')
<div class="space-y-4">
<h2 class="text-xl font-semibold">Registrazione e Sicurezza</h2>
<div class="netgescon-card p-4">
<h3 class="font-semibold mb-2">Check Servizi Google</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-3 text-sm">
<div class="p-3 rounded border">
<div class="font-medium">Configurazione OAuth</div>
<div class="mt-1">Client ID: {{ ($googleStatus['client_id_configured'] ?? false) ? 'ok' : 'mancante' }}</div>
<div>Client Secret: {{ ($googleStatus['client_secret_configured'] ?? false) ? 'ok' : 'mancante' }}</div>
<div>Redirect URI: {{ ($googleStatus['redirect_configured'] ?? false) ? 'ok' : 'mancante' }}</div>
</div>
<div class="p-3 rounded border">
<div class="font-medium">Connessione Account</div>
<div class="mt-1">Stato: {{ ($googleStatus['oauth_connected'] ?? false) ? 'collegato' : 'non collegato' }}</div>
<div>Email: {{ $googleStatus['oauth_email'] ?? '-' }}</div>
</div>
<div class="p-3 rounded border">
<div class="font-medium">Servizi</div>
<div class="mt-1">Calendar: {{ ($googleStatus['calendar_enabled'] ?? false) ? 'ok' : 'ko' }}</div>
<div>Rubrica: {{ ($googleStatus['contacts_enabled'] ?? false) ? 'ok' : 'ko' }}</div>
<div>Drive: {{ ($googleStatus['drive_enabled'] ?? false) ? 'ok' : 'ko' }}</div>
</div>
</div>
</div>
<form method="POST" action="{{ route('superadmin.impostazioni.store') }}" class="space-y-4">
@csrf
<div class="netgescon-card p-4 grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm text-gray-600">Registrazione pubblica</label>
<select name="registration_enabled" class="netgescon-input w-full">
<option value="true" @selected(($settings['registration_enabled'] ?? 'true') === 'true')>Abilitata</option>
<option value="false" @selected(($settings['registration_enabled'] ?? 'true') === 'false')>Disabilitata</option>
</select>
</div>
<div>
<label class="block text-sm text-gray-600">Conferma email obbligatoria</label>
<select name="require_email_verification" class="netgescon-input w-full">
<option value="true" @selected(($settings['require_email_verification'] ?? 'true') === 'true')>Si</option>
<option value="false" @selected(($settings['require_email_verification'] ?? 'true') === 'false')>No</option>
</select>
</div>
<div>
<label class="block text-sm text-gray-600">Versione reCAPTCHA</label>
<select name="recaptcha_version" class="netgescon-input w-full">
<option value="none" @selected(($settings['recaptcha_version'] ?? 'none') === 'none')>Disabilitato</option>
<option value="v2" @selected(($settings['recaptcha_version'] ?? 'none') === 'v2')>v2 Checkbox</option>
<option value="v3" @selected(($settings['recaptcha_version'] ?? 'none') === 'v3')>v3 Score</option>
</select>
</div>
<div>
<label class="block text-sm text-gray-600">reCAPTCHA Site Key</label>
<input type="text" name="recaptcha_site_key" class="netgescon-input w-full" value="{{ old('recaptcha_site_key', $settings['recaptcha_site_key'] ?? '') }}">
</div>
<div class="md:col-span-2">
<label class="block text-sm text-gray-600">reCAPTCHA Secret Key</label>
<input type="text" name="recaptcha_secret_key" class="netgescon-input w-full" value="{{ old('recaptcha_secret_key', $settings['recaptcha_secret_key'] ?? '') }}">
</div>
</div>
<div class="netgescon-card p-4 grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="md:col-span-2">
<h3 class="font-semibold mb-2">Comunicazioni Omnicanale (Test)</h3>
<p class="text-xs text-gray-500">Puoi instradare i webhook su ticket o post-it usando query param: <code>?mode=ticket&ticket_id=123</code> oppure <code>?mode=auto_post_it</code>.</p>
</div>
<div>
<label class="block text-sm text-gray-600">Telegram Bot Token</label>
<input type="text" name="telegram_bot_token" class="netgescon-input w-full" value="{{ old('telegram_bot_token', $settings['telegram_bot_token'] ?? '') }}">
</div>
<div>
<label class="block text-sm text-gray-600">Telegram Webhook Token (sicurezza)</label>
<input type="text" name="telegram_webhook_token" class="netgescon-input w-full" value="{{ old('telegram_webhook_token', $settings['telegram_webhook_token'] ?? '') }}">
</div>
<div>
<label class="block text-sm text-gray-600">WhatsApp Phone Number ID</label>
<input type="text" name="whatsapp_phone_number_id" class="netgescon-input w-full" value="{{ old('whatsapp_phone_number_id', $settings['whatsapp_phone_number_id'] ?? '') }}">
</div>
<div>
<label class="block text-sm text-gray-600">WhatsApp Business Account ID</label>
<input type="text" name="whatsapp_business_account_id" class="netgescon-input w-full" value="{{ old('whatsapp_business_account_id', $settings['whatsapp_business_account_id'] ?? '') }}">
</div>
<div class="md:col-span-2">
<label class="block text-sm text-gray-600">WhatsApp Access Token (Meta Cloud API)</label>
<input type="text" name="whatsapp_access_token" class="netgescon-input w-full" value="{{ old('whatsapp_access_token', $settings['whatsapp_access_token'] ?? '') }}">
</div>
<div class="md:col-span-2">
<label class="block text-sm text-gray-600">WhatsApp Webhook Token (sicurezza)</label>
<input type="text" name="whatsapp_webhook_token" class="netgescon-input w-full" value="{{ old('whatsapp_webhook_token', $settings['whatsapp_webhook_token'] ?? '') }}">
</div>
<div class="md:col-span-2 text-xs text-gray-600">
<div>Webhook Telegram: <code>{{ url('/api/v1/communications/telegram/webhook') }}</code></div>
<div>Webhook WhatsApp: <code>{{ url('/api/v1/communications/whatsapp/webhook') }}</code></div>
</div>
</div>
<div class="netgescon-card p-4">
<h3 class="font-semibold mb-2">Tema Interfaccia Personale</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div>
<label class="block text-sm text-gray-600">Sfondo</label>
<input type="color" name="bg_color" class="netgescon-input w-full h-10" value="{{ old('bg_color', $settings['bg_color'] ?? '#ffffff') }}">
</div>
<div>
<label class="block text-sm text-gray-600">Testo</label>
<input type="color" name="text_color" class="netgescon-input w-full h-10" value="{{ old('text_color', $settings['text_color'] ?? '#1e293b') }}">
</div>
<div>
<label class="block text-sm text-gray-600">Accento</label>
<input type="color" name="accent_color" class="netgescon-input w-full h-10" value="{{ old('accent_color', $settings['accent_color'] ?? '#6366f1') }}">
</div>
</div>
</div>
<div class="flex justify-end">
<button class="netgescon-btn netgescon-btn-primary">Salva Impostazioni</button>
</div>
</form>
</div>
@endsection